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.
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?
Offline
You will need to edit your CCP_Prod.php in private_dir/khxc/apps/{app}/CCP_Prod and in the function prodshow look for:
// +-- // | 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
$this->globals('khxc_display.metadesc',$product['descshort']);
change it to
$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
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???
Offline
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.
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:
// +-- // | 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
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
Offline
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
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
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
Offline
$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
Offline
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..
Offline
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