1. 程式人生 > >ecshop新增多個商品詳情(編輯器為百度編輯器)

ecshop新增多個商品詳情(編輯器為百度編輯器)

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]', " .