Fix for MPC discounted, bad if statement

This commit is contained in:
Mihael Magdić
2026-03-04 14:43:34 +01:00
parent 3c1d969711
commit b77d26da0f
3 changed files with 6 additions and 3 deletions

3
.gitignore vendored
View File

@@ -1,2 +1,3 @@
llmdumper.php llmdumper.php
.llmdump .llmdump
.DS_Store

View File

@@ -396,6 +396,8 @@ class B2BPayments extends PaymentModule implements PrestaShop\PrestaShop\Core\Mo
$id_product = (int)$embeddedProductAttributes['id_product']; $id_product = (int)$embeddedProductAttributes['id_product'];
$prices = $this->calculateMPC($id_product, $id_product_attribute); $prices = $this->calculateMPC($id_product, $id_product_attribute);
$this->smarty->assign([ $this->smarty->assign([
'mpc_old_float' => $prices['old_price'],
'mpc_new_float' => $prices['new_price'],
'mpc_old' => $this->context->getCurrentLocale()->formatPrice($prices['old_price'], $this->context->currency->iso_code), 'mpc_old' => $this->context->getCurrentLocale()->formatPrice($prices['old_price'], $this->context->currency->iso_code),
'mpc_new' => $this->context->getCurrentLocale()->formatPrice($prices['new_price'], $this->context->currency->iso_code) 'mpc_new' => $this->context->getCurrentLocale()->formatPrice($prices['new_price'], $this->context->currency->iso_code)
]); ]);

View File

@@ -1,8 +1,8 @@
{if isset($mpc_new) && $mpc_new > 0} {if isset($mpc_new_float) && $mpc_new_float > 0}
<div class="b2c-price-block mpcrender"> <div class="b2c-price-block mpcrender">
<span class="b2c-price-label">MPC:</span> <span class="b2c-price-label">MPC:</span>
{if isset($mpc_old) && $mpc_old > $mpc_new} {if isset($mpc_old_float) && $mpc_old_float > $mpc_new_float}
<span class="price price--regular">{$mpc_old}</span> <span class="price price--regular">{$mpc_old}</span>
{/if} {/if}