Skip to content

Commit

Permalink
Zen Cart本体のバグ修正。
Browse files Browse the repository at this point in the history
オプションを設定した商品をカートに入れ、同一product_idの商品でオプションを変えた商品をカートに入れた場合、在庫数以上に注文ができてしまう件の修正。
および、同一オーダー内に同一product_idの商品が在った場合に、注文完了後の
「下記商品についてお知らせメールを希望する」に同じ商品が複数登場し「更新」を押すと
エラーになる件の修正。

Signed-off-by: kimono <maeda@obitastar.co.jp>
  • Loading branch information
kimono committed Jan 29, 2014
1 parent 582d4e9 commit f7a8a95
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@
$stock_check = array();
if (STOCK_CHECK == 'true') {
for ($i=0, $n=sizeof($order->products); $i<$n; $i++) {
if ($stock_check[$i] = zen_check_stock($order->products[$i]['id'], $order->products[$i]['qty'])) {
if ($stock_check[$i] = zen_check_stock($order->products[$i]['id'], $product_in_order[zen_get_prid($order->products[$i]['id'])])) {
$flagAnyOutOfStock = true;
}
}
Expand Down
9 changes: 6 additions & 3 deletions includes/modules/pages/checkout_success/header_php.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,12 @@
$products = $db->Execute($products_query);

while (!$products->EOF) {
$notificationsArray[] = array('counter'=>$counter,
'products_id'=>$products->fields['products_id'],
'products_name'=>$products->fields['products_name']);
if(!isset($notify_product[$products->fields['products_id']])){
$notificationsArray[] = array('counter'=>$counter,
'products_id'=>$products->fields['products_id'],
'products_name'=>$products->fields['products_name']);
}
$notify_product[$products->fields['products_id']]=true;
$counter++;
$products->MoveNext();
}
Expand Down
3 changes: 2 additions & 1 deletion includes/modules/pages/shopping_cart/header_php.php
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,8 @@
}
} //end foreach [attributes]
if (STOCK_CHECK == 'true') {
$flagStockCheck = zen_check_stock($products[$i]['id'], $products[$i]['quantity']);
$product_in_cart[zen_get_prid($products[$i]['id'])] += $products[$i]['quantity'];
$flagStockCheck = zen_check_stock($products[$i]['id'], $product_in_cart[zen_get_prid($products[$i]['id'])]);
if ($flagStockCheck == true) {
$flagAnyOutOfStock = true;
}
Expand Down

0 comments on commit f7a8a95

Please sign in to comment.