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后台增加模块菜单项详细教程(图文)
有的时候我们会在后台增加新的功能,菜单项是一个程序的入口,是必不可少的,如何在后台增加菜单项呢,大家可以参考下面的教程: 例如:想在后台左侧的菜单栏的"促销管理"下添加一个&q ...
- ecshop商品详细描述调用商品相册代码
该修改方法让用户体验更好,特别是ecshop建站的用户产品描叙文字不多的朋友,直接让相册图显示在产品描述里.免去除在后台添加了 <div style="text-align:cente ...
- ecshop后台增加模块菜单详细教程(图)
我们有时候针对ecshop如此开发,想在后台加一些菜单,最模板以前提供过教程,但是并非很系统,今天最模板抛砖引玉图文教程告诉大家:如何在ecshop后台增加模块菜单! 首先需要修改四个文件:inc_p ...
- ecshop后台增加模块菜单详细教程
我们有时候针对ecshop如此开发,想在后台加一些菜单,最模板以前提供过教程,但是并非很系统,今天最模板抛砖引玉图文教程告诉大家:如何在ecshop后台增加模块菜单! 首先需要修改四个文件:inc_p ...
- 2016 正确 sublime安装PHPcs PHPcodesniffer代码规范提示插件,修正网上部分不详细描述
对你有助请点赞,请顶,不好请踩------送人玫瑰,手留余香!-------------------14:37 2016/3/212016 正确 sublime安装PHPcs PHPcodesniff ...
- ecshop后台增加|添加商店设置选项和使用方法详解
有时候我们想在Ecshop后台做个设置.radio.checkbox 等等来控制页面的显示,看看Ecshop的设计,用到了shop_config这个商店设置功能 Ecshop后台增加|添加商店设置选项 ...
- Ecshop 后台增加一个左侧列表菜单menu菜单的方法
Ecshop 后台增加一个左侧列表菜单menu菜单需要修改三个文件:/admin/includes/inc_menu.php/admin/includes/inc_priv.php/languages ...
- Ecshop、Discuz! 等开源产品的局限
Ecshop.Discuz! 等开源产品的局限 记得今年年初,我初次接触Discuz!和Ecshop时,一阵阵地惊叹:成熟度这么高的产品,居然是免费的.我们这些搞传统软件开发的要怎么活?另外也奇怪,做 ...
- Ecshop的购物流程代码分析详细说明
Ecshop的购物流程代码分析详细说明 (2012-07-30 10:41:12) 转载▼ 标签: 购物车 结算中心 商品价格 ecshop ecshop购物流程 杂谈 分类: ECSHOP研究院 同 ...
随机推荐
- java引用问题(—)
为了美观起见,将说明性问题用注释引起来,这样只是为了美观 基本的类型只有一块存储空间(stack中),而引用类型在内存中有两块存储空间(stack和heap中). public class test ...
- DGA域名——可以每天只生成一个域名,因此最多存在365个 DGA域名;
Mirai变种中的DGA 分享到: 发布时间:2016-12-12 16:02:57 作者:360网络安全研究院 投稿方式:发送邮件至linwei#360.cn,或登陆网页版在线投稿 那个导致美国断网 ...
- 重装系统后texstudio拼写检查不工作
重装texstudio还是不行. 后来发现是重装系统后用户名和以前的系统用户明不一样,导致系统盘里的用户文件夹路径不一样.而texstudio的字典存放在用户路径文件夹下 C:\Users\xxx\A ...
- Centos下Docker安装与使用的相关命令
sudo yum install -y yum-utils device-mapper-persistent-data lvm2 systemctl docker status yum-config- ...
- 简单数位DP
https://cn.vjudge.net/problem/HDU-4722 懒得写看,代码注释吧;主要存板子 #include <cstdio> #include <cstring ...
- vim 使用、设置笔记
一.设置.vimrc( windows下通常为_vimrc) 1.设置vim中tab的缩进 set ts=4 (注:ts是tabstop的缩写,设TAB宽4个空格) set expandtab (注 ...
- vue-touchjs
支持vue2.0的面向指令的touch指令,基于touchjs(原百度实现的移动端手势库) vue-touchjs支持三种stopPropagation的方式: 1 .stop修饰符 2 事件han ...
- vue watch 深度监听以及立即监听
vue watch对象可以监听数据,数据发生变化,处理函数 watch虽可以监听,但只是浅监听,只监听数据第一层或者第二层.比如对于整个对象的监听,需要用到深度监听 vm.$watch('obj',f ...
- spark学习之IDEA配置spark并wordcount提交集群
这篇文章包括以下内容 (1)IDEA中scala的安装 (2)hdfs简单的使用,没有写它的部署 (3) 使用scala编写简单的wordcount,输入文件和输出文件使用参数传递 (4)IDEA打包 ...
- PhpStorm下载、破解
下载 去官网下载新版phpstorm 破解 1.打开编辑器, Help->Register->License server,输入http://idea.codebeta.cn (支持10. ...