Zaktualizuj plik .vscode/ftp-kr.sync.cache.json, aby odzwierciedlić zmiany w czasie modyfikacji pliku .htaccess. Dodaj nową logikę do klasy Gm_OmniPrice, aby sprawdzić, czy produkt jest objęty zniżką, przed przypisaniem wartości do szablonu.

This commit is contained in:
2025-05-14 00:38:21 +02:00
parent 1f796c1704
commit b0f02676d6
2 changed files with 8 additions and 3 deletions

View File

@@ -1083,8 +1083,8 @@
".htaccess": { ".htaccess": {
"type": "-", "type": "-",
"size": 5737, "size": 5737,
"lmtime": 1743169569305, "lmtime": 1746726321526,
"modified": true "modified": false
}, },
".htaccess.2025-01-27-1738009656": { ".htaccess.2025-01-27-1738009656": {
"type": "-", "type": "-",

View File

@@ -1358,6 +1358,7 @@ class Gm_OmniPrice extends Module
} }
$lowestCachedPrice = $this->getLowestCachedPrice($params); $lowestCachedPrice = $this->getLowestCachedPrice($params);
} }
$realDiscount = ''; $realDiscount = '';
if ($showRealDiscount && $lowestCachedPrice && isset($hookParams['product']['price_amount'])) if ($showRealDiscount && $lowestCachedPrice && isset($hookParams['product']['price_amount']))
{ {
@@ -1365,6 +1366,7 @@ class Gm_OmniPrice extends Module
$previousPrice = $lowestCachedPrice['raw']; $previousPrice = $lowestCachedPrice['raw'];
$realDiscount = $this->calculateRealDisount($currentPrice, $previousPrice); $realDiscount = $this->calculateRealDisount($currentPrice, $previousPrice);
} }
if (!$lowestCachedPrice) if (!$lowestCachedPrice)
{ {
//may have a promotion for an individual combination //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( $this->context->smarty->assign(
[ [