新聞中心
ecshop增加多個產(chǎn)品詳細(xì)描述編輯器的方法
眾所周知,我們在買東西的時候會對比,這個對比就是通過商品的屬性進(jìn)行相互的比較,通過對比選出最佳,最適合自己的商品。當(dāng)然我們在網(wǎng)上商城購物也是一樣的,站長朋友在展示商品時,在做商產(chǎn)品詳情的時候,經(jīng)常會有選項卡類似的幾個產(chǎn)品說明,如:商品詳情,商品規(guī)格,參數(shù)列表,售后服務(wù)等。很多站長朋友反映說Ecshop后臺里面默認(rèn)只有一個編輯框(器),這樣就會對產(chǎn)品的描述不夠全面,影響用戶的體驗,要是能多添加幾個就好了,那么我們還得自己添加幾個,所有站長朋友就會問小編“如何增加Ecshop產(chǎn)品描述編輯器個數(shù)呢?” 方法說簡單也簡單,就是改動一下代碼,下面小編帶著大家走進(jìn)奇幻的修改代碼世界: 1)在數(shù)據(jù)庫的表esc_goods里增加二個text的字段用來存儲新增的二個編輯框的內(nèi)容, 如:goods_desc2,goods_desc3(可以用phpmyadmin) 2)修改生成編輯器的函數(shù) 找到 /admin/includes/lib_main.php 文件 將 function create_html_editor($input_name, $input_value = '') 修改為 function create_html_editor($input_name, $input_value = '',$fckid=0) 繼續(xù)向下找到 $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)最后修改一下對應(yīng)的后臺顯示文件 /admin/templates/goods_info.htm 找到下面這些代碼 <table width="90%" id="detail-table" style="display:none"> <tr> <td>{$FCKeditor}</td> </tr> </table> 在下面復(fù)制粘貼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">售后服務(wù):</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> 修改頂部的導(dǎo)航: 找到<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)最后修改內(nèi)容存儲進(jìn)數(shù)據(jù)庫的文件,打開 /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]', " . 相信大家還沉浸在修改代碼的樂趣之中,小編很遺憾的告訴大家,到這里就結(jié)束了,Ecshop產(chǎn)品描述編輯器個數(shù)已經(jīng)添加了!大家快去試試吧!請叫我無憂雷鋒小編! 希望可以幫助到各位站長朋友! 無憂主機(jī)相關(guān)文章推薦閱讀: ECSHOP文章列表頁面如何顯示文章摘要的完美設(shè)置方案 ECSHOP后臺的廣告列表如何顯示廣告縮略圖片的完美解決方案 ECSHOP2.7.2在360瀏覽器以及動態(tài)IP不能加入購物車的解決方法
本文地址:http://www.gle-technology.com/ecshop/15151.html