From b0f02676d64d184c328c1a18ee15a855aab8fb37 Mon Sep 17 00:00:00 2001 From: Jacek Pyziak Date: Wed, 14 May 2025 00:38:21 +0200 Subject: [PATCH] =?UTF-8?q?Zaktualizuj=20plik=20.vscode/ftp-kr.sync.cache.?= =?UTF-8?q?json,=20aby=20odzwierciedli=C4=87=20zmiany=20w=20czasie=20modyf?= =?UTF-8?q?ikacji=20pliku=20.htaccess.=20Dodaj=20now=C4=85=20logik=C4=99?= =?UTF-8?q?=20do=20klasy=20Gm=5FOmniPrice,=20aby=20sprawdzi=C4=87,=20czy?= =?UTF-8?q?=20produkt=20jest=20obj=C4=99ty=20zni=C5=BCk=C4=85,=20przed=20p?= =?UTF-8?q?rzypisaniem=20warto=C5=9Bci=20do=20szablonu.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .vscode/ftp-kr.sync.cache.json | 4 ++-- modules/gm_omniprice/gm_omniprice.php | 7 ++++++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/.vscode/ftp-kr.sync.cache.json b/.vscode/ftp-kr.sync.cache.json index 3c789d6c..efce8e2c 100644 --- a/.vscode/ftp-kr.sync.cache.json +++ b/.vscode/ftp-kr.sync.cache.json @@ -1083,8 +1083,8 @@ ".htaccess": { "type": "-", "size": 5737, - "lmtime": 1743169569305, - "modified": true + "lmtime": 1746726321526, + "modified": false }, ".htaccess.2025-01-27-1738009656": { "type": "-", diff --git a/modules/gm_omniprice/gm_omniprice.php b/modules/gm_omniprice/gm_omniprice.php index fa813335..cac7e2bb 100644 --- a/modules/gm_omniprice/gm_omniprice.php +++ b/modules/gm_omniprice/gm_omniprice.php @@ -1358,6 +1358,7 @@ class Gm_OmniPrice extends Module } $lowestCachedPrice = $this->getLowestCachedPrice($params); } + $realDiscount = ''; if ($showRealDiscount && $lowestCachedPrice && isset($hookParams['product']['price_amount'])) { @@ -1365,6 +1366,7 @@ class Gm_OmniPrice extends Module $previousPrice = $lowestCachedPrice['raw']; $realDiscount = $this->calculateRealDisount($currentPrice, $previousPrice); } + if (!$lowestCachedPrice) { //may have a promotion for an individual combination @@ -1376,7 +1378,10 @@ class Gm_OmniPrice extends Module ]; } } - if ($lowestCachedPrice) + + $checkIfProductIsDiscounted = self::checkIfProductIsDiscounted( $this->getDiscountedProductIds( $params['id_shop'], $params['id_currency'], $params['id_country'], $params['id_group'] ), $productId, $params['id_product_attribute'] ); + + if ( $lowestCachedPrice and $checkIfProductIsDiscounted ) { $this->context->smarty->assign( [