ECSHOP商品详情页”增加自定义TITLE

it2022-05-06  18

一、 修改数据库结构,其实就是增加个字段

进入 后台 》数据库管理 》SQL查询 , 在输入框里输入下面SQL语句,并点击“提交查询”

ALTER TABLE `ecs_goods` ADD `goods_title` VARCHAR( 150 ) NOT NULL DEFAULT '' AFTER `goods_name`

 

 

二、修改后台模板文件 /admin/templates/goods_info.htm

<table width="90%" id="general-table" align="center">

在下面添加代码

<tr><td class="label">自定义商品页面TITLE</td><td><input type="text" name="goods_title" value="{$goods.goods_title|escape}" size="50" /></td></tr>

 

 

三、修改后台程序文件 /admin/goods.php 查找

$sql = "INSERT INTO " . $ecs->table('goods') . " (goods_name, goods_name_style, goods_sn, " .

修改为(注意一共能搜到两处,每处都要修改)

$sql = "INSERT INTO " . $ecs->table('goods') . " (goods_name, goods_title, goods_name_style, goods_sn, " .

 

继续查找

"VALUES ('$_POST[goods_name]', '$goods_name_style', '$goods_sn', '$catgory_id', " .

修改为(注意一共能搜到两处,每处都要修改)

"VALUES ('$_POST[goods_name]','$_POST[goods_title]', '$goods_name_style', '$goods_sn', '$catgory_id', " .

 

再继续查找代码

"goods_name = '$_POST[goods_name]', " .

修改为:

"goods_name = '$_POST[goods_name]', goods_title='$_POST[goods_title]'," .

 

 

四、修改ECSHOP前台商品程序文件,打开 /goods.php 查找

$smarty->assign('page_title', $position['title']); // 页面标题

修改为:

$page_title=!empty($goods['goods_title']) ? $goods['goods_title'] : $position['title']; $smarty->assign('page_title', $page_title); // 页面标题

 

 

转载于:https://www.cnblogs.com/wangblognet/archive/2012/10/17/2728192.html

相关资源:ECSHOP精品插件

最新回复(0)