Page 2 of 2
Re: how to add custom TITLE to every product pages ?
Posted: Thu Feb 16, 2012 1:37 am
by mau7038
zuhenry wrote:It is easy. Qphoria explained in a very easy way but it could be complicated if you are not good with mathematics or associations.
Qphoria says: "the 'variable' (location) is rarely used by any OC administrator"
Translation: Under the admin panel, use location to set the page title. Pretend 'location' means 'title'
Qphoria says: "globally change all controllers to... "
Translation: Add that variable - location -, to the title controller.
Before: $this->document->title = $product_info['name'];
After: $this->document->title = ($product_info['name'] . ' :: ' . $product_info['location']) ;
Thanks Qphoria !!
I follow you up until "Translation: Add that variable - location -, to the title controller." Where is this code located, which file? I'm at catalog/controller, I assume it would be in the product.php page? However, on my product.php page, I only have the following similar code:
Code: Select all
$this->document->setTitle($product_info['name']);
I am using a non-default theme, although I didn't think that would affect the controllers. Should I change this code, or am I looking in the wrong place?
Re: how to add custom TITLE to every product pages ?
Posted: Fri Feb 17, 2012 12:15 am
by mau7038
Anyone? Thanks!
Re: how to add custom TITLE to every product pages ?
Posted: Mon Feb 20, 2012 7:45 pm
by ianh
I'm having the same problem - I don't know specifically what to change and where it is.

Re: how to add custom TITLE to every product pages ?
Posted: Fri Feb 24, 2012 4:24 am
by ianh
All the answers are here
http://forum.opencart.com/viewtopic.php?f=21&t=53895
Big thanks to Jack Wilson.
Re: how to add custom TITLE to every product pages ?
Posted: Sun Feb 26, 2012 10:17 pm
by leedodson
Hi, I really would like to do this but still a bit bewildered! Globally change all controllers? Where do I find that? and is it just one change to do?
Cheers.
Re: how to add custom TITLE to every product pages ?
Posted: Thu Mar 01, 2012 12:34 am
by ianh
Lee, check my post above yours....it's real simple and brilliantly effective.

Re: how to add custom TITLE to every product pages ?
Posted: Wed Jan 02, 2013 10:00 pm
by shukshyna
I registered for this forum to say Thank you guys!!!!
You have just made one 0-php-knowledge girl happy

))
I changed it for my manufacturers to
$this->document->title = ($manufacturer_info['name'] . ' - ' . $w_manufacturerDescription['meta_keywords']) ;
where I will use a keywords field to make a different title for each language on a manufacturer page (earlier I have had titles on these pages duplicated)
All the best!
Re: how to add custom TITLE to every product pages ?
Posted: Tue Aug 20, 2013 8:03 pm
by webcreativity
Thank you so much ! I implemented this on my website using simple vqmod.
I could attach it if someone is interested.
QUESTION is:
How can we do the same for categories ?
I urgently need it done for categories, but I can't think where to and how to import the data.
For products was easy with location.
Any ideas ?
Thank you !