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:
2026-02-17 21:55:16 +01:00
parent 827b903e1e
commit 89d9e61bec
48 changed files with 1780 additions and 975 deletions

View File

@@ -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;