From c03f60ccdb4e1743ba5e2d8c316fb7fffefd19e4 Mon Sep 17 00:00:00 2001 From: Sergey Sysa Date: Wed, 4 Mar 2020 03:09:45 +1000 Subject: [PATCH] Update Cart.php MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Сумма скидки пользователя в корзине. --- api/Cart.php | 1 + 1 file changed, 1 insertion(+) diff --git a/api/Cart.php b/api/Cart.php index 7100ece..4f6736b 100755 --- a/api/Cart.php +++ b/api/Cart.php @@ -64,6 +64,7 @@ public function get_cart() $cart->discount = 0; if (isset($_SESSION['user_id']) && $user = $this->users->get_user(intval($_SESSION['user_id']))) { $cart->discount = $user->discount; + $cart->discount_total = ($cart->discount * $cart->total_price) / 100; } $cart->total_price *= (100-$cart->discount)/100;