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:
2026-02-18 02:05:39 +01:00
parent 22530df501
commit 69e78ca248
74 changed files with 2176 additions and 2669 deletions

View File

@@ -10,7 +10,7 @@ if ( $attribute_details['type'] == 0 )
<? foreach ( $this -> attribute['values'] as $value ):?>
<div class="fradio">
<input type="radio" id="<?= $this -> attribute['id'];?>-<?= $value['id'];?>" <? if ( $value['is_default'] ):?>checked="checked"<? endif;?> require="true" value="<?= $this -> attribute['id'];?>-<?= $value['id'];?>" name="<?= \Shared\Helpers\Helpers::seo( $attribute_details['language']['name'] );?>">
<label for="<?= $this -> attribute['id'];?>-<?= $value['id'];?>" order="<?= $this -> order;?>"><?= \shop\ProductAttribute::get_value_name( $value['id'], $lang_id );?></label>
<label for="<?= $this -> attribute['id'];?>-<?= $value['id'];?>" order="<?= $this -> order;?>"><?= ( new \Domain\Attribute\AttributeRepository( $GLOBALS['mdb'] ) )->getAttributeValueById( $value['id'], $lang_id );?></label>
</div>
<? if ( $value['is_default'] ):?>
<script class="footer" type="text/javascript">

View File

@@ -1,6 +1,5 @@
<?php
use shop\Product;
$product_meta = Product::product_meta($this->product_id);
$product_meta = ( new \Domain\Product\ProductRepository( $GLOBALS['mdb'] ) )->productMeta( $this->product_id );
?>
<?php if (is_array($product_meta) && count($product_meta)): ?>

View File

