Refactor code structure for improved readability and maintainability

This commit is contained in:
2026-02-21 21:48:03 +01:00
parent ebab220f7e
commit 5eee2c6649
21 changed files with 172 additions and 150 deletions

View File

@@ -577,7 +577,7 @@ class OrderAdminService
return false;
}
$email = new \Email(0);
$email = new \Shared\Email\Email();
$email->load_by_name('#sklep-zmiana-statusu-zamowienia');
$email->text = str_replace('[NUMER_ZAMOWIENIA]', $number, $email->text);
@@ -800,4 +800,4 @@ class OrderAdminService
FILE_APPEND
);
}
}
}

View File

@@ -741,10 +741,11 @@ class OrderRepository
$product_price_tmp = \Domain\Basket\BasketCalculator::calculateBasketProductPrice((float)$product['price_brutto_promo'], (float)$product['price_brutto'], $coupon, $basket_position, $productRepo);
// Cena promo = 0 gdy taka sama jak cena bazowa (brak realnej promocji/kuponu)
$effectivePromoPrice = (float)$product_price_tmp['price_new'];
$effectiveBasePrice = (float)$product_price_tmp['price'];
$promoPrice = ($effectivePromoPrice != $effectiveBasePrice) ? $effectivePromoPrice : 0;
// Cena promo = 0 gdy taka sama jak cena bazowa (brak realnej promocji/kuponu).
// Porównujemy po zaokrągleniu do 2 miejsc, żeby uniknąć artefaktów float (IEEE 754).
$effectivePromoPrice = round((float)$product_price_tmp['price_new'], 2);
$effectiveBasePrice = round((float)$product_price_tmp['price'], 2);
$promoPrice = ($effectivePromoPrice > 0 && $effectivePromoPrice < $effectiveBasePrice) ? $effectivePromoPrice : 0;
$this->db->insert('pp_shop_order_products', [
'order_id' => $order_id,