您现在的位置是:首页 > cms教程 > Ecshop商城教程Ecshop商城教程

ecshop商品批发批量购买插件开发步骤教程

邢编2023-12-08Ecshop商城教程已有人查阅

导读1、打开goods.dwt加入;2、打开goods.php 加入;3、打开flow.php加入

1、打开goods.dwt加入
<form action="flow.php" method="post" name="ECS_ALL_addcart" >
<table width=" " border="0" cellpadding="0" cellspacing="2" bgcolor="#FFFFFF">
<tr bgcolor="#5e554e" style="color:#FFFFFF;">
<td align="center" width="150">货号</td>
<td align="center" width="150">规格</td>
<td align="center" width="80">销售价</td>
<td align="center" width="140">会员价</td>
<td align="center">订购数量</td>
<td align="center">库存</td>
</tr>
<!-- {foreach from=$product_list item=product} -->
<tr bgcolor="#f7f7f7">
<td align="center" >{$product.product_sn}<input name="product_sn[{$product.product_id}]" id="number" value="{$product.product_sn}" type="hidden"/></td>
<td align="center" >
<!--{foreach from=$product.goods_attr_id item=goods_attr_id}-->
<input name="goods_attr[{$product.product_id}][]"type="hidden"value="{$goods_attr_id}"/>
<!-- {/foreach}-->
 <!--{foreach from=$product.goods_attr item=goods_attr name=pro }--> {$goods_attr}
 <!--{if $smarty.foreach.pro.iteration ne $smarty.foreach.pro.total}--> | <!--{/if}-->
<!-- {/foreach}--></td>
<td align="center" >{$goods.shop_price_formated}</td>
<td align="center" > <!-- 会员等级对应的价格{foreach from=$rank_prices item=rank_price key=key} -->
{$rank_price.rank_name}: <span class="goodsPrice" id="ECS_RANKPRICE_{$key}">{$rank_price.price}</span>
<!-- {/foreach} --></td>
<td align="center" ><input name="number[{$product.product_id}]" id="number" value="1" type="text" size="3" /></td>
<td align="center" >{$product.product_number}</td>
</tr>
<!-- {/foreach}-->
<tr>
<td colspan="6" align="right"><input type="image" name="submit" src="images/add_cart.gif"></td>
</tr>
</table>
<input name="goods_id"value="{$goods.goods_id}" type="hidden"/>
<input name="step"value="all_addcart" type="hidden" />
</form>
2、打开goods.php 加入
$smarty->assign('product_list',product_list($goods_id, ''));
3、打开flow.php加入
//-- 添加商品到购物车(代码号修改)
/*------------------------------------------------------ */
if($_REQUEST['step'] =='all_addcart')
{
$goods_id = $_POST["goods_id"];
//获得批发相关值
foreach($_POST['number'] as $idx=>$value)
{
$number = $value;
$number_all= $value+$number_all;
$goods_attr_id = join(",",$_POST['goods_attr'][$idx]);
$product_sn = $_POST['product_sn'][$idx];
addto_cart($goods_id,$number,$_POST['goods_attr'][$idx],'',$content);
$arr[$idx] = array('number'=>$number,'goods_attr'=>$goods_attr_id,'product_sn'=>$product_sn);
// $sql = $GLOBALS['db']->query("insert into ".$GLOBALS['ecs']->table('cart_p')." (goods_id,product_id,number,goods_attr,product_sn,session_id) values('$goods_id','$idx','$number','$goods_attr_id','$product_sn','".SESS_ID."')");
}
//商品id
// $content = serialize($arr);
//$number = $number_all;
ecs_header("Location:./flow.php\n");
}

本文标签:

很赞哦! ()

相关源码

  • WordPress个人博客主题 - wp-Concise-v1.0免费下载wp-Concise-v1.0是一款专为个人博客设计的简约风格主题,采用全宽排版设计理念,注重内容呈现效果。该模板适用于个人随笔、技术分享、生活记录等博客场景,帮助用户打造专业的内容展示空间。查看源码
  • 帝国cms7.5品牌连锁店招商加盟商机网站模版源码本模板为招商加盟、创业投资、品牌连锁等商业领域设计,采用帝国CMS7.5内核构建,整体风格简洁大气,突出商业信任感与专业度,适合各类招商加盟项目展示、品牌连锁店宣传等商业应用场景。查看源码
  • pbootcms源码宠物类网站源码下载(自适应多端)为宠物装备商店、宠物食品及用品企业打造的营销型模板,基于PbootCMS内核深度开发。采用响应式设计实现PC与移动端适配,PHP7.0+高性能架构支持MySQL/SQLite双数据库查看源码
  • (自适应)光伏测试仪器电站运维设备网站源码免费下载本模板为光伏检测设备与电站运维服务企业设计,采用PbootCMS内核开发,具备完整的设备展示、技术文档管理及客户服务功能模块。通过自适应结构与SEO优化框架,有效提升企业在移动端和搜索引擎中的专业形象。查看源码
  • (PC+WAP)蓝色五金机械设备营销型网站源码下载基于PbootCMS内核开发的营销型企业网站模板,为五金机械设备类企业打造,通过标准化数字展示提升客户转化率。模板采用模块化设计,可快速适配机床工具、建筑五金、阀门管件等细分领域。查看源码
  • (自适应响应式)HTML5幕墙装饰工程建筑装修公司pbootcms模板下载基于PbootCMS开发的响应式模板,为幕墙工程、建筑装饰企业设计,通过数字化展示提升企业专业形象与项目展示能力。结构化数据标记增强项目案例收录,智能URL路由优化,支持每个工程案例独立设置关键词与描述查看源码
分享笔记 (共有 篇笔记)
验证码:

本栏推荐