ecshop添加多个商品详情(编辑器为百度编辑器)

在做商产品详情的时候,经常会有选项卡类似的几个产品说明,如:商品详情,商品规格,参数列表,售后服务等。 
Ecshop后台里面默认只有一个编辑框(器),那么我们还得自己添加几个,以下是ecshop如何增加产品描述编辑器个数的步骤: 

1)在数据库的表esc_goods里增加二个text的字段用来存储新增的二个编辑框的内容, 

如:wap_desc(手机版产品详情页) 

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); 

百度编辑器:用几个编辑器就调用几个方法

/** 
 * WAP产品详情编辑器 
 * @param   string  input_name  输入框名称 
 * @param   string  input_value 输入框值 
 */  
function create_html_editor3($input_name, $input_value = '')  
{  
    global $smarty;


    $kindeditor3=" 
        <script id='editor3' name='$input_name' type='text/plain' style='width:100%;height:500px;'>$input_value</script>    
        <script>
            delete(Object.prototype.toJSONString);
            var ue = UE.getEditor('editor3'); 
            UE.getEditor('editor3').focus(); 
        </script> 
        ";
    $smarty->assign('FCKeditor3', $kindeditor3);

/admin/goods.php调用:create_html_editor2('question_desc',$goods['question_desc']); // 手机商品详情

3)接下来要修改后台商品处理页 /admin/goods.php 文件 

找到 create_html_editor('goods_desc', $goods['goods_desc']); 
在它下面另添加2行 
create_html_editor3('wap_desc',$goods['wap_desc']); // 手机商品详情

4)最后修改一下对应的后台显示文件 /admin/templates/goods_info.htm 

找到下面这些代码 
<table width="90%" id="detail-table" style="display:none"> 
<tr> 
<td>{$FCKeditor}</td> 
</tr> 
</table> 
在下面复制粘贴2个并把(包括原来一个)这三个表格代码修改为 
<!-- 手机版详情页 -->
        <table width="100%" class="show-desc2" id="wap-table" style="display:none"> 
          <tr> 
            <td>
            {$FCKeditor3}
            </td>
          </tr> 
        </table>
修改顶部的导航: 
找到<span class="tab-back" id="detail-tab">{$lang.tab_detail}</span> 
后面加入 
<span class="tab-back" id="wap-tab">手机版详情页</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 
在后面加上 ,wap_desc 即如下代码 $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,wap_desc 
在下面几行,同理找到 
"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[wap_desc]', '" . 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, wap_desc, 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[wap_desc]', '" . gmtime() . "', '". gmtime() ."', '$goods_type', '$code', '$rank_integral')"; 

