Kryptronic Software Support Forum

You are viewing this forum as a guest. Login to an existing account, or create a new account, to reply to topics and to create new topics.

  • Index
  •  » ClickCartPro 6
  •  » Product Titles (metatitle) - how can we add extra words to this...

#1 09-05-2007 10:36:37

antsevo
Member
From: Surrey, UK
Registered: 02-08-2005
Posts: 592
Website

Product Titles (metatitle) - how can we add extra words to this...

In the product detail display, the title of the product appears as the browser metatitle

For example a product is called "widget" and so the page metatitle is "widget"

But suppose I want the page metatitle to display "widget - buy now at widget warehouse"

I know i can alter the $metatile for the skin and add the necessary words, but that would alter all pages globally, I would not want this for certain pages.

I believe that this should be a good way to display extra information for search engines to pick up on, on very competitive keywords

Any ideas?

Last edited by antsevo (09-05-2007 10:38:22)


Anthony - Personalised and Celebrity Face Masks
Anthony - Adult Toys

Offline

 

#2 09-05-2007 17:16:21

fazman
Member
From: Aus
Registered: 03-19-2006
Posts: 196
Website

Re: Product Titles (metatitle) - how can we add extra words to this...

I ended up putting the keywords that I wanted into each products title. That way they did show in the title tag


has arrived. Flight your way to heavenly pleasures.

Offline

 

#3 09-06-2007 03:22:24

ZipSkins
Member
From: United Kingdom
Registered: 01-15-2006
Posts: 822
Website

Re: Product Titles (metatitle) - how can we add extra words to this...

It would be good to be able to specify different titles if we wanted though. ATS SEO Pro mod has this option

Last edited by ZipSkins (09-06-2007 03:22:34)


| Professional Quality Customisable Skins for your ClickCartPro Powered Site


-----------------------------
Certified Support Partner

Offline

 

#4 09-06-2007 04:43:20

antsevo
Member
From: Surrey, UK
Registered: 02-08-2005
Posts: 592
Website

Re: Product Titles (metatitle) - how can we add extra words to this...

All I really need to know is where in the program it pull the details for the products to display as a title, then at least I should be able to add the words I want to to the end of the product title.

Also I should be able to do the same with the category products.


Anthony - Personalised and Celebrity Face Masks
Anthony - Adult Toys

Offline

 

#5 09-06-2007 07:15:29

Bella Bathrooms
Member
Registered: 08-14-2007
Posts: 22
Website

Re: Product Titles (metatitle) - how can we add extra words to this...

This is a vital and important part for seo, does anyone know?

Thanks

Last edited by Bella Bathrooms (09-06-2007 07:23:03)

Offline

 

#6 09-06-2007 07:39:54

antsevo
Member
From: Surrey, UK
Registered: 02-08-2005
Posts: 592
Website

Re: Product Titles (metatitle) - how can we add extra words to this...

I believe that the file that needs altering is the GBU_Prod.php

from line 1604 is this:

// +--
// | Print breadcrumbs.  We use a '0' param here so we don't
// | kill any breadcrumbs we have already. 
// |
// | Also modify our meta info.
// |
// | We only do this stuff if we're on the prodshow namespace.
// +--

if ($ns == 'prodshow') {

     $this->breadcrumbs($product['name'],0);

     $this->globals('khxc_display.metatitle',$product['name']);
     $this->globals('khxc.ref_disp',$product['name']);

     $this->globals('khxc_display.metakeywords',$product['keywords']);
     $this->globals('khxc_display.metadesc',$product['descshort']);

} // End of if statement.


And it appears that this is the line that needs changing:
$this->globals('khxc_display.metatitle',$product['name']);

If I change it to $this->globals('khxc_display.metatitle',TEST);

Then my products show a metatitle of TEST

No all I need to know is how to add TEST along with $product['name']

something like

$this->globals('khxc_display.metatitle',$product['name'] 'TEST');


Anthony - Personalised and Celebrity Face Masks
Anthony - Adult Toys

Offline

 

#7 09-06-2007 07:48:33

