花魁直播高品质美女在线视频互动社区 - 花魁直播官方版

 歡迎來到素材無憂網(wǎng),按 + 收藏我們
登錄 注冊(cè) 退出 找回密碼

ecshop商品描述增加多個(gè)商品描述編輯器的方法

時(shí)間: 2024-02-25 10:43 閱讀: 作者:素材無憂網(wǎng)

各位ECSHOP網(wǎng)店系統(tǒng)用戶大家好,歡迎來到素材無憂圖文教程,今天為大家詳細(xì)解說一下ECSHOP怎么增加多個(gè)商品描述編輯器方法。
素材無憂ECSHOP視頻教程也再不斷的完善與跟進(jìn),期待大家的關(guān)注!希望在ECSHOP的道路上,素材無憂與您一路同行!
在數(shù)據(jù)庫的表esc_goods里增加二個(gè)text的字段用來存儲(chǔ)新增的二個(gè)編輯框的內(nèi)容,
如:goods_desc2,goods_desc3
goods_shipai 自己寫一個(gè)記得住就行
(可以用phpmyadmin)
修改內(nèi)容存儲(chǔ)進(jìn)數(shù)據(jù)庫的文件,打開 /admin/goods.php 搜索:goods_desc
大概150行:
/* 取得商品信息 */
if ($is_add)
{
/* 默認(rèn)值 */
$last_choose = array(0, 0);
if (!empty($_COOKIE['ECSCP']['last_choose']))
{
$last_choose = explode('|', $_COOKIE['ECSCP']['last_choose']);
}
$goods = array(
'goods_id' => 0,
'goods_desc' => '',
下面增加:
/* 取得商品信息 */
if ($is_add)
{
/* 默認(rèn)值 */
$last_choose = array(0, 0);
if (!empty($_COOKIE['ECSCP']['last_choose']))
{
$last_choose = explode('|', $_COOKIE['ECSCP']['last_choose']);
}
$goods = array(
'goods_id'? => 0,
'goods_desc'? ?=> '',
'goods_shipai'? ?=> '',
'cat_id'? ?=> $last_choose[0],
第2 地方大概:231行:
/* 默認(rèn)值 */
$goods = array(
'goods_id'?=> 0,
'goods_desc'?=> '',
'goods_shipai'?=> '',
'cat_id'?=> 0,
3.
/* 拆分商品名稱樣式 */
$goods_name_style = explode('+', empty($goods['goods_name_style']) ? '+' : $goods['goods_name_style']);
/* 創(chuàng)建 html editor */
create_html_editor('goods_desc', $goods['goods_desc']);
create_html_editor2('goods_shipai', 'goods_shipai',$goods['goods_shipai']);
4.入庫:
/* 入庫 */
if ($is_insert)
{
if ($code == '')
{
$sql = "INSERT INTO " . $ecs->table('goods') . " (goods_name, 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_on_sale, is_alone_sale, is_shipping, goods_desc, add_time, last_update, goods_type, rank_integral, suppliers_id , goods_shipai )" .
"VALUES ('$_POST[goods_name]', '$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_on_sale', '$is_alone_sale', $is_shipping, ".
" '$_POST[goods_desc]', '" . gmtime() . "', '". gmtime() ."', '$goods_type', '$rank_integral', '$suppliers_id' , '$_POST[goods_shipai]')";
}
else
{
$sql = "INSERT INTO " . $ecs->table('goods') . " (goods_name, 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_real, " .
"is_on_sale, is_alone_sale, is_shipping, goods_desc, add_time, last_update, goods_type, extension_code, rank_integral , ?goods_shipai)" .
"VALUES ('$_POST[goods_name]', '$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', 0, '$is_on_sale', '$is_alone_sale', $is_shipping, ".
" '$_POST[goods_desc]', '" . gmtime() . "', '". gmtime() ."', '$goods_type', '$code', '$rank_integral' , '$_POST[goods_shipai]')";
}
}
else
{
5.
/* 如果有上傳圖片,需要更新數(shù)據(jù)庫 */
if ($goods_img)
{
$sql .= "goods_img = '$goods_img', original_img = '$original_img', ";
}
if ($goods_thumb)
{
$sql .= "goods_thumb = '$goods_thumb', ";
}
if ($code != '')
{
$sql .= "is_real=0, extension_code='$code', ";
}
$sql .= "keywords = '$_POST[keywords]', " .
"goods_brief = '$_POST[goods_brief]', " .
"seller_note = '$_POST[seller_note]', " .
"goods_weight = '$goods_weight'," .
"goods_number = '$goods_number', " .
"warn_number = '$warn_number', " .
"integral = '$_POST[integral]', " .
"give_integral = '$give_integral', " .
"rank_integral = '$rank_integral', " .
"is_best = '$is_best', " .
"is_new = '$is_new', " .
"is_hot = '$is_hot', " .
"is_on_sale = '$is_on_sale', " .
"is_alone_sale = '$is_alone_sale', " .
"is_shipping = '$is_shipping', " .
"goods_desc = '$_POST[goods_desc]', " .
"goods_shipai = '$_POST[goods_shipai]', " .
"last_update = '". gmtime() ."', ".
"goods_type = '$goods_type' " .
"WHERE goods_id = '$_REQUEST[goods_id]' LIMIT 1";
}
$db->query($sql);
找到admin/ includes/lib_main.php
個(gè)商品編輯器
306行:
/**
* 生成編輯器
* @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 ? ? ?= ' ';
$editor->Height ? ? = '320';
$editor->Value ? ? ?= $input_value;
$FCKeditor = $editor->CreateHtml();
$smarty->assign('FCKeditor', $FCKeditor);
}
第2個(gè)商品編輯器
/**
* 生成編輯器2
* @param ? string ?input_name ?輸入框名稱
* @param ? string ?input_value 輸入框值
*/
function create_html_editor2($input_name, $output_name , $input_value = '')
{
global $smarty;
$editor = new FCKeditor($input_name);
$editor->BasePath ? = '../includes/fckeditor/';
$editor->ToolbarSet = 'Normal';
$editor->Width ? ? ?= ' ';
$editor->Height ? ? = '320';
$editor->Value ? ? ?= $input_value;
$FCKeditor = $editor->CreateHtml();
$smarty->assign($output_name, $FCKeditor);//這里輸出就用$output_name變量了。
}
修改一下對(duì)應(yīng)的后臺(tái)顯示文件 /admin/templates/goods_info.htm
找到:
下面新增加:
最后后臺(tái)效果:
然后修改商品頁模板goods.dwt: 找到原始商品描述:{$goods.goods_desc}

ecshop商品描述增加多個(gè)商品描述編輯器的方法(圖1)

{$goods.goods_desc}

下面增加第2 個(gè)商品描述編輯器描述內(nèi)容:

ecshop商品描述增加多個(gè)商品描述編輯器的方法(圖2)

{$goods.goods_shipai}
這個(gè)是新增加的前臺(tái)效果:

版權(quán)聲明: 本站資源均來自互聯(lián)網(wǎng)或會(huì)員發(fā)布,如果侵犯了您的權(quán)益請(qǐng)與我們聯(lián)系,我們將在24小時(shí)內(nèi)刪除!謝謝!

轉(zhuǎn)載請(qǐng)注明: ecshop商品描述增加多個(gè)商品描述編輯器的方法

標(biāo)簽: ecshop商品描述  
相關(guān)文章
推薦文章
模板推薦