Post by los20 » Tue Oct 18, 2011 9:59 pm

Thank you so much for the code
I too like it simple and clear, I was a litle frustrated by the fact that my page titles where the cat or product names, and since I cant have massive names for these I was really sratching around
...but now im so happy !!!
Thanks again
:)

Opencart age = 5 months (standing up now and falling down occasionally)
Activly telling everyone about OC = 4.5 months

V 1.5.1


Newbie

Posts

Joined
Sat Sep 17, 2011 10:04 pm


Post by xlam » Thu Jan 05, 2012 1:16 am

JAY6390 wrote:Open

Code: Select all

/catalog/controller/product/product.php
find

Code: Select all

$this->document->title = $product_info['name']; 
change to

Code: Select all

$this->document->title = $product_info['name'] . ' - ' . $product_info['manufacturer']; 
(assuming you have made Q's change in the second post)
works great for me using 1.1.5.3 :) :)

Baju Muslim Baju Pria Baju Anak Baju Korea Sparepart Printer Baju Muslim JNE Surabaya


New member

Posts

Joined
Sun Dec 25, 2011 2:58 pm

Post by mogwaycz » Thu Jan 26, 2012 11:09 am

For OC 1.5.1.3:

in catalog/controller/product/product.php find:

Code: Select all

$this->document->setTitle($product_info['name']);
and replace:

Code: Select all

if (isset($product_info['manufacturer'])) {
          $this->document->setTitle('YOURDOMAIN.XYZ - '. $product_info['name'] . ' od ' . $product_info['manufacturer']);
			}
			else
			{
          $this->document->setTitle('YOURDOMAIN.XYZ - '. $product_info['name']);
      }
in catalog/controller/product/category.php find:

Code: Select all

$this->document->setTitle($category_info['name']);
and replace:

Code: Select all

$this->document->setTitle('YOURDOMAIN.XYZ - ' . $category_info['name']);
That's all...

;)
Last edited by mogwaycz on Thu Jan 26, 2012 3:44 pm, edited 2 times in total.

this


Newbie

Posts

Joined
Fri Mar 18, 2011 6:09 pm

Post by Lisaweb » Thu Jan 26, 2012 11:31 am

Thanks, this really helps me! But I couldn't find the code in the category.php you mention - did you perhaps mean catalog\controller\product\category.php?

Using OC v1.5.4.1 with Evisu Theme


User avatar
Active Member

Posts

Joined
Wed Dec 07, 2011 12:01 am

Post by Lisaweb » Thu Jan 26, 2012 11:38 am

@mogwaycz: Weird too, I did the changes you posted, but no change in the page title. I even deleted the cache. Odd. Anyone have ideas?

Using OC v1.5.4.1 with Evisu Theme


User avatar
Active Member

Posts

Joined
Wed Dec 07, 2011 12:01 am

Post by mogwaycz » Thu Jan 26, 2012 3:47 pm

Ailu wrote:Thanks, this really helps me! But I couldn't find the code in the category.php you mention - did you perhaps mean catalog\controller\product\category.php?
Ups, my bad... You're absolutely right. It shoud be a catalog/controller/product/category.php(previous post fixed)
Ailu wrote:@mogwaycz: Weird too, I did the changes you posted, but no change in the page title. I even deleted the cache. Odd. Anyone have ideas?
This modification is only for OC v1.5.1.3. All other modifications in previous posts didn't work for me.

this


Newbie

Posts

Joined
Fri Mar 18, 2011 6:09 pm

Post by Lisaweb » Thu Jan 26, 2012 10:07 pm

I found out why the changes didn't show - I needed to delete my vqmod cache as well. All good now.

Thanks for you very useful post! :-)

Using OC v1.5.4.1 with Evisu Theme


User avatar
Active Member

Posts

Joined
Wed Dec 07, 2011 12:01 am

Post by mogwaycz » Fri Jan 27, 2012 1:37 am

:good: no worries mate!

this


Newbie

Posts

Joined
Fri Mar 18, 2011 6:09 pm

Post by qahar » Fri Jan 27, 2012 5:45 pm

I have another version, incase someone interesting.

Open header.tpl and change the title tag with code bellow:

Code: Select all

<title><?php echo $title; ?><?php if(!isset($this->request->get['route']) || $this->request->get['route'] == 'common/home') { echo " - " . $this->config->get('config_title'); } ?></title>
With code above you will get Site Title on Homepage; but get Page Title - Site Title on all pages, not just product page.

User avatar
Expert Member

Posts

Joined
Tue Jun 29, 2010 10:24 pm
Location - Indonesia

Post by david007 » Mon Feb 13, 2012 4:10 am

You guys rock Thanks helped me a lot!

New member

Posts

Joined
Tue Jan 10, 2012 10:33 pm

Post by JackDavis » Tue Feb 21, 2012 12:54 am

I've written a blog post on creating SEO friendly page titles for category and product pages which you guys might find useful? The link is:

http://www.jackwdavis.com/2012/02/17/cr ... ory-pages/

It will show you how to do what your asking for!

Cheers,

Jack

