修改ecshop商品页面自动截取详细内容作为description

2016-07-07 15:13 来源:www.chinab4c.com 作者:ecshop专家

修改goods.php,其他的不需要修改。



$tmpdesc = strip_tags($goods['goods_desc']);

$tmpdesc = str_replace("\n","",$tmpdesc);

/* meta */

$smarty->assign('keywords', htmlspecialchars($goods['keywords']));

if(empty($goods['goods_brief'])){

$smarty->assign('description', htmlspecialchars($goods['goods_name']).';'.$tmpdesc);

}else{

$smarty->assign('description', htmlspecialchars($goods['goods_brief']));

}