Refactor code structure for improved readability and maintainability
This commit is contained in:
@@ -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
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user