antsevo
Member
From: Surrey, UK
Registered: 02-08-2005
Posts: 592
Website

Re: Product Titles (metatitle) - how can we add extra words to this...

Ok I have managed to get it to work for individual products with this:

$this->globals('khxc_display.metatitle',$product['name'] .' - Sex Toys from forafters.co.uk');

This add what I want after each product name.

Can anyone confirm whether this will have any detromental effect anywhere else?


Anthony - Personalised and Celebrity Face Masks
Anthony - Adult Toys

Offline

 

#8 09-06-2007 08:47:44

ZipSkins
Member
From: United Kingdom
Registered: 01-15-2006
Posts: 822
Website

Re: Product Titles (metatitle) - how can we add extra words to this...

Thats ok if you want the same end of meta title on every page/product, but if you want each product or categoyr or html page to have it's own meta title there is no way to do that with the current version. I'd welcome this as a feature or module.


| Professional Quality Customisable Skins for your ClickCartPro Powered Site


-----------------------------
Certified Support Partner

Offline

 

#9 09-07-2007 10:09:57

antsevo
Member
From: Surrey, UK
Registered: 02-08-2005
Posts: 592
Website

Re: Product Titles (metatitle) - how can we add extra words to this...

ZipSkins wrote:

Thats ok if you want the same end of meta title on every page/product, but if you want each product or categoyr or html page to have it's own meta title there is no way to do that with the current version. I'd welcome this as a feature or module.

Then surely all you'd have to do is add an extra field to the product/category datatbase, and use the new field as the metatitle display.

But if you have a lot of products, this may be a lot of work.

Or add another field and reference that as well as the $product['name'] for the metatitle, to add extra words.

But for what I originally asked, has now been done to what I wanted.


Anthony - Personalised and Celebrity Face Masks
Anthony - Adult Toys

Offline

 

#10 03-15-2008 12:40:25

theblade24
Member
From: Tampa, Florida
Registered: 11-19-2003
Posts: 384
Website

Re: Product Titles (metatitle) - how can we add extra words to this...

By adding ' - Sex Toys from forafters.co.uk' it waters down the title tag.

Each word that is added dilutes the value of all the words in the title tag as far as their ultimate keyword value.


CCP 5.1
CCP 5.1
CCP 5.1

Offline

 

#11 03-15-2008 17:39:54

dh783
Member
From: Avondale, Arizona
Registered: 04-06-2005
Posts: 6233
Website

Re: Product Titles (metatitle) - how can we add extra words to this...

What I did was create a new column to my product database (ccp0_prod) with the name "metatitle" in which I place the text I want to be displayed. Then in my private_dir/KHXC/apps/{app}/CCP_Prod/CCP_Prod.php in function prodsow I change the code where the metatitle is created to:

Code:

// +--
// | Print breadcrumbs.  We use a '0' param here so we don't
// | kill any breadcrumbs we have already.
// |
// | Also modify our meta info.
// |
// | We only do this stuff if we're on the prodshow namespace.
// +--