2 > 再往下几十行,找到"goods_desc = '$_POST[goods_desc]', " .在其下方再添加二行 ,改成如下 "goods_desc = '$_POST[goods_desc]', " . 

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

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
最新淘宝宝贝描述编辑器 2.0beta版 KISSY Gallery 说明 展览馆,存放社区贡献的正式组件 组件目录结构 0) assets 统一使用 UTF-8; 1) github上 Gallery 目录结构说明: gallery 根目录下, 提交各个组件目录, 拿 pagination 举例: gallery | -- pagination // 组件目录名, 小写, 多字符用 – 分隔 | |-----1.0 // 版本名字, 两个数字表示 x.x | | |---------assets // 和组件相关的assets资源 | | | |-------img // css中用到的图片目录 | | | |-------pagination.css // 组件相关的皮肤, 可定义多套, 里面如果用到图片请使用相对路径 | | |---------pagination.js // 组件代码 | | |---------pagination-part2.js // 如果组件源码有多个js文件, 也请放置此目录下, 例如 grid组件下的多个脚本; | | |---------index.js // 入口文件 | | |---------demo.html // 示例 | | |---------tmp // 示例用到的assets资源, 这些不应该包含在组件中 | | |---------build.xml // 打包配置, 添加新组件时, 请参考 yours下目录, 如果还是不清楚, 联系乔花; | | |---------CHANGELOG.md // 变更点说明文档, 可选 开发时写的demo, 需要头部配置: KISSY.config({ packages:[ { name:"gallery", tag:"20111220", path:"../../../", // 开发时目录, 发布到cdn上需要适当修改 charset:"utf-8" } ] }); add时, KISSY.add('gallery/pagination/1.0/pagination', function(S, Template, undefined) {}); use时, KISSY.use('gallery/pagination/1.0/pagination,gallery/pagination/1.0/tmp/friends,gallery/pagination/1.0/tmp/demo.css,gallery/pagination/1.0/assets/pagination.css', function(S, P, FriendList, undefined) {}); 2) cdn上 Gallery 目录结构说明: /pathtocdn/kissy/gallery | -- pagination | |-----1.0 | | |---------assets // 该目录会完整从github上的assets拷贝过去, 并且会压缩源码 | | |---------index.js // 将组件代码打包成一个文件 ,名字为 index.js 并压缩; 这样使用 Gallery组件时, 可以 S.use("gallery/pagination/1.0/", function (S, Pagination) {}); 3) 还有几个注意点: 3.0) gallery-build 打包目录; 3.1) 打包规则: - 各个组件通过各自的 build.xml 统一build 到外面, 不需要组件开发者手工build, 我们会定时统一build好提交到cdn上, 这个打包规则应该能够满足90%的需求, 如果某些特殊, 可以自行编写 build.xml; 3.2) 提交新组件时: - 务必gallery 中组件使用 1.2.0 Loader 的写法. 不考虑 1.1.6. 如果其他人要用该组件, 自行拷贝修改; - 提交到 KISSY Gallery 请参考 yours.7z 中目录结构; 3.3) 修改组件时: - 小修改/bugfix, 保持兼容且适当写上changelog; - 大修改或者接口不兼容, 建议新起版本号, 并注明升级注意点;
ecshop更换百度ueditor插件相关信息如下: ecshop版本:ecshop2.7.3 编码格式:UTF-8 ueditor版本:1.4.3 1、打开admin/includes/lib_main.php文件 (1)找到:(大约在306-323行左右) /** * 生成编辑器 * @param string input_name 输入框名称 * @param string input_value 输入框值 */ function create_html_editor($input_name, $input_value = '') { global $smarty; $editor = new FCKeditor($input_name); $editor->BasePath = '../includes/fckeditor/'; $editor->ToolbarSet = 'Normal'; $editor->Width = '100%'; $editor->Height = '320'; $editor->Value = $input_value; $FCKeditor = $editor->CreateHtml(); $smarty->assign('FCKeditor', $FCKeditor); } 将这段代码修改为: /** * 生成编辑器 * @param string input_name 输入框名称 * @param string input_value 输入框值 */ function create_html_editor($input_name, $input_value = '') { global $smarty; $editor = new FCKeditor($input_name); $editor->BasePath = '../includes/fckeditor/'; $editor->ToolbarSet = 'Normal'; $editor->Width = '100%'; $editor->Height = '320'; $editor->Value = $input_value; $FCKeditor = $editor->CreateHtml(); $smarty->assign('FCKeditor', $FCKeditor); } 将这段代码修改为: /** * 生成编辑器 * @param string input_name 输入框名称 * @param string input_value 输入框值 */ function create_html_editor($input_name, $input_value = '') { global $smarty; $kindeditor=" &lt;script id='editor' name='$input_name' type='text/plain' style='width:100%;height:500px;'&gt;$input_value&lt;/script&gt; &lt;script type='text/javascript' charset='utf-8' src='../includes/ueditor/ueditor.config.js'&gt;&lt;/script&gt; &lt;script type='text/javascript' charset='utf-8' src='../includes/ueditor/ueditor.all.min.js'&gt; &lt;/script&gt; &lt;script type='text/javascript' charset='utf-8' src='../includes/ueditor/lang/zh-cn/zh-cn.js'&gt;&lt;/script&gt; &lt;script&gt; var ue = UE.getEditor('editor'); UE.getEditor('editor').focus(); &lt;/script&gt; "; $smarty->assign('FCKeditor', $k

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值