Title not showing on Index Page and Shopping Cart Page

Open to all! Ask other shopowners for help.
radhavallabh
Senior Contributor
Posts: 466
Joined: Tue Oct 27, 2020 4:09 am
Phoenix Version: 1.1.0.6
Has thanked: 29 times
Been thanked: 3 times

Re: Title not showing on Index Page and Shopping Cart Page

Post by radhavallabh »

ecartz wrote: Tue May 24, 2022 12:57 pm Are you missing https://github.com/CE-PhoenixCart/Phoen ... .sql#L1139

You'd have to check the hooks table in the database to see. Or maybe admin > Modules > Hooks
Yes dear
Hook ID 86 in my screenshot
Screenshot 2022-05-24 at 18-34-12 mysqladmin.fatcow.com _ 1 _ umamahadev _ hooks phpMyAdmin 4.8.5.png
You do not have the required permissions to view the files attached to this post.


Join The Code Co-op to get access to your library in the Code Co-op Forum
radhavallabh
Senior Contributor
Posts: 466
Joined: Tue Oct 27, 2020 4:09 am
Phoenix Version: 1.1.0.6
Has thanked: 29 times
Been thanked: 3 times

Re: Title not showing on Index Page and Shopping Cart Page

Post by radhavallabh »

ecartz wrote: Tue May 24, 2022 12:57 pm Are you missing https://github.com/CE-PhoenixCart/Phoen ... .sql#L1139

You'd have to check the hooks table in the database to see. Or maybe admin > Modules > Hooks
Hi dear;
Any other file or entry where I should check please.... As still not able to locate as why the function does not work.....

Thank you in advance;
Very Warm Regds./
radhavallabh
User avatar
burt
Core Team
Posts: 4551
Joined: Tue Oct 29, 2019 9:37 am
Phoenix Version: v1.1.0.8
Has thanked: 252 times
Been thanked: 412 times

Re: Title not showing on Index Page and Shopping Cart Page

Post by burt »

radhavallabh wrote: Tue May 24, 2022 11:17 am it only shows the Store Page title on pages like shopping_cart.php
I did this in the LANGUAGE FILE:
22222.jpg
Which outputted this on the shopping_cart page:
111111.jpg
You do not have the required permissions to view the files attached to this post.
I am not here to build for you.
I am here to build with you. Let's help each other.
radhavallabh
Senior Contributor
Posts: 466
Joined: Tue Oct 27, 2020 4:09 am
Phoenix Version: 1.1.0.6
Has thanked: 29 times
Been thanked: 3 times

Re: Title not showing on Index Page and Shopping Cart Page

Post by radhavallabh »

burt wrote: Tue May 24, 2022 5:31 pm
radhavallabh wrote: Tue May 24, 2022 11:17 am it only shows the Store Page title on pages like shopping_cart.php
I did this in the LANGUAGE FILE:

22222.jpg

Which outputted this on the shopping_cart page:

111111.jpg
Hi dear;
Thank you so much dear this helps to add relevant titles to the core pages for me...

But I am still not able to figure out why the get_title() is not working dear....

I even tried below in system file of system/ 1.0.8.4/template.php

