Skip to content

Instantly share code, notes, and snippets.

@uzaharova
Created December 11, 2017 08:55
Show Gist options
  • Save uzaharova/668fb23fa0901e9c69adae8e8386987b to your computer and use it in GitHub Desktop.
Save uzaharova/668fb23fa0901e9c69adae8e8386987b to your computer and use it in GitHub Desktop.
diff --git a/app/addons/buy_together/func.php b/app/addons/buy_together/func.php
index ca54c59..35f813c 100644
--- a/app/addons/buy_together/func.php
+++ b/app/addons/buy_together/func.php
@@ -1010,6 +1010,7 @@ function fn_buy_together_calculate_cart_items(&$cart, &$cart_products, &$auth)
$discounted_price = $discounted_price < 0 ? 0 : $discounted_price;
$cart_products[$k]['price'] = $cart_products[$k]['base_price'] = $discounted_price;
+ $cart['subtotal'] -= $chain['products'][$v['extra']['chain']['hash']]['discount'] * $cart_products[$k]['amount'];
}
$cart_products[$k]['price'] = ($cart_products[$k]['price'] < 0) ? 0 : $cart_products[$k]['price'];
$cart_products[$k]['base_price'] = ($cart_products[$k]['base_price'] < 0) ? 0 : $cart_products[$k]['base_price'];
@@ -1055,6 +1056,7 @@ function fn_buy_together_calculate_cart_items(&$cart, &$cart_products, &$auth)
$cart_products[$key]['original_price'] = $cart_products[$key]['price'];
$cart_products[$key]['subtotal'] = $cart_products[$key]['price'] * $cart_products[$key]['amount'];
+ $cart['subtotal'] -= $chain['discount'] * $cart_products[$key]['amount'];
if (Registry::get('runtime.mode') == 'place_order') {
$cart_products[$key]['discount'] = 0;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment