ecshop增加多个产品详细描述编辑器的方法
发布时间:2014-05-20 09:31:55 作者:佚名 我要评论
在做商产品详情的时候,经常会有选项卡类似的几个产品说明,如:商品详情,商品规格,参数列表,售后服务等,那么ecshop如何增加多个产品详细描述的编辑器呢
在做商产品详情的时候,经常会有选项卡类似的几个产品说明,如:商品详情,商品规格,参数列表,售后服务等。
Ecshop后台里面默认只有一个编辑框(器),那么我们还得自己添加几个,以下是ecshop如何增加产品描述编辑器个数的步骤:
1)在数据库的表esc_goods里增加二个text的字段用来存储新增的二个编辑框的内容,
如:goods_desc2,goods_desc3(可以用phpmyadmin)
2)修改生成编辑器的函数 找到 /admin/includes/lib_main.php 文件
将
function create_html_editor($input_name, $input_value = '')
修改为
function create_html_editor($input_name, $input_value = '',$fckid=0)
继续向下找到
$smarty->assign('FCKeditor', $FCKeditor);
将它修改为
if ($fckid)
{
$smarty->assign('FCKeditor'.$fckid, $FCKeditor);
}
else
{
$smarty->assign('FCKeditor', $FCKeditor);
}
3)接下来要修改后台商品处理页 /admin/goods.php 文件
找到 create_html_editor('goods_desc', $goods['goods_desc']);
在它下面另添加2行
create_html_editor('goods_desc2', $goods['goods_desc2'],2);
create_html_editor('goods_desc3', $goods['goods_desc3'],3);
4)最后修改一下对应的后台显示文件 /admin/templates/goods_info.htm
找到下面这些代码
<table width="90%" id="detail-table" style="display:none">
<tr>
<td>{$FCKeditor}</td>
</tr>
</table>
在下面复制粘贴2个并把(包括原来一个)这三个表格代码修改为
<table width="90%" id="detail-table" style="display:none">
<tr>
<td width="80" align="right">商品详情:</td>
<td>{$FCKeditor}</td>
</tr>
</table>
<table width="90%" id="desc2-table" style="display:none">
<tr>
<td width="80" align="right">售后服务:</td>
<td>{$FCKeditor2}</td>
</tr>
</table>
<table width="90%" id="desc3-table" style="display:none">
<tr>
<td width="80" align="right">买家必读:</td>
<td>{$FCKeditor3}</td>
</tr>
</table>
修改顶部的导航:
找到<span class="tab-back" id="detail-tab">{$lang.tab_detail}</span>
后面加入
<span class="tab-back" id="desc2-tab">desc2</span>
<span class="tab-back" id="desc3-tab">desc3</span>
5)最后修改内容存储进数据库的文件,打开 /admin/goods.php
1> 找到如下代码:
$sql = "INSERT INTO " . $ecs->table('goods') . " (goods_name,goods_model, goods_name_style, goods_sn, " .
"cat_id, brand_id, shop_price, market_price, is_promote, promote_price, " .
"promote_start_date, promote_end_date, goods_img, goods_thumb, original_img, keywords, goods_brief, " .
"seller_note, goods_weight, goods_number, warn_number, integral, give_integral, is_best, is_new, is_hot, " .
"is_home, is_on_sale, is_alone_sale, is_shipping, goods_desc
在后面加上 ,goods_desc2 ,goods_desc3 即如下代码 $sql = "INSERT INTO " . $ecs->table('goods') . " (goods_name,goods_model, goods_name_style, goods_sn, " .
"cat_id, brand_id, shop_price, market_price, is_promote, promote_price, " .
"promote_start_date, promote_end_date, goods_img, goods_thumb, original_img, keywords, goods_brief, " .
"seller_note, goods_weight, goods_number, warn_number, integral, give_integral, is_best, is_new, is_hot, " .
"is_home, is_on_sale, is_alone_sale, is_shipping, goods_desc,goods_desc2 ,goods_desc3
在下面几行,同理找到
"VALUES ('$_POST[goods_name]','$_POST[goods_model]', '$goods_name_style', '$goods_sn', '$catgory_id', " .
"'$brand_id', '$shop_price', '$market_price', '$is_promote','$promote_price', ".
"'$promote_start_date', '$promote_end_date', '$goods_img', '$goods_thumb', '$original_img', ".
"'$_POST[keywords]', '$_POST[goods_brief]', '$_POST[seller_note]', '$goods_weight', '$goods_number',".
" '$warn_number', '$_POST[integral]', '$give_integral', '$is_best', '$is_new', '$is_hot', '$is_home', '$is_on_sale', '$is_alone_sale', $is_shipping, ".
" '$_POST[goods_desc]', '" . gmtime() . "', '". gmtime() ."', '$goods_type', '$rank_integral', '$suppliers_id')"
改为: "VALUES ('$_POST[goods_name]','$_POST[goods_model]', '$goods_name_style', '$goods_sn', '$catgory_id', " .
"'$brand_id', '$shop_price', '$market_price', '$is_promote','$promote_price', ".
"'$promote_start_date', '$promote_end_date', '$goods_img', '$goods_thumb', '$original_img', ".
"'$_POST[keywords]', '$_POST[goods_brief]', '$_POST[seller_note]', '$goods_weight', '$goods_number',".
" '$warn_number', '$_POST[integral]', '$give_integral', '$is_best', '$is_new', '$is_hot', '$is_home', '$is_on_sale', '$is_alone_sale', $is_shipping, ".
" '$_POST[goods_desc]', '$_POST[goods_desc2]', '$_POST[goods_desc3]', '" . gmtime() . "', '". gmtime() ."', '$goods_type', '$rank_integral', '$suppliers_id')"
同理,又下面几行
else
{
$sql =$sql = "INSERT INTO. $ecs->table('goods')
这一段中,作上面相同修改如下: $sql = "INSERT INTO " . $ecs->table('goods') . " (goods_name,goods_model, goods_name_style, goods_sn, " .
"cat_id, brand_id, shop_price, market_price, is_promote, promote_price, " .
"promote_start_date, promote_end_date, goods_img, goods_thumb, original_img, keywords, goods_brief, " .
"seller_note, goods_weight, goods_number, warn_number, integral, give_integral, is_best, is_new, is_hot, is_home, is_real, " .
"is_on_sale, is_alone_sale, is_shipping, goods_desc, goods_desc2, goods_desc3, add_time, last_update, goods_type, extension_code, rank_integral)" .
"VALUES ('$_POST[goods_name]','$_POST[goods_model]', '$goods_name_style', '$goods_sn', '$catgory_id', " .
"'$brand_id', '$shop_price', '$market_price', '$is_promote','$promote_price', ".
"'$promote_start_date', '$promote_end_date', '$goods_img', '$goods_thumb', '$original_img', ".
"'$_POST[keywords]', '$_POST[goods_brief]', '$_POST[seller_note]', '$goods_weight', '$goods_number',".
" '$warn_number', '$_POST[integral]', '$give_integral', '$is_best', '$is_new', '$is_hot', '$is_home', 0, '$is_on_sale', '$is_alone_sale', $is_shipping, ".
" '$_POST[goods_desc]', '$_POST[goods_desc2]', '$_POST[goods_desc3]', '" . gmtime() . "', '". gmtime() ."', '$goods_type', '$code', '$rank_integral')";
2 > 再往下几十行,找到"goods_desc = '$_POST[goods_desc]', " .在其下方再添加二行 ,改成如下 "goods_desc = '$_POST[goods_desc]', " .
"goods_desc2 = '$_POST[goods_desc2]', " .
"goods_desc3 = '$_POST[goods_desc3]', " .
Ecshop后台里面默认只有一个编辑框(器),那么我们还得自己添加几个,以下是ecshop如何增加产品描述编辑器个数的步骤:
1)在数据库的表esc_goods里增加二个text的字段用来存储新增的二个编辑框的内容,
如:goods_desc2,goods_desc3(可以用phpmyadmin)
2)修改生成编辑器的函数 找到 /admin/includes/lib_main.php 文件
将
function create_html_editor($input_name, $input_value = '')
修改为
function create_html_editor($input_name, $input_value = '',$fckid=0)
继续向下找到
$smarty->assign('FCKeditor', $FCKeditor);
将它修改为
if ($fckid)
{
$smarty->assign('FCKeditor'.$fckid, $FCKeditor);
}
else
{
$smarty->assign('FCKeditor', $FCKeditor);
}
3)接下来要修改后台商品处理页 /admin/goods.php 文件
找到 create_html_editor('goods_desc', $goods['goods_desc']);
在它下面另添加2行
create_html_editor('goods_desc2', $goods['goods_desc2'],2);
create_html_editor('goods_desc3', $goods['goods_desc3'],3);
4)最后修改一下对应的后台显示文件 /admin/templates/goods_info.htm
找到下面这些代码
<table width="90%" id="detail-table" style="display:none">
<tr>
<td>{$FCKeditor}</td>
</tr>
</table>
在下面复制粘贴2个并把(包括原来一个)这三个表格代码修改为
<table width="90%" id="detail-table" style="display:none">
<tr>
<td width="80" align="right">商品详情:</td>
<td>{$FCKeditor}</td>
</tr>
</table>
<table width="90%" id="desc2-table" style="display:none">
<tr>
<td width="80" align="right">售后服务:</td>
<td>{$FCKeditor2}</td>
</tr>
</table>
<table width="90%" id="desc3-table" style="display:none">
<tr>
<td width="80" align="right">买家必读:</td>
<td>{$FCKeditor3}</td>
</tr>
</table>
修改顶部的导航:
找到<span class="tab-back" id="detail-tab">{$lang.tab_detail}</span>
后面加入
<span class="tab-back" id="desc2-tab">desc2</span>
<span class="tab-back" id="desc3-tab">desc3</span>
5)最后修改内容存储进数据库的文件,打开 /admin/goods.php
1> 找到如下代码:
$sql = "INSERT INTO " . $ecs->table('goods') . " (goods_name,goods_model, goods_name_style, goods_sn, " .
"cat_id, brand_id, shop_price, market_price, is_promote, promote_price, " .
"promote_start_date, promote_end_date, goods_img, goods_thumb, original_img, keywords, goods_brief, " .
"seller_note, goods_weight, goods_number, warn_number, integral, give_integral, is_best, is_new, is_hot, " .
"is_home, is_on_sale, is_alone_sale, is_shipping, goods_desc
在后面加上 ,goods_desc2 ,goods_desc3 即如下代码 $sql = "INSERT INTO " . $ecs->table('goods') . " (goods_name,goods_model, goods_name_style, goods_sn, " .
"cat_id, brand_id, shop_price, market_price, is_promote, promote_price, " .
"promote_start_date, promote_end_date, goods_img, goods_thumb, original_img, keywords, goods_brief, " .
"seller_note, goods_weight, goods_number, warn_number, integral, give_integral, is_best, is_new, is_hot, " .
"is_home, is_on_sale, is_alone_sale, is_shipping, goods_desc,goods_desc2 ,goods_desc3
在下面几行,同理找到
"VALUES ('$_POST[goods_name]','$_POST[goods_model]', '$goods_name_style', '$goods_sn', '$catgory_id', " .
"'$brand_id', '$shop_price', '$market_price', '$is_promote','$promote_price', ".
"'$promote_start_date', '$promote_end_date', '$goods_img', '$goods_thumb', '$original_img', ".
"'$_POST[keywords]', '$_POST[goods_brief]', '$_POST[seller_note]', '$goods_weight', '$goods_number',".
" '$warn_number', '$_POST[integral]', '$give_integral', '$is_best', '$is_new', '$is_hot', '$is_home', '$is_on_sale', '$is_alone_sale', $is_shipping, ".
" '$_POST[goods_desc]', '" . gmtime() . "', '". gmtime() ."', '$goods_type', '$rank_integral', '$suppliers_id')"
改为: "VALUES ('$_POST[goods_name]','$_POST[goods_model]', '$goods_name_style', '$goods_sn', '$catgory_id', " .
"'$brand_id', '$shop_price', '$market_price', '$is_promote','$promote_price', ".
"'$promote_start_date', '$promote_end_date', '$goods_img', '$goods_thumb', '$original_img', ".
"'$_POST[keywords]', '$_POST[goods_brief]', '$_POST[seller_note]', '$goods_weight', '$goods_number',".
" '$warn_number', '$_POST[integral]', '$give_integral', '$is_best', '$is_new', '$is_hot', '$is_home', '$is_on_sale', '$is_alone_sale', $is_shipping, ".
" '$_POST[goods_desc]', '$_POST[goods_desc2]', '$_POST[goods_desc3]', '" . gmtime() . "', '". gmtime() ."', '$goods_type', '$rank_integral', '$suppliers_id')"
同理,又下面几行
else
{
$sql =$sql = "INSERT INTO. $ecs->table('goods')
这一段中,作上面相同修改如下: $sql = "INSERT INTO " . $ecs->table('goods') . " (goods_name,goods_model, goods_name_style, goods_sn, " .
"cat_id, brand_id, shop_price, market_price, is_promote, promote_price, " .
"promote_start_date, promote_end_date, goods_img, goods_thumb, original_img, keywords, goods_brief, " .
"seller_note, goods_weight, goods_number, warn_number, integral, give_integral, is_best, is_new, is_hot, is_home, is_real, " .
"is_on_sale, is_alone_sale, is_shipping, goods_desc, goods_desc2, goods_desc3, add_time, last_update, goods_type, extension_code, rank_integral)" .
"VALUES ('$_POST[goods_name]','$_POST[goods_model]', '$goods_name_style', '$goods_sn', '$catgory_id', " .
"'$brand_id', '$shop_price', '$market_price', '$is_promote','$promote_price', ".
"'$promote_start_date', '$promote_end_date', '$goods_img', '$goods_thumb', '$original_img', ".
"'$_POST[keywords]', '$_POST[goods_brief]', '$_POST[seller_note]', '$goods_weight', '$goods_number',".
" '$warn_number', '$_POST[integral]', '$give_integral', '$is_best', '$is_new', '$is_hot', '$is_home', 0, '$is_on_sale', '$is_alone_sale', $is_shipping, ".
" '$_POST[goods_desc]', '$_POST[goods_desc2]', '$_POST[goods_desc3]', '" . gmtime() . "', '". gmtime() ."', '$goods_type', '$code', '$rank_integral')";
2 > 再往下几十行,找到"goods_desc = '$_POST[goods_desc]', " .在其下方再添加二行 ,改成如下 "goods_desc = '$_POST[goods_desc]', " .
"goods_desc2 = '$_POST[goods_desc2]', " .
"goods_desc3 = '$_POST[goods_desc3]', " .
相关文章
- 这篇文章主要介绍了ecshop实现针对不同支付方式对应不同价格折扣的方法,涉及针对Ecshop底层相关逻辑判定代码的修改操作,需要的朋友可以参考下2016-10-10
- 这篇文章主要介绍了ecshop支付宝自动发货接口用法,结合实例形式分析了Ecshop实现支付宝自动发货功能的相关代码修改与接口操作代码功能与修改技巧,需要的朋友可以参考下2016-10-10
- 这篇文章主要介绍了Ecshop支付宝前台付款而后台不显示已付款的解决方法,涉及针对文件判定逻辑的修改,需要的朋友可以参考下2016-09-26
- 这篇文章主要介绍了Ecshop支付方式显示顺序修改方法,可自由调整支付方式的显示顺序,涉及Ecshop简单的源码修改,需要的朋友可以参考下2016-09-26
- 这篇文章主要介绍了Ecshop实现支付时传送商品订单号和商品名称的方法,涉及Ecshop模板操作及底层代码的修改相关技巧,需要的朋友可以参考下2016-09-26
Ecshop使用支付宝支付成功后提示“此支付方式不存在或者参数错”的解决
这篇文章主要介绍了Ecshop使用支付宝支付成功后提示“此支付方式不存在或者参数错”的解决方法,分析了出现该错误提示的原因与相关的解决方法,需要的朋友可以参考下2016-09-26- 这篇文章主要介绍了Ecshop实现的支付宝手机网页支付功能免费版,结合完整实例形式分析了Ecshop环境下的免费版支付宝手机端完整实现技巧,需要的朋友可以参考下2016-09-26
- 这篇文章主要介绍了修改ECSHOP评论表单中的Email为非必填的修改方法,需要的朋友可以参考下2015-09-29
- 这篇文章主要介绍了在ECSHOP的商品列表调用评论数量的方法,需要的朋友可以参考下2015-09-29
- 这篇文章主要介绍了在ECSHOP后台会员列表添加手机号查询功能的方法,需要的朋友可以参考下2015-09-29
最新评论