ver. 0.294: Remove all 12 legacy autoload/shop/ classes (~2363 lines)
Complete Domain-Driven Architecture migration: - Phase 1-4: Transport, ProductSet, Coupon, Shop, Search, Basket, ProductCustomField, Category, ProductAttribute, Promotion - Phase 5: Order (~562 lines) + Product (~952 lines) - ~20 Product methods migrated to ProductRepository - Apilo sync migrated to OrderAdminService - Production hotfixes: stale Redis cache (prices 0.00), unqualified Product:: refs in LayoutEngine, object->array template conversion - AttributeRepository::getAttributeValueById() Redis cache added Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
<?php
|
||||
namespace front;
|
||||
use shop\Product;
|
||||
|
||||
class LayoutEngine
|
||||
{
|
||||
@@ -194,7 +193,7 @@ class LayoutEngine
|
||||
//
|
||||
if ( \Shared\Helpers\Helpers::get( 'product' ) )
|
||||
{
|
||||
$product = Product::getFromCache( \Shared\Helpers\Helpers::get( 'product' ), $lang_id, $_GET['permutation_hash'] );
|
||||
$product = ( new \Domain\Product\ProductRepository( $GLOBALS['mdb'] ) )->findCached( \Shared\Helpers\Helpers::get( 'product' ), $lang_id, $_GET['permutation_hash'] );
|
||||
|
||||
if ( $product['language']['meta_title'] )
|
||||
$page['language']['title'] = $product['language']['meta_title'];
|
||||
@@ -243,7 +242,7 @@ class LayoutEngine
|
||||
$html = str_replace(
|
||||
'[PRODUKT:' . $single_product[1] . ']',
|
||||
\Shared\Tpl\Tpl::view( 'shop-product/product-mini', [
|
||||
'product' => \shop\Product::getFromCache( (int)$single_product[1], $lang_id )
|
||||
'product' => ( new \Domain\Product\ProductRepository( $GLOBALS['mdb'] ) )->findCached( (int)$single_product[1], $lang_id )
|
||||
] ),
|
||||
$html
|
||||
);
|
||||
@@ -259,7 +258,7 @@ class LayoutEngine
|
||||
$products_id = explode( ',', $products_box[1] );
|
||||
|
||||
foreach ( $products_id as $product_id )
|
||||
$products[] = Product::getFromCache( (int)$product_id, $lang_id );
|
||||
$products[] = ( new \Domain\Product\ProductRepository( $GLOBALS['mdb'] ) )->findCached( (int)$product_id, $lang_id );
|
||||
|
||||
|
||||
$html = str_replace(
|
||||
@@ -288,7 +287,7 @@ class LayoutEngine
|
||||
$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 );
|
||||
$top_products_arr[] = ( new \Domain\Product\ProductRepository( $GLOBALS['mdb'] ) )->findCached( (int)$product_id, $lang_id );
|
||||
}
|
||||
|
||||
$html = str_replace( $pattern,
|
||||
@@ -317,7 +316,7 @@ class LayoutEngine
|
||||
|
||||
|
||||
foreach ( $products_id_arr as $product_id ){
|
||||
$top_products_arr[] = Product::getFromCache( (int)$product_id, $lang_id );
|
||||
$top_products_arr[] = ( new \Domain\Product\ProductRepository( $GLOBALS['mdb'] ) )->findCached( (int)$product_id, $lang_id );
|
||||
}
|
||||
|
||||
$html = str_replace( $pattern,
|
||||
@@ -334,7 +333,7 @@ class LayoutEngine
|
||||
$html = str_replace( '[META_DESCRIPTION]', $page['language']['meta_description'], $html );
|
||||
$html = str_replace( '[JEZYKI]', \front\Views\Languages::render( ( new \Domain\Languages\LanguagesRepository( $GLOBALS['mdb'] ) )->activeLanguages() ), $html );
|
||||
$html = str_replace( '[TYTUL_STRONY]', self::title( $page['language']['title'], $page['show_title'], $page['language']['page_title'] ), $html );
|
||||
$html = str_replace( '[WYSZUKIWARKA]', \shop\Search::simple_form(), $html );
|
||||
$html = str_replace( '[WYSZUKIWARKA]', \front\Views\ShopSearch::simpleForm(), $html );
|
||||
|
||||
/* atrybut noindex */
|
||||
if ( \Shared\Helpers\Helpers::get( 'article' ) )
|
||||
|
||||
Reference in New Issue
Block a user