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 6181ef958d
commit d14018a5f3
48 changed files with 1780 additions and 975 deletions

View File

@@ -1,12 +0,0 @@
<?php
namespace front\view;
class ShopPaymentMethod
{
public static function basket_payment_methods( $payment_methods, $payment_id )
{
$tpl = new \Shared\Tpl\Tpl;
$tpl -> payment_methods = $payment_methods;
$tpl -> payment_id = $payment_id;
return $tpl -> render( 'shop-basket/basket-payments-methods' );
}
}

View File

@@ -1,6 +0,0 @@
<?php
namespace front\view;
class ShopTransport
{
}

View File

@@ -82,7 +82,7 @@ class Site
$html = str_replace( $pattern,
\Shared\Tpl\Tpl::view( 'shop-product/promoted-products', [
'products' => \front\factory\ShopProduct::promoted_products( $limit )
'products' => ( new \Domain\Product\ProductRepository( $GLOBALS['mdb'] ) )->promotedProductIdsCached( $limit )
] ),
$html
);
@@ -285,7 +285,7 @@ class Site
$products_top[1] ? $pattern = '[PRODUKTY_TOP:' . $products_top[1] . ']' : $pattern = '[PRODUKTY_TOP]';
$products_id_arr = \front\factory\ShopProduct::top_products( $limit );
$products_id_arr = ( new \Domain\Product\ProductRepository( $GLOBALS['mdb'] ) )->topProductIds( $limit );
foreach ( $products_id_arr as $product_id ){
$top_products_arr[] = Product::getFromCache( (int)$product_id, $lang_id );
@@ -313,7 +313,7 @@ class Site
$products_top[1] ? $pattern = '[PRODUKTY_NEW:' . $products_top[1] . ']' : $pattern = '[PRODUKTY_NEW]';
$products_id_arr = \front\factory\ShopProduct::new_products( $limit );
$products_id_arr = ( new \Domain\Product\ProductRepository( $GLOBALS['mdb'] ) )->newProductIds( $limit );
foreach ( $products_id_arr as $product_id ){