Destrove is a professional Web Development, SEO, Marketing and eCommerce company based in Lincoln, UK that specialises in OpenCart Development.
http://www.destrove.com
We now offer a specialised OpenCart Web Hosting Service at great rates, hosting clients get discounted OpenCart Development! http://www.destrove.com/services/opencart-web-hosting


New member

Posts

Joined
Sun Jan 15, 2012 1:29 am
Location - Lincoln, UK

Post by Lisaweb » Tue Feb 21, 2012 10:16 pm

Thanks Jack! :-)
JackDavis wrote:I've written a blog post on creating SEO friendly page titles for category and product pages which you guys might find useful? The link is:

http://www.jackwdavis.com/2012/02/17/cr ... ory-pages/

It will show you how to do what your asking for!

Cheers,

Jack

Using OC v1.5.4.1 with Evisu Theme


User avatar
Active Member

Posts

Joined
Wed Dec 07, 2011 12:01 am

Post by prosport-rs » Thu Feb 23, 2012 7:18 am

How to change this parameter

Code: Select all

$title
on instalation of site i type wrong site name so now i cnt find how to chante title pls any help

Newbie

Posts

Joined
Thu Feb 23, 2012 7:16 am

Post by josee225 » Mon Mar 12, 2012 10:54 am

Hi,

I think I need a little help here too :)

In catalog/language/english/product/product.php, and in my second language (french), I added this line:

Code: Select all

$_['seo-title']		= 'CCG, Minis, Games, Supplies | Carta Magica Store'
I then proceeded to catalog/controller/product/product.php and changed this line

Code: Select all

$this->document->setTitle($product_info['name']);
to this line

Code: Select all

$this->document->setTitle($product_info['name'].' | '. $seo-title);
And nothing happened... Now I definitely am not a PHP programmer, so I think I have something wrong in my syntax... If someone could correct me on this, I would be very grateful!

New member

Posts

Joined
Tue Dec 27, 2011 10:42 pm

Post by qahar » Mon Mar 12, 2012 11:12 am

josee225 wrote: In catalog/language/english/product/product.php, and in my second language (french), I added this line:

Code: Select all

$_['seo-title']		= 'CCG, Minis, Games, Supplies | Carta Magica Store'

Code: Select all

$this->document->setTitle($product_info['name'].' | '. $seo-title);
Try this:

Code: Select all

$this->document->setTitle($product_info['name'] . ' | ' . $this->language->get('seo-title'));

User avatar
Expert Member

Posts

Joined
Tue Jun 29, 2010 10:24 pm
Location - Indonesia

Post by inspirio » Mon Mar 12, 2012 3:21 pm

Thank you. Work great on 1.5.1.3. :)

Image


User avatar
New member

Posts

Joined
Fri Feb 17, 2012 9:11 pm

Post by josee225 » Mon Mar 12, 2012 6:40 pm

qahar wrote:
josee225 wrote: In catalog/language/english/product/product.php, and in my second language (french), I added this line:

Code: Select all

$_['seo-title']		= 'CCG, Minis, Games, Supplies | Carta Magica Store'

Code: Select all

$this->document->setTitle($product_info['name'].' | '. $seo-title);
Try this:

Code: Select all

$this->document->setTitle($product_info['name'] . ' | ' . $this->language->get('seo-title'));
I must be really dense.... I did what you said, changed the controller, even noticed I was missing the ; at the end of my new line in language file, fixed it, cleared my vqmod cache, and still nothing changes...

So since I would like this same seo-title all over, I added the $seo-title in my header language files, and then went into my header controller, added:

Code: Select all

$this->language->get('seo-title');
just under

Code: Select all

$this->data['title'] = $this->document->getTitle();
Then I went into my header.tpl and changed

Code: Select all

<title><?php echo $title; ?></title>
to

Code: Select all

<title><?php echo $title; ?> | <?php echo $seo-title></title>
And still nothing... I don't even have an error about this in my log, nothing! :(

New member

Posts

Joined
Tue Dec 27, 2011 10:42 pm

Post by jadeye » Sun Jul 15, 2012 6:18 am

Hey guys...

I am trying different versions of the breadcrumbs but I keep on getting the route URL instead...
Mind you I am using n RTL version of OC 1.5.0
Maybe someone has ran into this issue....??? :)
Thank you...

Imagehttp://nwg.co.il/
“Compassion is the basis of morality.”
― Arthur Schopenhauer


New member

Posts

Joined
Sun Jul 15, 2012 12:35 am

Post by logicPwn » Thu Aug 02, 2012 3:10 am

I am trying to do this but I have also done the mod to make all URLs SEO friendly. I no longer have the router GET var available to check. Does OC set/save the page parsed somewhere? Otherwise I will need to do this myself. You think OC would save the route instead of checking the GET var every time.

"Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live."
- Martin Golding


Newbie

Posts

Joined
Fri Jul 06, 2012 6:11 am
Location - Fresno, CA

Post by witalous » Tue Jan 01, 2013 8:34 am

Thank you guys!

Served me so much!

Hug!

www.metaospano.com


Newbie

Posts

Joined
Thu Sep 27, 2012 4:39 am

Who is online

Users browsing this forum: No registered users and 30 guests