zoukankan      html  css  js  c++  java
  • Ecshop购物车或结算页面显示商品品牌

    如何在ECSHOP购物车或结算页面显示商品品牌?下面,我们以ecshop默认程序及模板为例做出下讲解:

     

    1、先打开 includes/lib_order.php 文件(建议使用editplus)
    找到 (大概是在873行)

    $arr[$key]['formated_subtotal'] = price_format($value['subtotal'], false);

     


    在它的下面增加以下代码

     

    $sql="select brand_name from ".$GLOBALS['ecs']->table('goods')." g left join " . $GLOBALS['ecs']->table("brand") . " b on g.brand_id=b.brand_id where goods_id='{$value['goods_id']}'";
    $goods_brand = $GLOBALS['db']->getOne($sql);
    $arr[$key]['goods_brand']=$goods_brand;

     


    2、下面这一步千万要认真,不能马虎,还是在includes/lib_order.php 文件中查找
    先找到 get_cart_goods() 函数部分,然后再找到此函数中的一行代码

     

    $goods_list[] = $row;

     

    (注:此行代码在includes/lib_order.php中出现了两次,千万别找错了)


    找到这行代码后,在它上面增加以下代码

     

    $sql="select brand_name from ".$GLOBALS['ecs']->table('goods')." g left join " . $GLOBALS['ecs']->table("brand") . " b on g.brand_id=b.brand_id where goods_id='{$row['goods_id']}'";
    $goods_brand = $GLOBALS['db']->getOne($sql);
    $row['goods_brand']=$goods_brand;


    3、修改ECSHOP模板文件 flow.dwt 文件
    找到

     

    <!-- {if $goods.is_shipping} -->(<span style="color:#FF0000">{$lang.free_goods}</span>)<!-- {/if} -->

     

    在他后面增加代码 {$goods.goods_brand}

    找到

     

    <a href="goods.php?id={$goods.goods_id}" target="_blank"><img src="{$goods.goods_thumb}" border="0" title="{$goods.goods_name|escape:html}" /></a><br />

     

    在它后面增加代码(品牌:{$goods.goods_brand})

    ------------------------------------------华丽丽的分割线--------------------- ------------------------------------

    源厂制造10-10000级洁净无尘车间防静电防尘用品!网址:http://www.lgfjd.com 微信号:614412
  • 相关阅读:
    怎么查看京东店铺的品牌ID
    PPT编辑的时候很卡,放映的时候不卡,咋回事?
    codevs 1702素数判定2
    codevs 2530大质数
    codevs 1488GangGang的烦恼
    codevs 2851 菜菜买气球
    hdu 5653 Bomber Man wants to bomb an Array
    poj 3661 Running
    poj 1651 Multiplication Puzzle
    hdu 2476 String Painter
  • 原文地址:https://www.cnblogs.com/wangblognet/p/2728010.html
Copyright © 2011-2022 走看看