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.

#1 12-04-2007 20:03:29

Perkster
Member
From: Parksville BC Canada
Registered: 10-05-2004
Posts: 349
Website

Meta Tags. Description

On the Detail page of my site for viewing products I would like the LONGDESCRIPTION placed in the meat tag field"description" rather than the current short description.  How does one do this?


Mike Perks
Linux CD Shop - /shop for Linux distributions

ReviewLinux.Com - Linux OS News & Review Site

Offline

 

#2 12-04-2007 20:34:22

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

Re: Meta Tags. Description

You will need to edit your CCP_Prod.php in private_dir/khxc/apps/{app}/CCP_Prod and in the function prodshow look for:

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.
// +--

then a down a few lines you should find

Code:

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

change it to

Code:

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

but you may have to do some more coding if you have html code in you description to remove it.

John

Offline

 

#3 12-04-2007 21:36:22

Perkster
Member
From: Parksville BC Canada
Registered: 10-05-2004
Posts: 349
Website

Re: Meta Tags. Description

Thanks.. Your code worked fine..  I normally do not have html in description.  One thing it would be nice to limit the amount of words rather than whole description of product.  I have very different needs than the avergae cart.  I would like to have a different description for each category rather than it just taking the one off the site for the meta tags.  How would I go about that one???


Mike Perks
Linux CD Shop - /shop for Linux distributions

ReviewLinux.Com - Linux OS News & Review Site

Offline

 

#4 12-04-2007 22:00:58

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

Re: Meta Tags. Description

Create a new column in the category database (and or product database) and name it like medtadescription (or what ever you like) and make it a VARCHAR with a limite of 255 (if this is not a enough you can change it from a text-box to a text-area in the khxc_columndefs database). Then set the call for the new column you created in the database in the code above (There is also the same type of call in the CCP_Cat.php for categories in the function catshow). This will let you have a different meta description for each categori or product if you do it that way as well as having different short and long description. I did this with an add meta title call, my product code looks like:

You will need to edit your CCP_Prod.php in private_dir/khxc/apps/{app}/CCP_Prod and in the function prodshow.

Code:

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->globals('khxc.ref_disp',$product['name']);

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

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.

this gives me a different metatitle and metadiscription if I have something in the database and the default if I don't. My category code looks like:

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.

} // End of if statement.

John

Last edited by dh783 (05-28-2008 08:16:54)

Offline

 

#5 12-04-2007 22:39:47

Perkster
Member
From: Parksville BC Canada
Registered: 10-05-2004
Posts: 349
Website

Re: Meta Tags. Description

Thanks for this.  I tried it out in one category.  I did the edit in CCP_Cat.php and basically just changed the:

$this->globals('khxc_display.metadesc',$result[0]['description']);

to

$this->globals('khxc_display.metadesc',$result[0]['metacatdescript']);

I used my phpmyadmin and inserted a new line in the ccpo_cat table as per your instructions.

Maybe I missed something but now when I go to the:

Location: Home > ClickCartPro > Catalog: Categories, Products and Options

I see in the heading where the words: clone update delete so then this appears ccp0_cat.metacatdescript

What do I have to do in DB to make this go away..  Thanks again


Mike Perks
Linux CD Shop - /shop for Linux distributions

ReviewLinux.Com - Linux OS News & Review Site

Offline

 

#6 12-04-2007 23:01:36

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

Re: Meta Tags. Description

Did you add a row (which would be a new category) or add a new column (new data field) which would mean in ccp6 you would click on maintain for the database to create the new column, sorry I can't get to my php admin right now but you should have the same type of selection in there to add a new column the the database in question.

John

Offline

 

#7 12-04-2007 23:08:19

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

Re: Meta Tags. Description

I just seen what you are talking about, you need to go to the backend admin screen at Home > Kryptronic Hybrid X Core > Database: Connections, Backups and Raw Admin > Raw Database Admin where you would see selections for the database which would include Browse Maintian etc... click on Maintian for ccp0_cat and then select Add Column: Add a new column to this data table then give it a name like metadescription and fill out the rest of the fields.

John

Offline

 

#8 12-04-2007 23:22:24

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

Re: Meta Tags. Description

In phpmyadmin it would be the Add [input box] field(s)At End of Table At Beginning of Table []After under neith the database column section.

John

Offline

 

#9 12-05-2007 00:22:28

Perkster
Member
From: Parksville BC Canada
Registered: 10-05-2004
Posts: 349
Website

Re: Meta Tags. Description

Hey thanks.  Once you told me how to get to Raw DB ( I have not used that at all yet ) I then saw how to remove the new column that I made from main category display.  So all I did was create it in PHPmyAdmin and then used the bult-in stuff from ccp60 to fine tune it.  I now have unique meta descriptions for my categories..

Thanks


Mike Perks
Linux CD Shop - /shop for Linux distributions

ReviewLinux.Com - Linux OS News & Review Site

Offline

 

#10 03-15-2008 11:56:06

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

Re: Meta Tags. Description

Code:

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

but you may have to do some more coding if you have html code in you description to remove it.

Can you expand on that code for us that might have html code in our descriptions?

Thanks!




dh783 wrote:

You will need to edit your CCP_Prod.php in private_dir/khxc/apps/{app}/CCP_Prod and in the function prodshow look for:

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.
// +--

then a down a few lines you should find

Code:

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

change it to

Code:

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

but you may have to do some more coding if you have html code in you description to remove it.

John


CCP 5.1
CCP 5.1
CCP 5.1

Offline

 

#11 03-15-2008 12:29:48

Perkster
Member
From: Parksville BC Canada
Registered: 10-05-2004
Posts: 349
Website

Re: Meta Tags. Description

I only use this for my category meta description that I manually enter in the new field in category config.  I do not eneter any html as it is plain text..  Look at my source for each category and you will see what I mean..  The field is designed for only plain text entries so it should never have any html as not ever displayed anywhere else but in meta tag for description in a category..


Mike Perks
Linux CD Shop - /shop for Linux distributions

ReviewLinux.Com - Linux OS News & Review Site

Offline

 

#12 11-20-2009 08:18:48

anniea
Member
From: Warwickshire
Registered: 05-27-2009
Posts: 27

Re: Meta Tags. Description

I am trying to do something similar to the above, only I am trying to alter the metatitle so it is more SEO friendly.

Do I follow the above route?

Offline

 

Board footer