轻源码

  • QingYuanMa.com
  • 全球最大的互联网技术和资源下载平台
搜索
一起源码网 门户 ECShop网店 查看主题

ECSHOP商品批发插件免费共享给大家

发布者: dideming | 发布时间: 2018-4-1 02:32| 查看数: 4882| 评论数: 1|帖子模式


代码:
1、打开goods.dwt加入

   
                 
货号规格销售价会员价订购数量库存
{$product.product_sn}

  
  
{$goods_attr}
|
         
{$goods.shop_price_formated}   
               {$rank_price.rank_name}: {$rank_price.price}
               
{$product.product_number}




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");

}






function product_list($goods_id, $conditions = '')
{
      
        $sql = "SELECT COUNT(*) FROM " .$GLOBALS['ecs']->table('products'). " AS p WHERE goods_id = $goods_id $where";
        $filter['record_count'] = $GLOBALS['db']->getOne($sql);
        $sql = "SELECT product_id, goods_id, goods_attr, product_sn, product_number
                FROM " . $GLOBALS['ecs']->table('products') . " AS g
                WHERE goods_id = $goods_id ";
    $row = $GLOBALS['db']->getAll($sql);
   
    $goods_attr = product_goods_attr_list($goods_id);
    foreach ($row as $key => $value)
    {
        $_goods_attr_array = explode('|', $value['goods_attr']);
        if (is_array($_goods_attr_array))
        {
            $_temp = '';
            foreach ($_goods_attr_array as $_goods_attr_value)
            {
                 $_temp[] = $goods_attr[$_goods_attr_value];
            }
            $row[$key]['goods_attr'] = $_temp;
        }
  $row[$key]['goods_attr_id'] = $_goods_attr_array;
    }
    return $row;
}

最新评论

mywlkj 发表于 2022-6-4 06:36
php连续签到打卡源码

轻源码让程序更轻更快

QingYuanMa.com

工作时间 周一至周六 8:00-17:30

侵权处理

客服QQ点击咨询

关注抖音号

定期抽VIP

Copyright © 2016-2021 https://www.171739.xyz/ 滇ICP备13200218号

快速回复 返回顶部 返回列表