Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

Php Code tag for short description.

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 06-07-2006, 05:45 AM
 
brgreene brgreene is offline
 

Advanced Member
  
Join Date: Oct 2002
Posts: 70
 

Default Php Code tag for short description.

On my site, www.heartlandbraidedrugs.com the Short Description of a product is not visible. I use only the long description for instructions on ordering rugs. The way the x-cart uses the Long Description for the Meta Description cause me problems with search engines.

I have found this code from the product.php.

Code:
$main = "product"; $smarty->assign("main",$main); if (!empty($product_info["productid"])) { $product_info["meta_descr"] = strip_tags($product_info["descr"]); $product_info["meta_keywords"] = strip_tags($product_info["product"])." ".preg_replace("/[^a-zA-Z0-9]/", " ", strip_tags($product_info["descr"])); }

It appears $product_info["meta_descr"] = strip_tags($product_info["descr"]); controls the description. Does anyone know what I would use in ($product_info["HERE"]) to use the short description?

Any help would be greatly appreciated.
__________________
Brian
X-Cart 4.0.18
Reply With Quote
  #2  
Old 06-07-2006, 08:07 AM
  Jon's Avatar 
Jon Jon is offline
 

X-Guru
  
Join Date: Oct 2002
Location: Vancouver, Canada
Posts: 4,200
 

Default

You should put your version in your signature.

I believe this is short description:
$product_info["descr"]);

This is long description:
$product_info["fulldescr"]);
Reply With Quote
  #3  
Old 06-07-2006, 11:10 AM
 
brgreene brgreene is offline
 

Advanced Member
  
Join Date: Oct 2002
Posts: 70
 

Default

Here is my Meta.tpl. It is doing what I want but it is also including the Meta Description from the SEO Area. Any way to make the Products only have the short description as the Meta Description. I am using version 4.0.18.

Code:
{* $Id: meta.tpl,v 1.18.2.4 2004/12/23 12:50:34 svowl Exp $ *} <META http-equiv="Content-Type" content="text/html; charset={$default_charset|default:"iso-8859-1"}"> {if $usertype eq "P" or $usertype eq "A"} <META name="ROBOTS" content="NOINDEX"> <META name="ROBOTS" content="NOFOLLOW"> {else} {assign var="_meta_descr" value=""} {assign var="_meta_keywords" value=""} {if $product.meta_descr ne "" and $config.SEO.include_meta_products eq "Y"} {assign var="_meta_descr" value="`$product.meta_descr` "} {assign var="_meta_keywords" value="`$product.meta_keywords` "} {/if} {if $current_category.meta_descr ne "" and $config.SEO.include_meta_categories eq "Y"} {assign var="_meta_descr" value="$_meta_descr`$current_category.meta_descr` "} {assign var="_meta_keywords" value="$_meta_keywords`$current_category.meta_keywords` "} {/if} {assign var="_meta_descr" value="$_meta_descr`$config.SEO.meta_descr`"} {assign var="_meta_keywords" value="$_meta_keywords`$config.SEO.meta_keywords`"} <META name="description" content="{$_meta_descr|truncate:"500":"...":false|replace:'"':"'"}"> <META name="keywords" content="{$_meta_keywords|truncate:"500":"":false|replace:'"':"'"}"> {/if} {if $webmaster_mode eq "editor"} {if ($usertype eq "P" or $usertype eq "A") and $current_language ne ""} <SCRIPT type="text/javascript" language="JavaScript 1.2">var store_language = "{$current_language}"</SCRIPT> {else} <SCRIPT type="text/javascript" language="JavaScript 1.2">var store_language = "{$store_language}"</SCRIPT> {/if} <SCRIPT type="text/javascript" language="JavaScript 1.2"> var catalogs = new Object(); catalogs.admin = "{$catalogs.admin}"; catalogs.provider = "{$catalogs.provider}"; catalogs.customer = "{$catalogs.customer}"; catalogs.partner = "{$catalogs.partner}"; catalogs.images = "{$ImagesDir}"; catalogs.skin = "{$SkinDir}"; var lng_labels = new Array(); {foreach key=lbl_name item=lbl_val from=$webmaster_lng} lng_labels['{$lbl_name}'] = '{$lbl_val}'; {/foreach} var page_charset = "{$default_charset|default:"iso-8859-1"}"; </SCRIPT> {if $user_agent eq "ns"} <SCRIPT type="text/javascript" language="JavaScript 1.2" src="{$SkinDir}/editorns.js"></SCRIPT> {else} <SCRIPT type="text/javascript" language="JavaScript 1.2" src="{$SkinDir}/editor.js"></SCRIPT> {/if} {/if}
__________________
Brian
X-Cart 4.0.18
Reply With Quote
  #4  
Old 06-07-2006, 11:31 AM
 
brgreene brgreene is offline
 

Advanced Member
  
Join Date: Oct 2002
Posts: 70
 

Default Working...on it

If I comment out the following line.
Code:
{assign var="_meta_descr" value="$_meta_descr`$config.SEO.meta_descr`"}

I get the short description text and the category meta description text on my products but none of my other pages have a meta description.

I would like to have the

1. SEO Meta Description on my information pages.

2. Category Meta Description on Categorie Pages

3. Product Short Description on just Product Pages.

I hope this explains more what I am trying to do.
__________________
Brian
X-Cart 4.0.18
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 06:56 AM.

   

 
X-Cart forums © 2001-2020