if ($ns == 'prodshow') {

     $this->breadcrumbs($product['name'],0);

  if (!(empty($product['metatitle']))) {

     $this->globals('khxc_display.metatitle',$product['metatitle']);

  } else {

     $this->globals('khxc_display.metatitle',$product['name']);

  } // end of if statement.

this way if the new field is empty it just displays the product name field and if there is something in the new field it will display that.

John

Offline

 

#12 10-24-2008 04:05:31

west4
Member
From: UK
Registered: 04-16-2008
Posts: 645
Website

Re: Product Titles (metatitle) - how can we add extra words to this...

Hi all,

I created a new column in my product database (gbu0_prod) called metatitle and it shows in my product backend in General Information just under the Product Name, all is well, but the bit of code to show it is not working.
The example is:

Code:

// +--
// | Print breadcrumbs.  We use a '0' param here so we don't
// | kill any breadcrumbs we have already.
// |
// | Also modify our meta info.
// |
// | We only do this stuff if we're on the prodshow namespace.
// +--

if ($ns == 'prodshow') {

     $this->breadcrumbs($product['name'],0);

  if (!(empty($product['metatitle']))) {

     $this->globals('khxc_display.metatitle',$product['metatitle']);

  } else {

     $this->globals('khxc_display.metatitle',$product['name']);

  } // end of if statement.

but my original code is:

Code:

// +--
// | Print breadcrumbs.  We use a '0' param here so we don't
// | kill any breadcrumbs we have already.  
// |
// | Also modify our meta info.
// | 
// | We only do this stuff if we're on the prodshow namespace.
// +--

if ($ns == 'prodshow') {

     $this->breadcrumbs($product['name'],0);

     $this->globals('khxc_display.metatitle',$product['name']);
     $this->globals('khxc.ref_disp',$product['name']);

     $this->globals('khxc_display.metakeywords',$product['keywords']);
     $this->globals('khxc_display.metadesc',$product['descshort']);

} // End of if statement.

so I tried this:

Code:

// +--
// | Print breadcrumbs.  We use a '0' param here so we don't
// | kill any breadcrumbs we have already.  
// |
// | Also modify our meta info.
// | 
// | We only do this stuff if we're on the prodshow namespace.
// +--

if ($ns == 'prodshow') {

     $this->breadcrumbs($product['name'],0);

  if (!(empty($product['metatitle']))) {

     $this->globals('khxc_display.metatitle',$product['metatitle']);
     $this->globals('khxc.ref_disp',$product['metatitle']);

     $this->globals('khxc_display.metakeywords',$product['keywords']);
     $this->globals('khxc_display.metadesc',$product['descshort']);

  } else {

     $this->globals('khxc_display.metatitle',$product['name']);
     $this->globals('khxc.ref_disp',$product['name']);

     $this->globals('khxc_display.metakeywords',$product['keywords']);
     $this->globals('khxc_display.metadesc',$product['descshort']);

} // End of if statement.

but it does not work, can anyone see what is wrong with the code?

Cheers,
Bruce.


I'd rather have a full bottle in front of me, than a full frontal labotomy.

Offline

 

#13 10-24-2008 08:28:04

dh783
Member
From: Avondale, Arizona
Registered: 04-06-2005
Posts: 6233
Website

Re: Product Titles (metatitle) - how can we add extra words to this...

Your first example is missing a }, you added another if statement with out closing the original (at least in what you posted):

Code:

// +--
// | Print breadcrumbs.  We use a '0' param here so we don't
// | kill any breadcrumbs we have already.
// |
// | Also modify our meta info.
// |
// | We only do this stuff if we're on the prodshow namespace.
// +--

if ($ns == 'prodshow') {

     $this->breadcrumbs($product['name'],0);

  if (!(empty($product['metatitle']))) {

     $this->globals('khxc_display.metatitle',$product['metatitle']);

  } else {

     $this->globals('khxc_display.metatitle',$product['name']);

  } // end of if statement.

}

John

Offline

 

#14 10-24-2008 09:53:48

west4
Member
From: UK
Registered: 04-16-2008
Posts: 645
Website

Re: Product Titles (metatitle) - how can we add extra words to this...

Hi,

Thanks John, added a } to close the end. It now doesn't hang CCP6, but with text in the new Metatitle product description box inside CCP6 the web site shows the default header like "Mozzila Firefox" or whatever instead of the metatitle, if you do not enter any text into the new metatitle box inside CCp6 then it shows the product name as it should, that bit works.
So it still doesn't workl, a quick look at the code generated with text in the metatitle box, shows that the Title tag generated is empty: see http://www.west4.info/Product/clearancemilanopen.html as an example of text in the metatitle box within CCP6, it should show "Clearance Milano Rollerball Pen from Westfield4Schools" as the title.

So any more help would be greatfully accepted.

Cheers,
Bruce.


I'd rather have a full bottle in front of me, than a full frontal labotomy.

Offline

 

#15 10-24-2008 10:17:42

dh783
Member
From: Avondale, Arizona
Registered: 04-06-2005
Posts: 6233
Website

Re: Product Titles (metatitle) - how can we add extra words to this...

I went back to look at my code on this and the if statement for the ns=prodshow should close right after  this:

Code:

     $this->globals('khxc_display.metadesc',$product['descshort']);

} // End of if statement.

