ecshop增加多個(gè)產(chǎn)品詳細(xì)描述編輯器的方法
發(fā)布時(shí)間:2014-05-20 09:31:55 作者:佚名
我要評(píng)論

在做商產(chǎn)品詳情的時(shí)候,經(jīng)常會(huì)有選項(xiàng)卡類似的幾個(gè)產(chǎn)品說明,如:商品詳情,商品規(guī)格,參數(shù)列表,售后服務(wù)等,那么ecshop如何增加多個(gè)產(chǎn)品詳細(xì)描述的編輯器呢
在做商產(chǎn)品詳情的時(shí)候,經(jīng)常會(huì)有選項(xiàng)卡類似的幾個(gè)產(chǎn)品說明,如:商品詳情,商品規(guī)格,參數(shù)列表,售后服務(wù)等。
Ecshop后臺(tái)里面默認(rèn)只有一個(gè)編輯框(器),那么我們還得自己添加幾個(gè),以下是ecshop如何增加產(chǎn)品描述編輯器個(gè)數(shù)的步驟:
1)在數(shù)據(jù)庫的表esc_goods里增加二個(gè)text的字段用來存儲(chǔ)新增的二個(gè)編輯框的內(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)接下來要修改后臺(tái)商品處理頁 /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)最后修改一下對(duì)應(yīng)的后臺(tái)顯示文件 /admin/templates/goods_info.htm
找到下面這些代碼
<table width="90%" id="detail-table" style="display:none">
<tr>
<td>{$FCKeditor}</td>
</tr>
</table>
在下面復(fù)制粘貼2個(gè)并把(包括原來一個(gè))這三個(gè)表格代碼修改為
<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)容存儲(chǔ)進(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]', " .
Ecshop后臺(tái)里面默認(rèn)只有一個(gè)編輯框(器),那么我們還得自己添加幾個(gè),以下是ecshop如何增加產(chǎn)品描述編輯器個(gè)數(shù)的步驟:
1)在數(shù)據(jù)庫的表esc_goods里增加二個(gè)text的字段用來存儲(chǔ)新增的二個(gè)編輯框的內(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)接下來要修改后臺(tái)商品處理頁 /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)最后修改一下對(duì)應(yīng)的后臺(tái)顯示文件 /admin/templates/goods_info.htm
找到下面這些代碼
<table width="90%" id="detail-table" style="display:none">
<tr>
<td>{$FCKeditor}</td>
</tr>
</table>
在下面復(fù)制粘貼2個(gè)并把(包括原來一個(gè))這三個(gè)表格代碼修改為
<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)容存儲(chǔ)進(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]', " .

相關(guān)文章
ecshop實(shí)現(xiàn)針對(duì)不同支付方式對(duì)應(yīng)不同價(jià)格折扣的方法
這篇文章主要介紹了ecshop實(shí)現(xiàn)針對(duì)不同支付方式對(duì)應(yīng)不同價(jià)格折扣的方法,涉及針對(duì)Ecshop底層相關(guān)邏輯判定代碼的修改操作,需要的朋友可以參考下2016-10-10- 這篇文章主要介紹了ecshop支付寶自動(dòng)發(fā)貨接口用法,結(jié)合實(shí)例形式分析了Ecshop實(shí)現(xiàn)支付寶自動(dòng)發(fā)貨功能的相關(guān)代碼修改與接口操作代碼功能與修改技巧,需要的朋友可以參考下2016-10-10
Ecshop支付寶前臺(tái)付款而后臺(tái)不顯示已付款的解決方法
這篇文章主要介紹了Ecshop支付寶前臺(tái)付款而后臺(tái)不顯示已付款的解決方法,涉及針對(duì)文件判定邏輯的修改,需要的朋友可以參考下2016-09-26- 這篇文章主要介紹了Ecshop支付方式顯示順序修改方法,可自由調(diào)整支付方式的顯示順序,涉及Ecshop簡(jiǎn)單的源碼修改,需要的朋友可以參考下2016-09-26
Ecshop實(shí)現(xiàn)支付時(shí)傳送商品訂單號(hào)和商品名稱的方法
這篇文章主要介紹了Ecshop實(shí)現(xiàn)支付時(shí)傳送商品訂單號(hào)和商品名稱的方法,涉及Ecshop模板操作及底層代碼的修改相關(guān)技巧,需要的朋友可以參考下2016-09-26Ecshop使用支付寶支付成功后提示“此支付方式不存在或者參數(shù)錯(cuò)”的解決
這篇文章主要介紹了Ecshop使用支付寶支付成功后提示“此支付方式不存在或者參數(shù)錯(cuò)”的解決方法,分析了出現(xiàn)該錯(cuò)誤提示的原因與相關(guān)的解決方法,需要的朋友可以參考下2016-09-26Ecshop實(shí)現(xiàn)的支付寶手機(jī)網(wǎng)頁支付功能免費(fèi)版示例
這篇文章主要介紹了Ecshop實(shí)現(xiàn)的支付寶手機(jī)網(wǎng)頁支付功能免費(fèi)版,結(jié)合完整實(shí)例形式分析了Ecshop環(huán)境下的免費(fèi)版支付寶手機(jī)端完整實(shí)現(xiàn)技巧,需要的朋友可以參考下2016-09-26修改ECSHOP評(píng)論表單中的Email為非必填的修改方法
這篇文章主要介紹了修改ECSHOP評(píng)論表單中的Email為非必填的修改方法,需要的朋友可以參考下2015-09-29在ECSHOP的商品列表調(diào)用評(píng)論數(shù)量的方法
這篇文章主要介紹了在ECSHOP的商品列表調(diào)用評(píng)論數(shù)量的方法,需要的朋友可以參考下2015-09-29在ECSHOP后臺(tái)會(huì)員列表添加手機(jī)號(hào)查詢功能的方法
這篇文章主要介紹了在ECSHOP后臺(tái)會(huì)員列表添加手機(jī)號(hào)查詢功能的方法,需要的朋友可以參考下2015-09-29