codeigniter添加不同大小的相同产品

时间:2014-08-09 19:55:24

标签: codeigniter shopping-cart cart

会话购物车,如果产品尺寸不同,我需要再次添加相同的产品:

foreach($cart_content as $cart_item)                            
{
   if(($cart_item['id']==$_POST['product_id'])&&($cart_item['options']['size']==$_POST['optsize']))
   {
        $data = array(
             'rowid' => $cart_item['rowid'],
             'qty'   => ($cart_item['qty']+$_POST['quantity']),
             'options'   => ($_POST['optsize'])
        );
        $this->cart->update($data); 
        unset($cart_item['rowid']);
        $upd=1;
        break;
    }                                        
}

0 个答案:

没有答案