// +--
// | Run our display include code.
// +--

here is the whole code on my site at the moment (it includes a insert for a meta description which I have also addd as well as my coments on the edits):

Code:

if ($ns == 'prodshow') {

     $this->breadcrumbs($product['name'],0);

// +---
// | SLP edit.
// +---

  if (!(empty($product['metatitle']))) {

     $this->globals('khxc_display.metatitle',$product['metatitle']);

  } else {

     $this->globals('khxc_display.metatitle',$product['name']);

  } // end of if statement.

// +---------------------

     $this->globals('khxc.ref_disp',$product['name']);

     $this->globals('khxc_display.metakeywords',$product['keywords']);

// +---
// | SLP edit.
// +---

  if (!(empty($product['metadescription']))) {

     $this->globals('khxc_display.metadesc',$product['metadescription']);

  } else {

     $this->globals('khxc_display.metadesc',$product['descshort']);

  } // end of if statement.

// +----------------------

} // End of if statement.

John

Last edited by dh783 (10-24-2008 10:22:36)

Offline

 

#16 10-24-2008 10:24:49

dh783
Member
From: Avondale, Arizona
Registered: 04-06-2005
Posts: 6233
Website

Re: Product Titles (metatitle) - how can we add extra words to this...

I just noticed that the last time that I added this to my code (after an update) I replaced the meta description I created for the keywords. I have fixed my code and updated the my last post here to reflect that change.

John

Last edited by dh783 (10-24-2008 10:25:37)

Offline

 

#17 10-24-2008 10:41:37

west4
Member
From: UK
Registered: 04-16-2008
Posts: 645
Website

Re: Product Titles (metatitle) - how can we add extra words to this...

Hi John,

Thanks for that, but metatitle is still not showing up after I made your changes.
This is the code: still not showing the title in browser.

Code:

// +--
// | Print breadcrumbs.  We use a '0' param here so we don't
// | kill any breadcrumbs we have already.  
// |
// | Also modify our meta info.
// | 
// | We only do this stuff if we're on the prodshow namespace.
// +--

if ($ns == 'prodshow') {

     $this->breadcrumbs($product['name'],0);

// +---
// | SLP edit.
// +---

  if (!(empty($product['metatitle']))) {

     $this->globals('khxc_display.metatitle',$product['metatitle']);
      $this->globals('khxc.ref_disp',$product['metatitle']);
      
  } else {

     $this->globals('khxc_display.metatitle',$product['name']);
     $this->globals('khxc.ref_disp',$product['name']);

  } // end of if statement.

// +---------------------

     $this->globals('khxc.ref_disp',$product['name']);

     $this->globals('khxc_display.metakeywords',$product['keywords']);

// +---
// | SLP edit.
// +---

  if (!(empty($product['metadescription']))) {

     $this->globals('khxc_display.metadesc',$product['metadescription']);

  } else {

     $this->globals('khxc_display.metadesc',$product['descshort']);

  } // end of if statement.

// +----------------------

} // End of if statement.

Cheers,
Bruce.


I'd rather have a full bottle in front of me, than a full frontal labotomy.

Offline

 

#18 10-24-2008 10:45:25

Dave
Member
Registered: 07-05-2003
Posts: 11233

Re: Product Titles (metatitle) - how can we add extra words to this...

Bruce, when posting code it helps a lot if you wrap it with [ code ] tags so it stands out and is easier to copy&paste if need be.  Take a peek at the  help for more details.

Offline

 

#19 10-24-2008 12:11:08

dh783
Member
From: Avondale, Arizona
Registered: 04-06-2005
Posts: 6233
Website

Re: Product Titles (metatitle) - how can we add extra words to this...

This doesn't effect your problem but you have to many occurrences of this code:

Code:

$this->globals('khxc.ref_disp',$product['metatitle']);

you need to either remove it form the if statements you created or remove the one after the meta description is created, it's just redundant code (example below). If you add a print statement to the code you should be able to see if it's getting inside the if statement you created which I think it is:

Code:

  if (!(empty($product['metatitle']))) {

print '1';

     $this->globals('khxc_display.metatitle',$product['metatitle']);
      $this->globals('khxc.ref_disp',$product['metatitle']); // either remove these from the if statement.
      
  } else {

     $this->globals('khxc_display.metatitle',$product['name']);
     $this->globals('khxc.ref_disp',$product['name']);

  } // end of if statement.

// +---------------------

     $this->globals('khxc.ref_disp',$product['name']); // or remove this one.

     $this->globals('khxc_display.metakeywords',$product['keywords']);

If the new product metatitle is not empty you should see a 1 printed to the display if not then it's not getting the product field you created. If it's not empty and it is acting on the code then something else is causing it not to display.

John

Offline

 

#20 10-27-2008 04:48:17

west4
Member
From: UK
Registered: 04-16-2008
Posts: 645
Website

Re: Product Titles (metatitle) - how can we add extra words to this...

Hi All,


Thanks for all your help it now works, had a bit of code in the skin.php which was cutting some of the product name off, to get rid of the product code from the top of the browser....


So to summerise, this bit of code allows you to have a meta title field in your product description in the CCP6 back end "Manage Online Store Products/General Information just below the "Display Name" field. You can add a metatitle which is different to the product name to appear at the top of your browser window allowing you to add a bit more information to the product eg. "Milano Pen" product name becomes "Milano Pen from Westfield4Schools" Metatitle. If you don't add additional information into the metatitle field in the back end then it displayes the product name as normal at the top of the browser.

Code:

// +--
// | Print breadcrumbs.  We use a '0' param here so we don't
// | kill any breadcrumbs we have already.  
// |
// | Also modify our meta info.
// | 
// | We only do this stuff if we're on the prodshow namespace.
// +--

if ($ns == 'prodshow') {

     $this->breadcrumbs($product['name'],0);

// +---
// | SLP edit.
// +---

  if (!(empty($product['metatitle']))) {

     $this->globals('khxc_display.metatitle',$product['metatitle']);
     $this->globals('khxc.ref_disp',$product['name']);

  } else {

     $this->globals('khxc_display.metatitle',$product['name']);
     $this->globals('khxc.ref_disp',$product['name']);

  } // end of if statement.

// +---------------------

     $this->globals('khxc_display.metakeywords',$product['keywords']);

// +---
// | SLP edit.
// +---

  if (!(empty($product['metadescription']))) {

     $this->globals('khxc_display.metadesc',$product['metadescription']);

  } else {

     $this->globals('khxc_display.metadesc',$product['descshort']);

  } // end of if statement.

// +----------------------

} // End of if statement.

Thanks for all your help boys.

ALSO

You can do the same with the Categories too, create a new column in Hybrid X Core :: Raw Database Admin :: gbu0_cat and call it metatitle with a Column Section Name of "Identifier and Name" and it will show up in the Category page at the top, now add a new metatitle to an existing caterory.

then change the code in GBU_Cat.php from

Code:

// +--
// | Set our display name and meta tags up if our 
// | namespace is 'catshow'.
// +--

if ($this->globals('khxc.namespace') == 'catshow') {

     $this->globals('khxc_display.metatitle',$result[0]['name']);
     $this->globals('khxc.ref_disp',$result[0]['name']);

     $this->globals('khxc_display.metakeywords',$result[0]['keywords']);
     if (!empty($result[0]['metadescription'])) {
         $this->globals('khxc_display.metadesc',$result[0]['metadescription']);
     } else {
         $this->globals('khxc_display.metadesc',$result[0]['description']);
     }

} // End of if statement.

to

Code:

// +--
// | Set our display name and meta tags up if our 
// | namespace is 'catshow'.
// +--

