ver. 0.292: ShopProduct + ShopPaymentMethod + ShopPromotion + ShopStatuses + ShopTransport frontend migration to Domain
Full migration of front\factory\ — entire directory removed (all 20 classes migrated). ProductRepository +20 frontend methods, PromotionRepository +5 applyType methods, TransportRepository +4 cached methods, PaymentMethodRepository +cached frontend methods. Fix: broken transports_list() in ajax.php replaced with forPaymentMethod(). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -74,29 +74,31 @@ class Promotion
|
||||
$results = self::get_active_promotions();
|
||||
if ( is_array( $results ) and count( $results ) )
|
||||
{
|
||||
$promoRepo = new \Domain\Promotion\PromotionRepository( $mdb );
|
||||
|
||||
foreach ( $results as $row )
|
||||
{
|
||||
$promotion = new \shop\Promotion( $row );
|
||||
|
||||
// Promocja na cały koszyk
|
||||
if ( $promotion -> condition_type == 4 )
|
||||
return \front\factory\ShopPromotion::promotion_type_05( $basket_tmp, $promotion );
|
||||
return $promoRepo->applyTypeWholeBasket( $basket_tmp, $promotion );
|
||||
|
||||
// Najtańszy produkt w koszyku (z wybranych kategorii) za X zł
|
||||
if ( $promotion -> condition_type == 3 )
|
||||
return \front\factory\ShopPromotion::promotion_type_04( $basket_tmp, $promotion );
|
||||
return $promoRepo->applyTypeCheapestProduct( $basket_tmp, $promotion );
|
||||
|
||||
// Rabat procentowy na produkty z kategorii 1 lub kategorii 2
|
||||
if ( $promotion -> condition_type == 5 )
|
||||
return \front\factory\ShopPromotion::promotion_type_03( $basket_tmp, $promotion );
|
||||
return $promoRepo->applyTypeCategoriesOr( $basket_tmp, $promotion );
|
||||
|
||||
// Rabat procentowy na produkty z kategorii I i kategorii II
|
||||
if ( $promotion -> condition_type == 2 )
|
||||
return \front\factory\ShopPromotion::promotion_type_02( $basket_tmp, $promotion );
|
||||
return $promoRepo->applyTypeCategoriesAnd( $basket_tmp, $promotion );
|
||||
|
||||
// Rabat procentowy na produkty z kategorii I jeżeli w koszyku jest produkt z kategorii II
|
||||
if ( $promotion -> condition_type == 1 )
|
||||
return \front\factory\ShopPromotion::promotion_type_01( $basket_tmp, $promotion );
|
||||
return $promoRepo->applyTypeCategoryCondition( $basket_tmp, $promotion );
|
||||
}
|
||||
}
|
||||
return $basket;
|
||||
|
||||
Reference in New Issue
Block a user