From 2e46596837daf40a75945e30871668d783273237 Mon Sep 17 00:00:00 2001 From: Konstantin Shevsky Date: Thu, 27 Sep 2018 18:50:16 +0500 Subject: [PATCH] Update shopAffiliate.class.php MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Исправлен баг, из-за которого неправильно рассчитывались бонусы при использовании пользователем во фронтенде другой валюты. --- lib/classes/shopAffiliate.class.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/classes/shopAffiliate.class.php b/lib/classes/shopAffiliate.class.php index e4b08c2c9..09828af97 100644 --- a/lib/classes/shopAffiliate.class.php +++ b/lib/classes/shopAffiliate.class.php @@ -73,7 +73,8 @@ public static function calculateBonus($order_or_id, $credit_rate = null) $curm = new shopCurrencyModel(); $order_currency = isset($order['currency']) ? $order['currency'] : null; $def_cur = wa('shop')->getConfig()->getCurrency(true); - $affiliatable_total = $curm->convert(ifset($order['total'], 0) - ifset($order['shipping'], 0), ifempty($order_currency, $def_cur), $def_cur); + $storefront_cur = wa('shop')->getConfig()->getCurrency(false); + $affiliatable_total = $curm->convert(ifset($order['total'], 0) - ifset($order['shipping'], 0), ifempty($order_currency, $storefront_cur), $def_cur); $product_types = wa()->getSetting('affiliate_product_types', '', 'shop'); if (!empty($product_types)) {