打开APP
userphoto
未登录

开通VIP,畅享免费电子书等14项超值服

开通VIP
ecshop增加新字段及相应编辑器

 一、在数据库添加字段,会手写的就后台添加,不会就进入phpmyadmin默认的就行。
      这是通用的写法:(这里是增加类似商品描述的字段,其他字段自行更改)

    ALTER TABLE `ecs_goods` ADD `goods_standard ` text NOT NULL AFTER `goods_desc` ;


二、修改admin/good.php


      找到
   /* 处理商品数据 */

     $shop_price = !empty($_POST['shop_price']) ? $_POST['shop_price'] : 0;

    后面依葫芦画瓢添加进自己字段。

    $goods_standard = !empty($_POST['goods_standard']) ? $_POST['goods_standard'] : 0;

 

   找到    

     /* 入库 */

    if ($is_insert)

    {

        if ($code == '')

        {

同样依葫芦画瓢添加进自己字段

(此处为sql语句中)goods_desc, goods_standard,

 

(此处为value语句中)'$_POST[goods_desc]','$_POST[goods_standard]',

注意:else语句下与此相同

 

找到

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

同样依葫芦画瓢添加进自己字段

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

 

三、修改admin/templates/goods_info.htm
     在合适的地方添加,如果想在编辑商品—详细信息处添加,找到

         <table width="90%" id="detail-table" style="display:none">

          <tr>

            <td>商品详细描述</td>

          </tr>

          <tr>

            <td>{$FCKeditor}</td>

          </tr>

 

        </table>

      同样依葫芦画瓢添加进自己的信息

         <table width="90%" id="detail-table" style="display:none">

         <tr>

            <td>执行标准</td>

          </tr>

          <tr>

            <td>{$FCKeditor2}</td>

          </tr>

 

        </table>

 

四、修改模板在合适的地方添加:

找到tab标签位置,在合适的位置依葫芦画瓢添加你的信息

例如:<h2 class="h2bg"><a href="#product-detail"  >执行标准</a></h2>

在相应调用的位置依葫芦画瓢添加 

        <blockquote>       

      <div class="blank"></div>

    {$goods.goods_standard}

      </blockquote>

 

至此字段添加完成,接下来我们添加编辑器

 

一、在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);

}

 

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

找到

create_html_editor('goods_desc', $goods['goods_desc']);

在它下面另添加1行

create_html_editor('goods_standard', $goods['goods_standard'],2);

 

 

 

 

本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请点击举报
打开APP,阅读全文并永久保存 查看更多类似文章
猜你喜欢
类似文章
【热】打开小程序,算一算2024你的财运
ecshop更换升级FCKeditor编辑器到Kindeditor,支持图片批量上传,和百度地图添加
ECshop后台添加商品的导航增添一个规格参数
mysql sql常用语句大全
ecshop2.71修改所有品牌为去掉过滤不用加brand.php?=这个条件
在JSP中使用FCKeditor编辑器 - Norez
彻底更换ecshop编辑器为kindeditor实现在多张图片上传
更多类似文章 >>
生活服务
热点新闻
分享 收藏 导长图 关注 下载文章
绑定账号成功
后续可登录账号畅享VIP特权!
如果VIP功能使用有故障,
可点击这里联系客服!

联系客服