if ($this->globals('khxc.namespace') == 'catshow') {

     if (!(empty($result[0]['metatitle']))) {
     $this->globals('khxc_display.metatitle',$result[0]['metatitle']);
     $this->globals('khxc.ref_disp',$result[0]['name']);

     $this->globals('khxc_display.metakeywords',$result[0]['keywords']);
     if (!empty($result[0]['metadescription'])) {
         $this->globals('khxc_display.metadesc',$result[0]['metadescription']);
     } else {
         $this->globals('khxc_display.metadesc',$result[0]['description']);
     }}

} // End of if statement.

and once again it will show the new metatitle at the top of the browser.

Cheers,
Bruce.




For CCP VERSION 7.




1: I created a new column in "Location: System Dashboard > System > Database > Raw Database Admin - ecom-prod" called metatitle

2: Then in my private_dir/private/apps/gbu0/GBU_Prod/GBU_Prod.php in function prodshow (find the - print breadcrumbs bit) I change the code where the metatitle is created to:

Code:

// +--
// | Print breadcrumbs.  We use a '0' param here so we don't
// | kill any breadcrumbs we have already.  
// |
// | Also modify our meta info.
// | 
// | We only do this stuff if we're on the prodshow namespace.
// +--

if ($ns == 'prodshow') {

     $this->breadcrumbs($product['name'],0);

// +---
// | SLP edit.
// +---

  if (!(empty($product['metatitle']))) {

     $this->globals('khxc_display.metatitle',$product['metatitle']);
      $this->globals('khxc.ref_disp',$product['metatitle']);
      
  } else {

     $this->globals('khxc_display.metatitle',$product['name']);
     $this->globals('khxc.ref_disp',$product['name']);

  } // end of if statement.

// +---------------------

     $this->globals('khxc_display.metakeywords',$product['keywords']);

// +---
// | SLP edit.
// +---

  if (!(empty($product['metadescription']))) {

     $this->globals('khxc_display.metadesc',$product['metadescription']);

  } else {

     $this->globals('khxc_display.metadesc',$product['descshort']);

  } // end of if statement.

// +----------------------

} // End of if statement.

3: This worked for me, but ALWAYS MAKE BACKUPS OF ANY CODE YOU CHANGE.

4: Same as above for categories.

Cheers,
Bruce.

Last edited by west4 (09-21-2011 06:52:40)


I'd rather have a full bottle in front of me, than a full frontal labotomy.

Offline

 

#21 12-09-2008 08:12:43

Kitch
Member
From: Sunshine Coast, Australia
Registered: 05-01-2008
Posts: 20

Re: Product Titles (metatitle) - how can we add extra words to this...

Hi,

This all works very well apart from one thing.  As well as changing the title of the page, it also changes the product's name on the product detail page.

I would like the product name to remain as is and have ONLY the title of the page change.

Any ideas?

Thanks,

Ian.

Offline

 

#22 12-09-2008 08:20:03

Dave
Member
Registered: 07-05-2003
Posts: 11233

Re: Product Titles (metatitle) - how can we add extra words to this...

Don't add this line in the first modification shown above.

Code:

$this->globals('khxc.ref_disp',$product['metatitle']);

Offline

 

#23 12-09-2008 09:29:15

west4
Member
From: UK
Registered: 04-16-2008
Posts: 645
Website

Re: Product Titles (metatitle) - how can we add extra words to this...

Hi All,

Updated the code to reflect the fixes.

Cheers,
Bruce.


I'd rather have a full bottle in front of me, than a full frontal labotomy.

Offline

 

#24 12-10-2008 07:58:48

Kitch
Member
From: Sunshine Coast, Australia
Registered: 05-01-2008
Posts: 20

Re: Product Titles (metatitle) - how can we add extra words to this...

Hi Dave,

Thanks for that - it now works.  I just had to back in the line   

$this->globals('khxc.ref_disp',$product['name']);

so that the product name would show correctly.

Thanks everyone!

Ian.

Last edited by Kitch (12-10-2008 07:59:45)

Offline

 
  • Index
  •  » ClickCartPro 6
  •  » Product Titles (metatitle) - how can we add extra words to this...

Board footer