Code: Select all

 class Template extends oscTemplate {

    protected $_title= TITLE;
But this then thows the error TITLE not defined although it adds word TITLE to the Page Title Tab....

Please can you help me and guide on this that how to resolve my this issue...
Very warm Regds./
radhavallabh
ecartz
Core Team
Posts: 3084
Joined: Tue Nov 05, 2019 6:02 pm
Phoenix Version:
Has thanked: 4 times
Been thanked: 208 times

Re: Title not showing on Index Page and Shopping Cart Page

Post by ecartz »

A page,

1. Requires includes/application_top.php
2. Which generates the system hooks.
3. Which load the title hook.
4. Which calls Application->set_template_title

You could add debugging logging at each step to try to see what's failing.
radhavallabh
Senior Contributor
Posts: 466
Joined: Tue Oct 27, 2020 4:09 am
Phoenix Version: 1.1.0.6
Has thanked: 29 times
Been thanked: 3 times

Re: Title not showing on Index Page and Shopping Cart Page

Post by radhavallabh »

ecartz wrote: Wed May 25, 2022 7:07 am A page,

1. Requires includes/application_top.php
2. Which generates the system hooks.
3. Which load the title hook.
4. Which calls Application->set_template_title

You could add debugging logging at each step to try to see what's failing.
Hi dear;
@ecartz
Thank you for guiding me further in right direction.....

I did the below
I added debug_print_backtrace() to below function in application.php-
public function set_template_title() {
Guarantor::ensure_global('Template')->set_title(TITLE);
debug_print_backtrace() ;
}
Here is my output
#0 Application->set_template_title(Array ()) called at [/xx/includes/system/versioned/1.0.8.1/hooks.php:160] #1 hooks->generate(startApplication) called at [/xx/includes/application_top.php:30] #2 require(/xx/includes/application_top.php) called at [/xx/index.php:13]


Then I again tried below
I added debug_print_backtrace() to below function in system/versioned/1.0.8.4/template.php-

public function set_title($title) {
debug_print_backtrace();
$this->_title = $title;
}

Here is my output
#0 Template->set_title(Radha Krishna Spiritual Store) called at [/xx/includes/classes/application.php:65] #1 Application->set_template_title(Array ()) called at [/xx/includes/system/versioned/1.0.8.1/hooks.php:160] #2 hooks->generate(startApplication) called at [/xx/includes/application_top.php:30] #3 require(/xx/includes/application_top.php) called at [/xx/index.php:13] #0 Application->set_template_title(Array ()) called at [/xx/includes/system/versioned/1.0.8.1/hooks.php:160] #1 hooks->generate(startApplication) called at [/xx/includes/application_top.php:30] #2 require(/xx/includes/application_top.php) called at [/xx/index.php:13]

I think as Application->set_template_title is being called twice which may be the root of the trouble dear??

As on the test install this is called once only...
Correction
Found it was called twice because of header_tag module Manufacturer Title.

Now I added debug_print_backtrace() to below function in system/versioned/1.0.8.4/template.php
public function get_title() {
debug_print_backtrace();
$this->_title = $title;
}

Here is my output
#0 Template->get_title() called at [xx/includes/modules/header_tags/ht_pages_seo.php:29] #1 ht_pages_seo->execute() called at [/xx/includes/system/override/slim_checkout/template.php:89] #2 Template->build_blocks() called at [/xx/templates/override/includes/components/template_top.php:13] #3 require(/xx/templates/override/includes/components/template_top.php) called at [/xx/templates/default/includes/pages/index.php:13] #4 require(/xx/templates/default/includes/pages/index.php) called at [/xx/index.php:17]

When I turn header tag module ht_pages_seo off
There is no return for this function get_title dear....


Please can you help me understand the problem above dear as Template->get_title is empty....

Thank you very much in advance;
Very Warm Regds./
radhavallabh
radhavallabh
Senior Contributor
Posts: 466
Joined: Tue Oct 27, 2020 4:09 am
Phoenix Version: 1.1.0.6
Has thanked: 29 times
Been thanked: 3 times

Re: Title not showing on Index Page and Shopping Cart Page

Post by radhavallabh »

ecartz wrote: Wed May 25, 2022 7:07 am A page,

1. Requires includes/application_top.php
2. Which generates the system hooks.
3. Which load the title hook.
4. Which calls Application->set_template_title

You could add debugging logging at each step to try to see what's failing.
Dear @ecartz
In addition to my previous post it seems on the get_template , get_title when I paste my debug_print_backtrace(); after the return..........; It does not seem to get anything, only on the set_ funstions it gets all the back trace as pasted previously.
I would like to mention that the template file of slim checkout in system override is exactly the same as the original versioned file just a addition is made to the block function.
And my template_top.php override file is exactly the same as default.

Thank you in advance;
Awaiting your valuable guidance;
Warm Regds./
radhavallabh
ecartz
Core Team
Posts: 3084
Joined: Tue Nov 05, 2019 6:02 pm
Phoenix Version:
Has thanked: 4 times
Been thanked: 208 times

Re: Title not showing on Index Page and Shopping Cart Page

Post by ecartz »

By debugging output, I mean that you need to log the argument values. E.g. TITLE, $title, etc.
radhavallabh
Senior Contributor
Posts: 466
Joined: Tue Oct 27, 2020 4:09 am
Phoenix Version: 1.1.0.6
Has thanked: 29 times
Been thanked: 3 times

Re: Title not showing on Index Page and Shopping Cart Page

Post by radhavallabh »

ecartz wrote: Wed May 25, 2022 2:31 pm By debugging output, I mean that you need to log the argument values. E.g. TITLE, $title, etc.
Hi dear @ecartz ;
On further debugging (with my very little knowledge- I am Sorry for my errors)

In system/versioned/1.0.8.4/template.php

On the set_title function I get as below for print_r(get_defined_vars())-
Array ( [title] => Radha Krishna Spiritual Store )

On the get_title function it returns empty when I use get_defined_vars()
I get as below when I try to echo and get_defined_vars() for $title in the same get_title function.
Array ( [title] => )



Then I tried var_dump($title) in application_top.php
It returned an error
Notice: Undefined variable: title in xx/includes/application_top.php on line 47

Then again I tried
print_r(get_defined_vars($title));
Notice: Undefined variable: title in xx/includes/application_top.php on line 47

Then I tried print_r(get_defined_vars()) and print_r(get_defined_constants()); in application_top.php;

I got below output for [TITLE]
[TITLE] => Radha Krishna Spiritual Store (1 times)

But for [title] I got only the output for the currency values dear many times
Array ( [title] => US Dollar



Then I tried print_r(get_defined_vars()) and print_r(get_defined_constants()); in system/versioned/hooks/1.0.8.1.php after line 160;

I got below output for [TITLE]
[TITLE] => Radha Krishna Spiritual Store (17 times)

But for [title] I got only the output for the currency values dear
Array ( [title] => US Dollar



Please guide and help me know where the issue is dear....
Thank you for helping and guiding me dear....

Very Warm Regds./
radhavallabh
ecartz
Core Team
Posts: 3084
Joined: Tue Nov 05, 2019 6:02 pm
Phoenix Version:
Has thanked: 4 times
Been thanked: 208 times

Re: Title not showing on Index Page and Shopping Cart Page

Post by ecartz »

radhavallabh wrote: Thu May 26, 2022 6:41 am On the set_title function I get as below for print_r(get_defined_vars())-
Array ( [title] => Radha Krishna Spiritual Store )

On the get_title function it returns empty when I use get_defined_vars()
I get as below when I try to echo and get_defined_vars() for $title in the same get_title function.
Array ( [title] => )
In get_title, try

Code: Select all

echo "get_title[{$this->_title}]";
or

Code: Select all

error_log($this->_title);
or

Code: Select all

print_r($this);


Join The Code Co-op to get access to your library in the Code Co-op Forum
Post Reply