【问题标题】:How can we get the product id of each item in shopping cart from the session variable? in zen cart我们如何从 session 变量中获取购物车中每个商品的产品 ID?在禅车
【发布时间】:2011-08-10 11:35:26
【问题描述】:

我们如何访问购物车的会话变量,以便我们可以获取每个产品的产品 ID?

【问题讨论】:

    标签: zen-cart


    【解决方案1】:
       $products = $_SESSION['cart']->get_products();
    
       for ($i=0, $n=sizeof($products); $i<$n; $i++) {
          // the product's id is $products[$i]['id']
          ...
       }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2017-04-27
      • 1970-01-01
      • 2015-06-01
      • 2018-06-03
      • 1970-01-01
      • 2021-05-16
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多