Page 1 of 1

Meta title contactus & advanced search

Posted: Sat Oct 11, 2025 11:32 am
by BatteryTrader
Have 1.1.03

Now I loathe to ask this, but I cannot find it, want to add meta title tags to the contact us and advanced search pages, at the moment they are picking up just the website name, so creating dups, not the end of the world, but I cannot find where to edit them, I have a very bad feeling its going to be easy, but a gentle nudge would be nice.

Regards

David

Re: Meta title contactus & advanced search

Posted: Sat Oct 11, 2025 12:08 pm
by ecartz
https://github.com/CE-PhoenixCart/Phoen ... on.php#L65

Code: Select all

      Guarantor::ensure_global('Template')->set_title(TITLE);
That sets the title.

https://github.com/CE-PhoenixCart/Phoen ... hp#L23-L28

Code: Select all

        $GLOBALS['Template']->set_title(
          ((MODULE_HEADER_TAGS_PRODUCT_TITLE_SEO_TITLE_OVERRIDE === 'True') && ( !Text::is_empty($product->get('seo_title')))
            ? $product->get('seo_title')
            : $product->get('name'))
          . MODULE_HEADER_TAGS_PRODUCT_SEO_SEPARATOR
          . $GLOBALS['Template']->get_title());
That adds the product SEO title to the meta title.

You could add something like

Code: Select all

Guarantor::ensure_global('Template')->set_title(CONTACT_US_TITLE . $GLOBALS['Template']->get_title());
by hook. E.g. hook_shop_contact_us_title->listen_injectRedirects

In the language file, you'd need something like

Code: Select all

const CONTACT_US_TITLE = 'Contact Us | ';
or skip the hook and just put something like

Code: Select all

Guarantor::ensure_global('Template')->set_title('Contact Us | ' . $GLOBALS['Template']->get_title());
in the language file. I think that either way should work.

Re: Meta title contactus & advanced search

Posted: Sat Oct 11, 2025 12:31 pm
by BatteryTrader
Thank you, works fine, easy when you know how.

Regards

David.

Re: Meta title contactus & advanced search

Posted: Sat Oct 11, 2025 1:45 pm
by burt
I have not tried recently, but you should be able to just add (to the contact_us language file)

const META_SEO_TITLE = 'Contact Us';
const META_SEO_DESCRIPTION = 'An easy for to allow you to contact us';

And similar to the advanced_search langue file

const META_SEO_TITLE = 'Search Our Site';
const META_SEO_DESCRIPTION = 'Blah blah blah';

Re: Meta title contactus & advanced search

Posted: Sat Oct 11, 2025 1:59 pm
by ecartz
I thought there was something more, but I apparently looked right past it.

That would also require includes/modules/header_tags/ht_pages_seo.php to be turned on.