您现在的位置是:首页 > cms教程 > Ecshop商城教程Ecshop商城教程
ecshop商品描述增加多个商品描述编辑器的方法
访卉2024-01-01Ecshop商城教程已有人查阅
导读各位ECSHOP网店系统用户大家好,欢迎来到代码号图文教程,今天为大家详细解说一下ECSHOP怎么增加多个商品描述编辑器方法。
各位ECSHOP网店系统用户大家好,欢迎来到代码号图文教程,今天为大家详细解说一下ECSHOP怎么增加多个商品描述编辑器方法。
代码号ECSHOP视频教程也再不断的完善与跟进,期待大家的关注!希望在ECSHOP的道路上,代码号与您一路同行!
在数据库的表esc_goods里增加二个text的字段用来存储新增的二个编辑框的内容,
如:goods_desc2,goods_desc3
goods_shipai 自己写一个记得住就行
(可以用phpmyadmin)
修改内容存储进数据库的文件,打开 /admin/goods.php 搜索:goods_desc
大概150行:
个商品编辑器
306行:
找到:
然后修改商品页模板goods.dwt: 找到原始商品描述:{$goods.goods_desc}
代码号ECSHOP视频教程也再不断的完善与跟进,期待大家的关注!希望在ECSHOP的道路上,代码号与您一路同行!
在数据库的表esc_goods里增加二个text的字段用来存储新增的二个编辑框的内容,
如:goods_desc2,goods_desc3
goods_shipai 自己写一个记得住就行
(可以用phpmyadmin)
修改内容存储进数据库的文件,打开 /admin/goods.php 搜索:goods_desc
大概150行:
/* 取得商品信息 */
if ($is_add)
{
/* 默认值 */
$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)
{
/* 默认值 */
$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行:
/* 默认值 */
$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']);
/* 创建 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.
/* 如果有上传图片,需要更新数据库 */
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个商品编辑器
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个商品编辑器
/**
* 生成编辑器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变量了。
}
修改一下对应的后台显示文件 /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>{$goods_shipai}</td>
</tr>
</table>
最后后台效果:然后修改商品页模板goods.dwt: 找到原始商品描述:{$goods.goods_desc}
<!-- 本单详情-->
<div class="inLeft_title " id="shangpjs"> <img border="0" src="../images/inLeft_title02.gif"> </div>
<div class="inLeft_attributes inLeft_style">
<div class="inLeft_orderDetail" >
<div class="inLeft_orderDetail_in" > {$goods.goods_desc} </div>
</div>
</div>
下面增加第2 个商品描述编辑器描述内容:
<!--产品实拍-->
<div class="inLeft_title " id="miqsp">
<img border="0" src="../images/inLeft_title04.gif">
</div>
{$goods.goods_shipai}
这个是新增加的前台效果:
本文标签:
很赞哦! ()
图文教程
ecshop购物进入结算页面无法选择“ ”
问:我使用ecshop前台购物进入结算页面,无法选择“ ”?答:“ ”是跟你上一栏选择的“配送方式”相关的。
ecshop注册VIP推荐送现金的方法
ecshop中的促销售功能还不是很完善,随着电子商务系统的发展和进步,越来越多的促销需求需要ecshop做的更灵活,这就造成了很大必要的对ecshop促销系统进行处理和重新开发
ecshop商品列表页显示商品库存的实现方法
如何在ECSHOP商品列表页每个商品的下面显示库存数呢?1、打开category.php 文件;2、打开 themes/模板文件夹/library/goods_list.lbi 文件
ecshop文章页怎么增加显示文章浏览次数
在ecshop中,如何增加文章的浏览量,专业 也比较强,这个问题很多用户相当的关心,在此分享一下经验:
相关源码
-
(自适应)高端集团跨国公司产业联盟机构网站模板免费下载基于PbootCMS内核开发的集团级企业网站模板,采用响应式设计架构,确保在各类移动设备上获得浏览体验。通过模块化布局与简约大气的视觉风格,帮助集团企业高效展示组织架构、发展历程和业务矩阵,建立专业的企业形象窗口。查看源码 -
(自适应响应式)供应链进出口服务pbootcms企业网站源码为供应链管理、进出口服务类企业设计,特别适合展示物流网络、贸易服务和供应链解决方案。采用响应式技术,确保在各类设备上都能呈现企业服务内容。查看源码 -
(自适应)黑色摄影作品工作室pbootcms模板网站源码下载为风景摄影、个人工作室打造的高端网站模板,基于PbootCMS开源内核开发,采用HTML5自适应架构,PC与移动端实时数据同步,适配各类拍摄作品展示需求。查看源码 -
html5响应式pbootcms模板新闻资讯博客网站源码该模板采用PbootCMS内核开发,专为新闻资讯类网站打造,同时具备高度行业适配性--只需替换图文内容即可快速转型为企业官网、行业门户等各类站点。查看源码 -
(PC+WAP)企业管理工程造价资产评估财务审计带留言网站模板本模板基于PbootCMS内核开发,为工程造价咨询、财务审计类企业量身打造,同时支持多行业快速适配。采用PC+WAP双端同步设计,数据实时互通,助您高效展示企业形象与服务能力。查看源码 -
(自适应响应式)教育培训机构集团网站pbootcms源码下载本模板基于PbootCMS系统开发,为教育培训机构设计,特别适合展示课程体系、师资团队和教学成果。采用响应式技术,确保在各类设备上都能提供良好的浏览体验。查看源码
| 分享笔记 (共有 篇笔记) |