在做商产品详情的时候,经常会有选项卡类似的几个产品说明,如:商品详情,商品规格,参数列表,售后服务等。

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如何增加多个产品详细描述的编辑器的更多相关文章

  1. ecshop后台增加模块菜单项详细教程(图文)

    有的时候我们会在后台增加新的功能,菜单项是一个程序的入口,是必不可少的,如何在后台增加菜单项呢,大家可以参考下面的教程:   例如:想在后台左侧的菜单栏的"促销管理"下添加一个&q ...

  2. ecshop商品详细描述调用商品相册代码

    该修改方法让用户体验更好,特别是ecshop建站的用户产品描叙文字不多的朋友,直接让相册图显示在产品描述里.免去除在后台添加了 <div style="text-align:cente ...

  3. ecshop后台增加模块菜单详细教程(图)

    我们有时候针对ecshop如此开发,想在后台加一些菜单,最模板以前提供过教程,但是并非很系统,今天最模板抛砖引玉图文教程告诉大家:如何在ecshop后台增加模块菜单! 首先需要修改四个文件:inc_p ...

  4. ecshop后台增加模块菜单详细教程

    我们有时候针对ecshop如此开发,想在后台加一些菜单,最模板以前提供过教程,但是并非很系统,今天最模板抛砖引玉图文教程告诉大家:如何在ecshop后台增加模块菜单! 首先需要修改四个文件:inc_p ...

  5. 2016 正确 sublime安装PHPcs PHPcodesniffer代码规范提示插件,修正网上部分不详细描述

    对你有助请点赞,请顶,不好请踩------送人玫瑰,手留余香!-------------------14:37 2016/3/212016 正确 sublime安装PHPcs PHPcodesniff ...

  6. ecshop后台增加|添加商店设置选项和使用方法详解

    有时候我们想在Ecshop后台做个设置.radio.checkbox 等等来控制页面的显示,看看Ecshop的设计,用到了shop_config这个商店设置功能 Ecshop后台增加|添加商店设置选项 ...

  7. Ecshop 后台增加一个左侧列表菜单menu菜单的方法

    Ecshop 后台增加一个左侧列表菜单menu菜单需要修改三个文件:/admin/includes/inc_menu.php/admin/includes/inc_priv.php/languages ...

  8. Ecshop、Discuz! 等开源产品的局限

    Ecshop.Discuz! 等开源产品的局限 记得今年年初,我初次接触Discuz!和Ecshop时,一阵阵地惊叹:成熟度这么高的产品,居然是免费的.我们这些搞传统软件开发的要怎么活?另外也奇怪,做 ...

  9. Ecshop的购物流程代码分析详细说明

    Ecshop的购物流程代码分析详细说明 (2012-07-30 10:41:12) 转载▼ 标签: 购物车 结算中心 商品价格 ecshop ecshop购物流程 杂谈 分类: ECSHOP研究院 同 ...

随机推荐

  1. Yii的缓存机制之页面缓存

    页面缓存是不能通过片段缓存来实现的,因为布局和内容不能同时缓存.只能通过过滤器来生成缓存. 实现方法: 在控制器里使用过滤器来实现 function filters (){ return array( ...

  2. PHP中的关系判断和注释

    == 只判断内容,不判断类型=== 全等于,即判断内容,又判断类型 != 不等于,只判断内容,不判断类型 !== 全不等于,即判断内容,又判断类型

  3. Constructing Roads In JGShining's Kingdom

    点击打开题目链接 本题目是考察  最长递增子序列的  有n^2     n(logn)  n^2  会超时的 下面两个方法的代码  思路  可以百度LIS  LCS dp里面存子序列 n(logn) ...

  4. asterisk用 freetds记录 cdr 到mssql

    Compile, configure, and install the latest FreeTDS package: [pre]           tar -zxvf freetds-0.62.4 ...

  5. python 基础之第十二天(re正则,socket模块)

    In [14]: 'hello-wold.tar.gz'.split('.') Out[14]: ['hello-wold', 'tar', 'gz'] In [15]: import re In [ ...

  6. vue 常用的表单验证,包括手机号码,固定电话和身份证...

    <template> <div> <pl-content-box> <pl-page-nav :show-previous=true></pl-p ...

  7. SNMP的应用

    前两天项目要求一个附加功能,远程监视服务器的运行状况,要定期监视指定端口,指定业务,还包括服务器的磁盘空间,内存,CPU使用率等等.这头俩事还好说,ping和telnet也就搞定了,实在不行就开个so ...

  8. Jasper:API / API 策略和最佳做法

    ylbtech-Jasper:API / API 策略和最佳做法 1.返回顶部 1. API 策略和最佳做法 Cisco Jasper 已经建立了一项 API 公平使用策略,确保所有 Control  ...

  9. Object.prototype.toString.call(obj)检测数据类型

    typeof bar=='object' 不能确切判断数据是一个‘纯粹’的对象 Array null的结果都是object 比较好的方法是: Object.prototype.toString.cal ...

  10. 大数据 云计算 AI