コード例 #1
0
ファイル: CAddCart.php プロジェクト: kingsj/zeuscart
 /**
  * This function is used to get cart snap sort
  *
  * 
  * 
  * @return array 
  */
 function cartSnapShot()
 {
     if ($_SESSION['user_id'] != '') {
         $userid = $_SESSION['user_id'];
         $query = new Bin_Query();
         $sql = "SELECT pt.title,pt.model,pt.product_id,pt.brand,pt.shipping_cost,pt.sku,pt.msrp,pt.image,pt.thumb_image , shopping_cart_products_table. * , shopping_cart_table. * FROM (products_table pt INNER JOIN shopping_cart_products_table ON pt.product_id = shopping_cart_products_table.product_id) LEFT JOIN shopping_cart_table ON shopping_cart_products_table.cart_id = shopping_cart_table.cart_id WHERE shopping_cart_table.user_id =" . $userid;
         if ($query->executeQuery($sql)) {
             $cnt = count($query->records);
             $a = Core_CAddCart::showCart();
             $output = Display_DAddCart::cartSnapShot($_SESSION['grandtotal'], $cnt);
         } else {
             $output = Display_DAddCart::cartSnapShotElse();
         }
     } else {
         $cnt = count($_SESSION['mycart']);
         if ($cnt > 0) {
             $output = Display_DAddCart::cartSnapShot($_SESSION['grandtotal'], $cnt);
         } else {
             $output = Display_DAddCart::cartSnapShotElse();
         }
     }
     return $output;
 }