php实现仿写CodeIgniter的购物车类(2)

<?php session_start(); require_once('cart.php'); $items = array( 0 => array( 'id' => 'sp001', 'qty' => 20, 'price' => '10.50', 'name' => 'a002', 'options' => array( 'made' => 'china', 'company' => 'bgi' ) ), 1 => array( 'id' => 'sp002', 'qty' => 1, 'price' => '3.50', 'name' => 'b002' ) ); $arr = array( 'rowid' => '86dbb7cb58a667558b4bbb1f60330028', 'qty' => 21 ); $cart = new Cart(); $cart->insert($items); //var_dump($cart->contents()); $cart->update($arr); var_dump($cart->contents()); //$cart->destroy(); //var_dump($_SESSION['cart_contents']); /*end of php*/

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:http://www.heiqu.com/b67a484e9e530898e30ea897e8dc3c25.html