Add view classes for articles, banners, languages, menu, newsletter, containers, shop categories, clients, payment methods, products, and search
- Created `Articles` class for rendering article views including full articles, miniature lists, and news sections. - Added `Banners` class for handling banner displays. - Introduced `Languages` class for rendering language options. - Implemented `Menu` class for rendering page and menu structures. - Developed `Newsletter` class for newsletter rendering. - Created `Scontainers` class for rendering specific containers. - Added `ShopCategory` class for managing shop category views and pagination. - Implemented `ShopClient` class for client-related views including address management and login forms. - Created `ShopPaymentMethod` class for displaying payment methods in the basket. - Added `ShopProduct` class for generating product URLs. - Introduced `ShopSearch` class for rendering a simple search form. - Added `.htaccess` file in the plugins directory to enhance security by restricting access to sensitive files and directories.
This commit is contained in:
@@ -1,15 +1,16 @@
|
||||
<?php
|
||||
global $lang_id;
|
||||
$attribute_details = \front\factory\ShopAttribute::attribute_details( $this -> attribute['id'], $lang_id );
|
||||
$attributeRepo = new \Domain\Attribute\AttributeRepository( $GLOBALS['mdb'] );
|
||||
$attribute_details = $attributeRepo->frontAttributeDetails( (int)$this -> attribute['id'], $lang_id );
|
||||
if ( $attribute_details['type'] == 0 )
|
||||
{
|
||||
?>
|
||||
<div class="attribute-container fradio-group attribute-<?= \S::seo( $attribute_details['language']['name'] );?>" level="<?= $this -> level;?>" order="<?= $this -> order;?>" attribute="<?= \S::seo( $attribute_details['language']['name'] );?>" attribute-name="<?= $attribute_details['language']['name'];?>">
|
||||
<div class="attribute-container fradio-group attribute-<?= \Shared\Helpers\Helpers::seo( $attribute_details['language']['name'] );?>" level="<?= $this -> level;?>" order="<?= $this -> order;?>" attribute="<?= \Shared\Helpers\Helpers::seo( $attribute_details['language']['name'] );?>" attribute-name="<?= $attribute_details['language']['name'];?>">
|
||||
<p class="attribute-label"><?= $attribute_details['language']['name'];?>:</p>
|
||||
<? 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="<?= \S::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>
|
||||
<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;?>"><?= ( new \Domain\Attribute\AttributeRepository( $GLOBALS['mdb'] ) )->getAttributeValueById( $value['id'], $lang_id );?></label>
|
||||
</div>
|
||||
<? if ( $value['is_default'] ):?>
|
||||
<script class="footer" type="text/javascript">
|
||||
|
||||
@@ -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)): ?>
|
||||
|
||||
@@ -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];
|
||||
}
|
||||
|
||||
@@ -1,25 +1,25 @@
|
||||
<? global $lang_id;?>
|
||||
<?
|
||||
$this -> product -> language['seo_link'] ? $url = '/' . $this -> product -> language['seo_link'] : $url = '/p-' . $this -> product['id'] . '-' . \S::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 ( \S::get_session( 'current-lang' ) != \front\factory\Languages::default_language() and $url != '#' )
|
||||
$url = '/' . \S::get_session( 'current-lang' ) . $url;
|
||||
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' ) ):?>
|
||||
<div class="new"><?= \S::lang( 'nowosc' );?></div>
|
||||
<? 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;
|
||||
};?>
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
<? global $lang_id;?>
|
||||
<? 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">
|
||||
function fradio_label_click( element, refresh )
|
||||
@@ -18,67 +19,67 @@
|
||||
<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' ) ):?>
|
||||
<div class="new"><?= \S::lang( 'nowosc' );?></div>
|
||||
<? 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>
|
||||
</div>
|
||||
<div class="col-12 col-md-6">
|
||||
<div class="product-options" id="product-options">
|
||||
<?= \Tpl::view( 'shop-product/_partial/product-warehouse-message', [
|
||||
<?= \Shared\Tpl\Tpl::view( 'shop-product/_partial/product-warehouse-message', [
|
||||
'product' => $this -> product,
|
||||
'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( \front\factory\ShopProduct::get_minimal_price( $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> / <?= \front\factory\Dictionaries::get_name_by_id( $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;?>">
|
||||
<? if ( \S::is_array_fix( $attributes ) ):?>
|
||||
<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>
|
||||
<? foreach ( $attributes as $key => $val )
|
||||
echo \Tpl::view( 'shop-product/_partial/product-attribute', [
|
||||
echo \Shared\Tpl\Tpl::view( 'shop-product/_partial/product-attribute', [
|
||||
'attribute' => $val,
|
||||
'order' => $key,
|
||||
'level' => ++$level,
|
||||
@@ -91,7 +92,7 @@
|
||||
<textarea class="form-control" name="product-message" <? if ( $this -> product['additional_message_required'] ):?>required="required"<? endif;?> placeholder="<?= $this -> product['additional_message_text'] ? $this -> product['additional_message_text'] : 'Miejsce na dodatkową wiadomość';?>"></textarea>
|
||||
</div>
|
||||
<? endif;?>
|
||||
<?= \Tpl::view( 'shop-product/_partial/product-custom-fields', [
|
||||
<?= \Shared\Tpl\Tpl::view( 'shop-product/_partial/product-custom-fields', [
|
||||
'custom_fields' => $this -> product['custom_fields']
|
||||
] );?>
|
||||
<div class="add-to-basket">
|
||||
@@ -104,7 +105,7 @@
|
||||
<i class="fa fa-plus"></i>
|
||||
</a>
|
||||
</div>
|
||||
<button id="add-to-basket" class="btn btn-success"><?= \S::lang( 'do-koszyka' );?></span>
|
||||
<button id="add-to-basket" class="btn btn-success"><?= \Shared\Helpers\Helpers::lang( 'do-koszyka' );?></span>
|
||||
</button>
|
||||
<div class="alert hidden">Produkt chwilowo niedostępny.</div>
|
||||
<?
|
||||
@@ -113,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;?>
|
||||
@@ -122,16 +123,16 @@
|
||||
</form>
|
||||
<? if ( $this -> product['producer'] and $this -> product['producer']['status'] ):?>
|
||||
<div class="product-producer">
|
||||
Producent: <a href="/producent/<?= \S::seo( $this -> product['producer']['name'] );?>" title="Produkty marki <?= htmlspecialchars( $this -> product['producer']['name'] );?>"><?= $this -> product['producer']['name'];?></a>
|
||||
Producent: <a href="/producent/<?= \Shared\Helpers\Helpers::seo( $this -> product['producer']['name'] );?>" title="Produkty marki <?= htmlspecialchars( $this -> product['producer']['name'] );?>"><?= $this -> product['producer']['name'];?></a>
|
||||
</div>
|
||||
<? endif;?>
|
||||
|
||||
<?= \Tpl::view( 'shop-product/_partial/product-meta', [
|
||||
<?= \Shared\Tpl\Tpl::view( 'shop-product/_partial/product-meta', [
|
||||
'product_id' => $this->product['id']
|
||||
]);?>
|
||||
|
||||
<div class="short-description">
|
||||
<?= $this -> product -> language['short_description'];?>
|
||||
<?= $this -> product['language']['short_description'];?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -140,25 +141,25 @@
|
||||
<div class="row">
|
||||
<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( \S::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>
|
||||
<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>
|
||||
<? endif;?>
|
||||
<li class="tab-link" id="tab-link-2" tab="2"><?= ucfirst( \S::lang( 'opinie' ) );?></li>
|
||||
<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"><?= \S::lang( 'opis-produktu' );?></div>
|
||||
<?= $this -> product -> language['description'];?>
|
||||
<div class="tab-title"><?= \Shared\Helpers\Helpers::lang( 'opis-produktu' );?></div>
|
||||
<?= $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">
|
||||
<div class="tab-title"><?= ucfirst( \S::lang( 'opinie' ) );?></div>
|
||||
<div class="tab-title"><?= ucfirst( \Shared\Helpers\Helpers::lang( 'opinie' ) );?></div>
|
||||
<div id="widget-container" class="data-ekomi-emp ekomi-widget-container ekomi-widget-sf14835961656364de9f9" ></div>
|
||||
<div id="ekomi-product-widget-identifier" class="prod-data-emp" style="visibility: hidden"><?= $this -> product['id'];?></div>
|
||||
<a href="https://www.ekomi-pl.com/opinie-marianek.html" target="_blank"><img alt="marianek.pl Reviews with ekomi-pl.com" src="https://smart-widget-assets.ekomiapps.de/resources/ekomi_logo.png" style="display: none;"/></a>
|
||||
@@ -201,28 +202,28 @@
|
||||
</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;?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<? if ( \S::is_array_fix( $this -> product['products_sets'] ) ):?>
|
||||
<? if ( \Shared\Helpers\Helpers::is_array_fix( $this -> product['products_sets'] ) ):?>
|
||||
<div class="products-sets box">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="box-title"><?= ucfirst( \S::lang( 'dobierz-do-kompletu' ) );?></div>
|
||||
<div class="box-title"><?= ucfirst( \Shared\Helpers\Helpers::lang( 'dobierz-do-kompletu' ) );?></div>
|
||||
<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 ):
|
||||
echo \Tpl::view( 'shop-product/product-mini', [
|
||||
$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'
|
||||
] );
|
||||
@@ -234,7 +235,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<? endif;?>
|
||||
<? if ( \S::is_array_fix( $this -> product['products_related'] ) ):?>
|
||||
<? if ( \Shared\Helpers\Helpers::is_array_fix( $this -> product['products_related'] ) ):?>
|
||||
<div class="products-related box">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
@@ -242,9 +243,9 @@
|
||||
<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 ):
|
||||
echo \Tpl::view( 'shop-product/product-mini', [
|
||||
$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'
|
||||
] );
|
||||
@@ -256,14 +257,16 @@
|
||||
</div>
|
||||
</div>
|
||||
<? endif;?>
|
||||
<a href="javascript:history.go(-1)" class="btn btn-success history-back"><?= \S::lang( 'wstecz' );?></a>
|
||||
<a href="javascript:history.go(-1)" class="btn btn-success history-back"><?= \Shared\Helpers\Helpers::lang( 'wstecz' );?></a>
|
||||
</div>
|
||||
<link class="footer" rel="stylesheet" type="text/css" href="/libraries/fancybox3/css/core.css">
|
||||
<link class="footer" rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/swiper@11/swiper-bundle.min.css">
|
||||
<link class="footer" rel="stylesheet" type="text/css" href="/plugins/OwlCarousel/owl.carousel.css">
|
||||
<link class="footer" rel="stylesheet" type="text/css" href="/plugins/OwlCarousel/owl.theme.default.css">
|
||||
<script class="footer" type="text/javascript" src="/libraries/fancybox3/js/core.js"></script>
|
||||
<script class="footer" type="text/javascript" src="/libraries/fancybox3/js/guestures.js"></script>
|
||||
<script class="footer" type="text/javascript" src="/libraries/fancybox3/js/wheel.js"></script>
|
||||
<script class="footer" type="text/javascript" src="https://cdn.jsdelivr.net/npm/swiper@11/swiper-bundle.min.js"></script>
|
||||
<script class="footer" type="text/javascript" src="/plugins/OwlCarousel/owl.carousel.js"></script>
|
||||
<script type="text/javascript">
|
||||
$(function(){
|
||||
@@ -274,9 +277,9 @@
|
||||
ecommerce: {
|
||||
items: [
|
||||
{
|
||||
item_id: "<?= $this -> product -> id;?>",
|
||||
item_name: "<?= str_replace( '"', '', $this -> product -> language['name'] );?>",
|
||||
price: '<? if ( $this -> product -> price_brutto_promo ): echo \S::normalize_decimal( $this -> product -> price_brutto_promo ); else: echo \S::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
|
||||
}
|
||||
]
|
||||
@@ -320,17 +323,17 @@
|
||||
});
|
||||
};
|
||||
|
||||
if ( $( '#product #tab-0' ).visible() )
|
||||
if ( $( '#product #tab-0' ).is( ':visible' ) )
|
||||
$( '#product #tabs-menu #tab-link-0' ).addClass( 'current' );
|
||||
else
|
||||
$( '#product #tabs-menu #tab-link-0' ).removeClass( 'current' );
|
||||
|
||||
if ( $( '#product #tab-1' ).visible() )
|
||||
if ( $( '#product #tab-1' ).is( ':visible' ) )
|
||||
$( '#product #tabs-menu #tab-link-1' ).addClass( 'current' );
|
||||
else
|
||||
$( '#product #tabs-menu #tab-link-1' ).removeClass( 'current' );
|
||||
|
||||
if ( $( '#product #tab-2' ).visible() )
|
||||
if ( $( '#product #tab-2' ).is( ':visible' ) )
|
||||
$( '#product #tabs-menu #tab-link-2' ).addClass( 'current' );
|
||||
else
|
||||
$( '#product #tabs-menu #tab-link-2' ).removeClass( 'current' );
|
||||
@@ -404,7 +407,7 @@
|
||||
quantity = max_value;
|
||||
$.alert(
|
||||
{
|
||||
title: '<?= ucfirst( \S::lang( 'uwaga' ) );?>',
|
||||
title: '<?= ucfirst( \Shared\Helpers\Helpers::lang( 'uwaga' ) );?>',
|
||||
content: 'Maksymalna ilość wybranego produktu wynosi: <b>' + max_value + '<\/b>',
|
||||
type: 'blue',
|
||||
closeIcon: true,
|
||||
@@ -417,7 +420,7 @@
|
||||
icon: 'fas fa-exclamation',
|
||||
buttons: {
|
||||
confirm: {
|
||||
text: '<?= \S::lang( 'zamknij' );?>',
|
||||
text: '<?= \Shared\Helpers\Helpers::lang( 'zamknij' );?>',
|
||||
btnClass: 'btn-blue',
|
||||
keys: ['enter'],
|
||||
action: function () {}
|
||||
@@ -444,7 +447,7 @@
|
||||
quantity = max_value;
|
||||
$.alert(
|
||||
{
|
||||
title: '<?= ucfirst( \S::lang( 'uwaga' ) );?>',
|
||||
title: '<?= ucfirst( \Shared\Helpers\Helpers::lang( 'uwaga' ) );?>',
|
||||
content: 'Maksymalna ilość wybranego produktu wynosi: <b>' + max_value + '<\/b>',
|
||||
type: 'blue',
|
||||
closeIcon: true,
|
||||
@@ -457,7 +460,7 @@
|
||||
icon: 'fas fa-exclamation',
|
||||
buttons: {
|
||||
confirm: {
|
||||
text: '<?= \S::lang( 'zamknij' );?>',
|
||||
text: '<?= \Shared\Helpers\Helpers::lang( 'zamknij' );?>',
|
||||
btnClass: 'btn-blue',
|
||||
keys: ['enter'],
|
||||
action: function () {}
|
||||
@@ -495,8 +498,8 @@
|
||||
{
|
||||
var name = $( element ).attr( 'description' );
|
||||
shopAlert(
|
||||
'<?= ucfirst( \S::lang( 'uwaga' ) );?>',
|
||||
'<?= ucfirst( \S::lang( 'prosze-wybrac' ) );?>: <b>' + name + '</b>',
|
||||
'<?= ucfirst( \Shared\Helpers\Helpers::lang( 'uwaga' ) );?>',
|
||||
'<?= ucfirst( \Shared\Helpers\Helpers::lang( 'prosze-wybrac' ) );?>: <b>' + name + '</b>',
|
||||
[
|
||||
'<a href="#" onclick="shopAlertClose(); return false;" class="btn btn-success">Zamknij</a>',
|
||||
] );
|
||||
@@ -514,8 +517,8 @@
|
||||
{
|
||||
var name = $( element ).attr( 'attribute-name' );
|
||||
shopAlert(
|
||||
'<?= ucfirst( \S::lang( 'uwaga' ) );?>',
|
||||
'<?= ucfirst( \S::lang( 'prosze-wybrac' ) );?>: <b>' + name + '</b>',
|
||||
'<?= ucfirst( \Shared\Helpers\Helpers::lang( 'uwaga' ) );?>',
|
||||
'<?= ucfirst( \Shared\Helpers\Helpers::lang( 'prosze-wybrac' ) );?>: <b>' + name + '</b>',
|
||||
[
|
||||
'<a href="#" onclick="shopAlertClose(); return false;" class="btn btn-success">Zamknij</a>',
|
||||
] );
|
||||
@@ -527,7 +530,7 @@
|
||||
if ( $( '.product-message textarea' ).prop( 'required' ) && $.trim( $( '.product-message textarea' ).val() ) == '' )
|
||||
{
|
||||
shopAlert(
|
||||
'<?= ucfirst( \S::lang( 'uwaga' ) );?>',
|
||||
'<?= ucfirst( \Shared\Helpers\Helpers::lang( 'uwaga' ) );?>',
|
||||
'Proszę uzupełnić pole na dodatkową wiadomość.',
|
||||
[
|
||||
'<a href="#" onclick="shopAlertClose(); return false;" class="btn btn-success">Zamknij</a>',
|
||||
@@ -542,7 +545,7 @@
|
||||
if ( $.trim( $( element ).val() ) == '' )
|
||||
{
|
||||
shopAlert(
|
||||
'<?= ucfirst( \S::lang( 'uwaga' ) );?>',
|
||||
'<?= ucfirst( \Shared\Helpers\Helpers::lang( 'uwaga' ) );?>',
|
||||
'Proszę uzupełnić pole: <b>' + $( element ).attr( 'field_name' ) + '</b>',
|
||||
[
|
||||
'<a href="#" onclick="shopAlertClose(); return false;" class="btn btn-success">Zamknij</a>',
|
||||
@@ -555,8 +558,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(
|
||||
{
|
||||
@@ -585,15 +588,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 \S::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 \S::normalize_decimal( $this -> product -> price_brutto );
|
||||
echo \Shared\Helpers\Helpers::normalize_decimal( $this -> product['price_brutto'] );
|
||||
endif;
|
||||
?>',
|
||||
currency: 'PLN'
|
||||
@@ -602,7 +605,7 @@
|
||||
<? endif;?>
|
||||
|
||||
<? if ( $this -> settings['google_tag_manager_id'] ):?>
|
||||
var add_to_cart_value = <? if ( $this -> product -> price_brutto_promo ): echo \S::normalize_decimal( $this -> product -> price_brutto_promo ); else: echo \S::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",
|
||||
@@ -611,9 +614,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 \S::normalize_decimal( $this -> product -> price_brutto_promo ); else: echo \S::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
|
||||
}
|
||||
]
|
||||
|
||||
@@ -4,8 +4,8 @@
|
||||
<div class="swiper-wrapper">
|
||||
<?
|
||||
foreach ( $this -> products as $product ):
|
||||
if ( $product -> status ):
|
||||
echo \Tpl::view( 'shop-product/product-mini', [
|
||||
if ( $product['status'] ):
|
||||
echo \Shared\Tpl\Tpl::view( 'shop-product/product-mini', [
|
||||
'product' => $product,
|
||||
'class' => 'item',
|
||||
'product_mini_class' => 'swiper-slide'
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
<div class="swiper-wrapper">
|
||||
<?
|
||||
foreach ( $this -> products as $product ):
|
||||
if ( $product -> status ):
|
||||
echo \Tpl::view( 'shop-product/product-mini', [
|
||||
if ( $product['status'] ):
|
||||
echo \Shared\Tpl\Tpl::view( 'shop-product/product-mini', [
|
||||
'product' => $product,
|
||||
'class' => 'item',
|
||||
'product_mini_class' => 'swiper-slide'
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
<div class="swiper-wrapper">
|
||||
<?
|
||||
foreach ( $this -> products as $product ):
|
||||
if ( $product -> status ):
|
||||
echo \Tpl::view( 'shop-product/product-mini', [
|
||||
if ( $product['status'] ):
|
||||
echo \Shared\Tpl\Tpl::view( 'shop-product/product-mini', [
|
||||
'product' => $product,
|
||||
'class' => 'item',
|
||||
'product_mini_class' => 'swiper-slide'
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
<? global $lang_id;?>
|
||||
<div class="box-title"><?= ucfirst( \S::lang( 'polecane-produkty' ) );?></div>
|
||||
<div class="box-title"><?= ucfirst( \Shared\Helpers\Helpers::lang( 'polecane-produkty' ) );?></div>
|
||||
<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'] . '-' . \S::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 ( \S::get_session( 'current-lang' ) != \front\factory\Languages::default_language() and $url != '#' )
|
||||
$url = '/' . \S::get_session( 'current-lang' ) . $url;
|
||||
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;
|
||||
?>
|
||||
<?= \Tpl::view( 'shop-product/product-mini', [
|
||||
<?= \Shared\Tpl\Tpl::view( 'shop-product/product-mini', [
|
||||
'product' => $product,
|
||||
'class' => 'col-12 col-sm-4 col-md-4 col-lg-3'
|
||||
] );?>
|
||||
|
||||
Reference in New Issue
Block a user