@@ -5,15 +5,15 @@
{
if ( $this -> product['quantity'] > 0 or $this -> product['quantity'] == 0 and $this -> product['stock_0_buy'] )
{
if ( $this -> product -> language['warehouse_message_nonzero'] )
echo $this -> product -> language['warehouse_message_nonzero'];
if ( $this -> product['language']['warehouse_message_nonzero'] )
echo $this -> product['language']['warehouse_message_nonzero'];
else if ( $this -> settings['warehouse_message_nonzero_' . $this -> lang_id] )
echo $this -> settings['warehouse_message_nonzero_' . $this -> lang_id];
}
else
{
if ( $this -> product -> language['warehouse_message_zero'] )
echo $this -> product -> language['warehouse_message_zero'];
if ( $this -> product['language']['warehouse_message_zero'] )
echo $this -> product['language']['warehouse_message_zero'];
else if ( $this -> settings['warehouse_message_zero_' . $this -> lang_id] )
echo $this -> settings['warehouse_message_zero_' . $this -> lang_id];
}

View File

@@ -1,25 +1,25 @@
<? global $lang_id;?>
<?
$this -> product -> language['seo_link'] ? $url = '/' . $this -> product -> language['seo_link'] : $url = '/p-' . $this -> product['id'] . '-' . \Shared\Helpers\Helpers::seo( $this -> product -> language['name'] );
$this -> product['language']['seo_link'] ? $url = '/' . $this -> product['language']['seo_link'] : $url = '/p-' . $this -> product['id'] . '-' . \Shared\Helpers\Helpers::seo( $this -> product['language']['name'] );
if ( \Shared\Helpers\Helpers::get_session( 'current-lang' ) != ( new \Domain\Languages\LanguagesRepository( $GLOBALS['mdb'] ) )->defaultLanguage() and $url != '#' )
$url = '/' . \Shared\Helpers\Helpers::get_session( 'current-lang' ) . $url;
?>
<div class="product-mini <?= $this -> product_mini_class;?>">
<? if ( $this -> product -> new_to_date and $this -> product -> new_to_date >= date( 'Y-m-d' ) ):?>
<? if ( $this -> product['new_to_date'] and $this -> product['new_to_date'] >= date( 'Y-m-d' ) ):?>
<div class="new"><?= \Shared\Helpers\Helpers::lang( 'nowosc' );?></div>
<? endif;?>
<a href="<?= $url;?>">
<div class="img">
<? if ( file_exists( substr( $this -> product -> images[0]['src'], 1 ) ) ):?>
<? if ( file_exists( substr( $this -> product['images'][0]['src'], 1 ) ) ):?>
<? if ( $this -> class == 'item' ):?>
<img class="<?= $this -> product_mini_class == 'swiper-slide' ? '' : 'owl-lazy';?>" src="/thumb/500/0/<?= substr( $this -> product -> images[0]['src'], 1, strlen( $this -> product -> images[0]['src'] ) );?>" alt="<?= $this -> product -> images[0]['alt'];?>">
<img class="<?= $this -> product_mini_class == 'swiper-slide' ? '' : 'owl-lazy';?>" src="/thumb/500/0/<?= substr( $this -> product['images'][0]['src'], 1, strlen( $this -> product['images'][0]['src'] ) );?>" alt="<?= $this -> product['images'][0]['alt'];?>">
<? else:?>
<img class="first" src="/thumb/500/0/<?= substr( $this -> product -> images[0]['src'], 1, strlen( $this -> product -> images[0]['src'] ) );?>" alt="<?= $this -> product -> images[0]['alt'];?>">
<? if ( file_exists( substr( $this -> product -> images[1]['src'], 1 ) ) ):?>
<img class="second" src="/thumb/1000/0/<?= substr( $this -> product -> images[1]['src'], 1, strlen( $this -> product -> images[1]['src'] ) );?>" alt="<?= $this -> product -> images[1]['alt'];?>">
<img class="first" src="/thumb/500/0/<?= substr( $this -> product['images'][0]['src'], 1, strlen( $this -> product['images'][0]['src'] ) );?>" alt="<?= $this -> product['images'][0]['alt'];?>">
<? if ( file_exists( substr( $this -> product['images'][1]['src'], 1 ) ) ):?>
<img class="second" src="/thumb/1000/0/<?= substr( $this -> product['images'][1]['src'], 1, strlen( $this -> product['images'][1]['src'] ) );?>" alt="<?= $this -> product['images'][1]['alt'];?>">
<? else:?>
<img class="second" src="/thumb/1000/0/<?= substr( $this -> product -> images[0]['src'], 1, strlen( $this -> product -> images[0]['src'] ) );?>" alt="<?= $this -> product -> images[0]['alt'];?>">
<img class="second" src="/thumb/1000/0/<?= substr( $this -> product['images'][0]['src'], 1, strlen( $this -> product['images'][0]['src'] ) );?>" alt="<?= $this -> product['images'][0]['alt'];?>">
<? endif;?>
<? endif;?>
<? else:?>
@@ -28,38 +28,38 @@
</div>
<div class="product-details">
<h2 class="name">
<?= $this -> product -> language['name'];?>
<?= $this -> product['language']['name'];?>
</h2>
<div class="prices">
<?
$prices = $this -> product -> getDefaultCombinationPrices();
$prices = ( new \Domain\Product\ProductRepository( $GLOBALS['mdb'] ) )->getDefaultCombinationPrices( $this -> product );
if ( $prices )
{
if ( $prices['price_brutto_promo'] ):?>
<div class="price-old">
<?= \shop\Shop::shortPrice( $prices['price_brutto'] );?> <span class="small">zł</span>
<?= \Shared\Helpers\Helpers::shortPrice( $prices['price_brutto'] );?> <span class="small">zł</span>
</div>
<div class="price">
<?= \shop\Shop::shortPrice( $prices['price_brutto_promo'] );?> <span class="small">zł</span>
<?= \Shared\Helpers\Helpers::shortPrice( $prices['price_brutto_promo'] );?> <span class="small">zł</span>
</div>
<? else:?>
<div class="price">
<?= \shop\Shop::shortPrice( $prices['price_brutto'] );?> <span class="small">zł</span>
<?= \Shared\Helpers\Helpers::shortPrice( $prices['price_brutto'] );?> <span class="small">zł</span>
</div>
<? endif;
}
else
{
if ( $this -> product -> price_brutto_promo ):?>
if ( $this -> product['price_brutto_promo'] ):?>
<div class="price-old">
<?= \shop\Shop::shortPrice( $this -> product -> price_brutto );?> <span class="small">zł</span>
<?= \Shared\Helpers\Helpers::shortPrice( $this -> product['price_brutto'] );?> <span class="small">zł</span>
</div>
<div class="price">
<?= \shop\Shop::shortPrice( $this -> product -> price_brutto_promo );?> <span class="small">zł</span>
<?= \Shared\Helpers\Helpers::shortPrice( $this -> product['price_brutto_promo'] );?> <span class="small">zł</span>
</div>
<? else:?>
<div class="price">
<?= \shop\Shop::shortPrice( $this -> product -> price_brutto );?> <span class="small">zł</span>
<?= \Shared\Helpers\Helpers::shortPrice( $this -> product['price_brutto'] );?> <span class="small">zł</span>
</div>
<? endif;
};?>

View File

@@ -1,6 +1,6 @@
<? global $lang_id, $mdb;?>
<?
$attributes = \shop\Product::get_product_attributes( $this -> product['product_combinations'] );
$attributes = (new \Domain\Product\ProductRepository($GLOBALS['mdb']))->getProductAttributes( $this -> product['product_combinations'] );
$dictionariesRepository = new \Domain\Dictionaries\DictionariesRepository( $mdb );
?>
<script class="footer" type="text/javascript">
@@ -19,21 +19,21 @@
<div class="row">
<div class="col-12 col-md-6">
<div id="image-big">
<? if ( $this -> product -> new_to_date and $this -> product -> new_to_date >= date( 'Y-m-d' ) ):?>
<? if ( $this -> product['new_to_date'] and $this -> product['new_to_date'] >= date( 'Y-m-d' ) ):?>
<div class="new"><?= \Shared\Helpers\Helpers::lang( 'nowosc' );?></div>
<? endif;?>
<? if ( file_exists( substr( $this -> product -> images[0]['src'], 1 ) ) ):?>
<? if ( file_exists( substr( $this -> product['images'][0]['src'], 1 ) ) ):?>
<a image-id="0">
<img src="/thumb/625/0<?= $this -> product -> images[0]['src'];?>" alt="">
<img src="/thumb/625/0<?= $this -> product['images'][0]['src'];?>" alt="">
</a>
<? else:?>
<? endif;?>
</div>
<div class="gallery">
<? for ( $i = 0; $i < count( $this -> product -> images ); $i++ ): if ( file_exists( substr( $this -> product -> images[$i]['src'], 1 ) ) ):?>
<a href="<?= $this -> product -> images[$i]['src'];?>" class="item" data-fancybox="product" id="image-<?= $i;?>" i="<?= $i;?>">
<img src="/thumb/180/0<?= $this -> product -> images[$i]['src'];?>" src="" alt="<?= $this -> product -> images[$i]['alt'];?>">
<? for ( $i = 0; $i < count( $this -> product['images'] ); $i++ ): if ( file_exists( substr( $this -> product['images'][$i]['src'], 1 ) ) ):?>
<a href="<?= $this -> product['images'][$i]['src'];?>" class="item" data-fancybox="product" id="image-<?= $i;?>" i="<?= $i;?>">
<img src="/thumb/180/0<?= $this -> product['images'][$i]['src'];?>" src="" alt="<?= $this -> product['images'][$i]['alt'];?>">
</a>
<? endif; endfor;?>
</div>
@@ -45,36 +45,36 @@
'lang_id' => $this -> lang_id,
'settings' => $this -> settings
] );?>
<h1><?= $this -> product -> language['name'];?></h1>
<h1><?= $this -> product['language']['name'];?></h1>
<div class="prices">
<? if ( $this -> product -> price_brutto_promo ):?>
<? if ( $this -> product['price_brutto_promo'] ):?>
<div class="price">
<?= \shop\Shop::shortPrice( $this -> product -> price_brutto_promo );?> <span class="small">zł</span>
<?= \Shared\Helpers\Helpers::shortPrice( $this -> product['price_brutto_promo'] );?> <span class="small">zł</span>
</div>
<div class="price-old">
<?= \shop\Shop::shortPrice( $this -> product -> price_brutto );?> <span class="small">zł</span>
<?= \Shared\Helpers\Helpers::shortPrice( $this -> product['price_brutto'] );?> <span class="small">zł</span>
</div>
<div class="price-minimal">
Najniższa cena w ciągu ostatnich 30 dni: <strong><?= \shop\Shop::shortPrice( ( new \Domain\Product\ProductRepository( $GLOBALS['mdb'] ) )->getMinimalPriceCached( (int)$this -> product['id'], $this -> product -> price_brutto_promo ) );?> zł</strong>
Najniższa cena w ciągu ostatnich 30 dni: <strong><?= \Shared\Helpers\Helpers::shortPrice( ( new \Domain\Product\ProductRepository( $GLOBALS['mdb'] ) )->getMinimalPriceCached( (int)$this -> product['id'], $this -> product['price_brutto_promo'] ) );?> zł</strong>
</div>
<? if ( $this -> product -> weight > 0 && $this -> product -> product_unit_id ):?>
<? if ( $this -> product['weight'] > 0 && $this -> product['product_unit_id'] ):?>
<div class="price_weight">
<?= \shop\Shop::shortPrice( $this -> product -> price_brutto_promo / $this -> product -> wegiht * 1 );?> <?= $this -> product -> product_unit;?>
<?= \Shared\Helpers\Helpers::shortPrice( $this -> product['price_brutto_promo'] / $this -> product['wegiht'] * 1 );?> <?= $this -> product['product_unit'];?>
</div>
<? endif;?>
<? else:?>
<div class="price">
<?= \shop\Shop::shortPrice( $this -> product -> price_brutto );?> <span class="small">zł</span>
<?= \Shared\Helpers\Helpers::shortPrice( $this -> product['price_brutto'] );?> <span class="small">zł</span>
</div>
<? if ( $this -> product -> weight > 0 && $this -> product -> product_unit_id ):?>
<? if ( $this -> product['weight'] > 0 && $this -> product['product_unit_id'] ):?>
<div class="price_weight">
<?= \shop\Shop::shortPrice( $this -> product -> price_brutto / $this -> product -> weight );?> <span class="small">zł</span> / <?= $dictionariesRepository -> getUnitNameById( (int)$this -> product -> product_unit_id, $this -> lang_id );?>
<?= \Shared\Helpers\Helpers::shortPrice( $this -> product['price_brutto'] / $this -> product['weight'] );?> <span class="small">zł</span> / <?= $dictionariesRepository -> getUnitNameById( (int)$this -> product['product_unit_id'], $this -> lang_id );?>
</div>
<? endif;?>
<? endif;?>
</div>
<form class="product-options" id="product-<?= $this -> product['id'];?>">
<input type="hidden" name="product-id" value="<?= $this -> product -> id;?>">
<input type="hidden" name="product-id" value="<?= $this -> product['id'];?>">
<? if ( \Shared\Helpers\Helpers::is_array_fix( $attributes ) ):?>
<div id="attributes">
<div class="title">Opcje produktu</div>
@@ -114,8 +114,8 @@
<script class="footer" type="text/javascript">
$(function ()
{
$('#product-<?= $this -> product -> id;?> .add-to-basket .quantity-container, #product-<?= $this -> product -> id;?> .add-to-basket #add-to-basket').addClass('hidden');
$('#product-<?= $this -> product -> id;?> .add-to-basket .alert').removeClass('hidden');
$('#product-<?= $this -> product['id'];?> .add-to-basket .quantity-container, #product-<?= $this -> product['id'];?> .add-to-basket #add-to-basket').addClass('hidden');
$('#product-<?= $this -> product['id'];?> .add-to-basket .alert').removeClass('hidden');
});
</script>
<? endif;?>
@@ -132,7 +132,7 @@
]);?>
<div class="short-description">
<?= $this -> product -> language['short_description'];?>
<?= $this -> product['language']['short_description'];?>
</div>
</div>
</div>
@@ -142,20 +142,20 @@
<div class="col-12 col-lg-8">
<ul class="tabs" id="tabs-menu">
<li class="tab-link current" id="tab-link-0" tab="0"><?= ucfirst( \Shared\Helpers\Helpers::lang( 'opis' ) );?></li>
<? if ( $this -> product -> language['tab_name_1'] ):?>
<li class="tab-link" id="tab-link-1" tab="1"><?= $this -> product -> language['tab_name_1'];?></li>
<? if ( $this -> product['language']['tab_name_1'] ):?>
<li class="tab-link" id="tab-link-1" tab="1"><?= $this -> product['language']['tab_name_1'];?></li>
<? endif;?>
<li class="tab-link" id="tab-link-2" tab="2"><?= ucfirst( \Shared\Helpers\Helpers::lang( 'opinie' ) );?></li>
<li class="tab-link" id="tab-link-3" tab="3">Bezpieczeństwo</li>
</ul>
<div id="tab-0" class="tab-content">
<div class="tab-title"><?= \Shared\Helpers\Helpers::lang( 'opis-produktu' );?></div>
<?= $this -> product -> language['description'];?>
<?= $this -> product['language']['description'];?>
</div>
<? if ( $this -> product -> language['tab_description_1'] ):?>
<? if ( $this -> product['language']['tab_description_1'] ):?>
<div id="tab-1" class="tab-content">
<div class="tab-title"><?= $this -> product -> language['tab_name_1'];?></div>
<?= $this -> product -> language['tab_description_1'];?>
<div class="tab-title"><?= $this -> product['language']['tab_name_1'];?></div>
<?= $this -> product['language']['tab_description_1'];?>
</div>
<? endif;?>
<div id="tab-2" class="tab-content reviews">
@@ -202,11 +202,11 @@
</div>
</div>
<div class="col-12 col-lg-4">
<? if ( $this -> product -> language['tab_name_2'] ):?>
<? if ( $this -> product['language']['tab_name_2'] ):?>
<div class="description-right">
<div class="title"><?= $this -> product -> language['tab_name_2'];?></div>
<div class="title"><?= $this -> product['language']['tab_name_2'];?></div>
<div class="content">
<?= $this -> product -> language['tab_description_2'];?>
<?= $this -> product['language']['tab_description_2'];?>
</div>
</div>
<? endif;?>
@@ -221,8 +221,8 @@
<div class="owl-carousel owl-theme">
<?
foreach ( $this -> product['products_sets'] as $product_sets_id ):
$product = \shop\Product::getFromCache( $product_sets_id, $lang_id );
if ( $product and $product -> status ):
$product = (new \Domain\Product\ProductRepository($GLOBALS['mdb']))->findCached( $product_sets_id, $lang_id );
if ( $product and $product['status'] ):
echo \Shared\Tpl\Tpl::view( 'shop-product/product-mini', [
'product' => $product,
'class' => 'item'
@@ -243,8 +243,8 @@
<div class="owl-carousel owl-theme">
<?
foreach ( $this -> product['products_related'] as $product_related_id ):
$product = \shop\Product::getFromCache( $product_related_id, $lang_id );
if ( $product and $product -> status ):
$product = (new \Domain\Product\ProductRepository($GLOBALS['mdb']))->findCached( $product_related_id, $lang_id );
if ( $product and $product['status'] ):
echo \Shared\Tpl\Tpl::view( 'shop-product/product-mini', [
'product' => $product,
'class' => 'item'
@@ -275,9 +275,9 @@
ecommerce: {
items: [
{
item_id: "<?= $this -> product -> id;?>",
item_name: "<?= str_replace( '"', '', $this -> product -> language['name'] );?>",
price: '<? if ( $this -> product -> price_brutto_promo ): echo \Shared\Helpers\Helpers::normalize_decimal( $this -> product -> price_brutto_promo ); else: echo \Shared\Helpers\Helpers::normalize_decimal( $this -> product -> price_brutto ); endif;?>',
item_id: "<?= $this -> product['id'];?>",
item_name: "<?= str_replace( '"', '', $this -> product['language']['name'] );?>",
price: '<? if ( $this -> product['price_brutto_promo'] ): echo \Shared\Helpers\Helpers::normalize_decimal( $this -> product['price_brutto_promo'] ); else: echo \Shared\Helpers\Helpers::normalize_decimal( $this -> product['price_brutto'] ); endif;?>',
quantity: 1
}
]
@@ -556,8 +556,8 @@
if (!check)
return false;
var values = $( '#product-<?= $this -> product -> id;?>' ).serializeArray();
var quantity = $('#product-<?= $this -> product -> id;?> #quantity').val();
var values = $( '#product-<?= $this -> product['id'];?>' ).serializeArray();
var quantity = $('#product-<?= $this -> product['id'];?> #quantity').val();
jQuery.ajax(
{
@@ -586,15 +586,15 @@
for (var i = 1; i <= quantity; i++)
{
fbq('track', 'AddToCart', {
content_name: '<?= str_replace( '"', '', $this -> product -> language['name'] );?>',
content_name: '<?= str_replace( '"', '', $this -> product['language']['name'] );?>',
content_category: 'produkt',
content_ids: ['<?= $this -> product -> id;?>'],
content_ids: ['<?= $this -> product['id'];?>'],
content_type: 'product',
value: '<?
if ( $this -> product -> price_brutto_promo ):
echo \Shared\Helpers\Helpers::normalize_decimal( $this -> product -> price_brutto_promo );
if ( $this -> product['price_brutto_promo'] ):
echo \Shared\Helpers\Helpers::normalize_decimal( $this -> product['price_brutto_promo'] );
else:
echo \Shared\Helpers\Helpers::normalize_decimal( $this -> product -> price_brutto );
echo \Shared\Helpers\Helpers::normalize_decimal( $this -> product['price_brutto'] );
endif;
?>',
currency: 'PLN'
@@ -603,7 +603,7 @@
<? endif;?>
<? if ( $this -> settings['google_tag_manager_id'] ):?>
var add_to_cart_value = <? if ( $this -> product -> price_brutto_promo ): echo \Shared\Helpers\Helpers::normalize_decimal( $this -> product -> price_brutto_promo ); else: echo \Shared\Helpers\Helpers::normalize_decimal( $this -> product -> price_brutto ); endif;?> * quantity;
var add_to_cart_value = <? if ( $this -> product['price_brutto_promo'] ): echo \Shared\Helpers\Helpers::normalize_decimal( $this -> product['price_brutto_promo'] ); else: echo \Shared\Helpers\Helpers::normalize_decimal( $this -> product['price_brutto'] ); endif;?> * quantity;
dataLayer.push({ ecommerce: null });
dataLayer.push({
event: "add_to_cart",
@@ -612,9 +612,9 @@
value: add_to_cart_value,
items: [
{
item_id: "<?= $this -> product -> id;?>",
item_name: "<?= str_replace( '"', '', $this -> product -> language['name'] );?>",
price: <? if ( $this -> product -> price_brutto_promo ): echo \Shared\Helpers\Helpers::normalize_decimal( $this -> product -> price_brutto_promo ); else: echo \Shared\Helpers\Helpers::normalize_decimal( $this -> product -> price_brutto ); endif;?>,
item_id: "<?= $this -> product['id'];?>",
item_name: "<?= str_replace( '"', '', $this -> product['language']['name'] );?>",
price: <? if ( $this -> product['price_brutto_promo'] ): echo \Shared\Helpers\Helpers::normalize_decimal( $this -> product['price_brutto_promo'] ); else: echo \Shared\Helpers\Helpers::normalize_decimal( $this -> product['price_brutto'] ); endif;?>,
quantity: quantity
}
]

View File

@@ -4,7 +4,7 @@
<div class="swiper-wrapper">
<?
foreach ( $this -> products as $product ):
if ( $product -> status ):
if ( $product['status'] ):
echo \Shared\Tpl\Tpl::view( 'shop-product/product-mini', [
'product' => $product,
'class' => 'item',

View File

@@ -6,7 +6,7 @@
<div class="swiper-wrapper">
<?
foreach ( $this -> products as $product ):
if ( $product -> status ):
if ( $product['status'] ):
echo \Shared\Tpl\Tpl::view( 'shop-product/product-mini', [
'product' => $product,
'class' => 'item',

View File

@@ -6,7 +6,7 @@
<div class="swiper-wrapper">
<?
foreach ( $this -> products as $product ):
if ( $product -> status ):
if ( $product['status'] ):
echo \Shared\Tpl\Tpl::view( 'shop-product/product-mini', [
'product' => $product,
'class' => 'item',

View File

@@ -3,9 +3,9 @@
<div class="content">
<? if ( is_array( $this -> products ) ): foreach ( $this -> products as $product_id ):?>
<?
$product = \shop\Product::getFromCache( $product_id, $lang_id );
$product = (new \Domain\Product\ProductRepository($GLOBALS['mdb']))->findCached( $product_id, $lang_id );
$product -> languages[$lang_id]['seo_link'] ? $url = '/' . $product -> languages[$lang_id]['seo_link'] : $url = '/p-' . $product['id'] . '-' . \Shared\Helpers\Helpers::seo( $product -> languages[$lang_id]['name'] );
$product['languages'][$lang_id]['seo_link'] ? $url = '/' . $product['languages'][$lang_id]['seo_link'] : $url = '/p-' . $product['id'] . '-' . \Shared\Helpers\Helpers::seo( $product['languages'][$lang_id]['name'] );
if ( \Shared\Helpers\Helpers::get_session( 'current-lang' ) != ( new \Domain\Languages\LanguagesRepository( $GLOBALS['mdb'] ) )->defaultLanguage() and $url != '#' )
$url = '/' . \Shared\Helpers\Helpers::get_session( 'current-lang' ) . $url;