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,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;?>" data-product-id="<?= $this -> product -> id;?>">
|
||||
<? if ( $this -> product -> new_to_date and $this -> product -> new_to_date >= date( 'Y-m-d' ) ):?>
|
||||
<div class="new"><?= \S::lang( 'nowosc' );?></div>
|
||||
<div class="product-mini <?= $this -> product_mini_class;?>" data-product-id="<?= $this -> product['id'];?>">
|
||||
<? 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/318/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/318/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/318/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/318/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/318/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/318/0/<?= substr( $this -> product['images'][0]['src'], 1, strlen( $this -> product['images'][0]['src'] ) );?>" alt="<?= $this -> product['images'][0]['alt'];?>">
|
||||
<? endif;?>
|
||||
<? endif;?>
|
||||
<? else:?>
|
||||
@@ -28,42 +28,42 @@
|
||||
</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;
|
||||
};?>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,6 +1,12 @@
|
||||
<? 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 );
|
||||
$product_images = [];
|
||||
if ( is_array( $this -> product ) and is_array( $this -> product['images'] ?? null ) )
|
||||
$product_images = $this -> product['images'];
|
||||
elseif ( is_object( $this -> product ) and is_array( $this -> product -> images ?? null ) )
|
||||
$product_images = $this -> product -> images;
|
||||
?>
|
||||
<script class="footer" type="text/javascript">
|
||||
function fradio_label_click( element, refresh )
|
||||
@@ -22,9 +28,9 @@
|
||||
<div class="gallery">
|
||||
<div thumbsSlider="" class="swiper mySwiper">
|
||||
<div class="swiper-wrapper">
|
||||
<? for ( $i = 0; $i < count( $this -> product -> images ); $i++ ): if ( file_exists( substr( $this -> product -> images[$i]['src'], 1 ) ) ):?>
|
||||
<? for ( $i = 0; $i < count( $product_images ); $i++ ): if ( file_exists( substr( $product_images[$i]['src'], 1 ) ) ):?>
|
||||
<div class="swiper-slide">
|
||||
<img class="nolazy" src="/thumb/180/0<?= $this -> product -> images[$i]['src'];?>" src="" alt="<?= $this -> product -> images[$i]['alt'];?>">
|
||||
<img class="nolazy" src="/thumb/180/0<?= $product_images[$i]['src'];?>" src="" alt="<?= $product_images[$i]['alt'];?>">
|
||||
</div>
|
||||
<? endif; endfor;?>
|
||||
</div>
|
||||
@@ -32,15 +38,15 @@
|
||||
</div>
|
||||
|
||||
<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;?>
|
||||
<div class="swiper mySwiper2">
|
||||
<div class="swiper-wrapper">
|
||||
<? for ( $i = 0; $i < count( $this -> product -> images ); $i++ ): if ( file_exists( substr( $this -> product -> images[$i]['src'], 1 ) ) ):?>
|
||||
<? for ( $i = 0; $i < count( $product_images ); $i++ ): if ( file_exists( substr( $product_images[$i]['src'], 1 ) ) ):?>
|
||||
<div class="swiper-slide">
|
||||
<a href="<?= $this -> product -> images[$i]['src'];?>" class="item" data-fancybox="product" id="image-<?= $i;?>" i="<?= $i;?>">
|
||||
<img class="nolazy" src="/thumb/520/0<?= $this -> product -> images[$i]['src'];?>" src="" alt="<?= $this -> product -> images[$i]['alt'];?>">
|
||||
<a href="<?= $product_images[$i]['src'];?>" class="item" data-fancybox="product" id="image-<?= $i;?>" i="<?= $i;?>">
|
||||
<img class="nolazy" src="/thumb/520/0<?= $product_images[$i]['src'];?>" src="" alt="<?= $product_images[$i]['alt'];?>">
|
||||
</a>
|
||||
</div>
|
||||
<? endif; endfor;?>
|
||||
@@ -54,48 +60,48 @@
|
||||
<!-- //* right box -->
|
||||
<div class="product_info__info">
|
||||
<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 id="66bb9a83-faae-47e5-a954-13929becb059"></div>
|
||||
<script defer src="https://trustmate.io/widget/api/66bb9a83-faae-47e5-a954-13929becb059/script?product=<?= $this -> product -> id;?>"></script>
|
||||
<script defer src="https://trustmate.io/widget/api/66bb9a83-faae-47e5-a954-13929becb059/script?product=<?= $this -> product['id'];?>"></script>
|
||||
<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,
|
||||
@@ -108,7 +114,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">
|
||||
@@ -121,7 +127,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>
|
||||
<?
|
||||
@@ -130,8 +136,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;?>
|
||||
@@ -142,41 +148,41 @@
|
||||
</div>
|
||||
<? 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;?>
|
||||
<div class="short-description">
|
||||
<?= $this -> product -> language['short_description'];?>
|
||||
<?= $this -> product['language']['short_description'];?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- //* bottom left -->
|
||||
<? if ( $this -> product -> language['description'] or $this -> product -> language['tab_description_1'] or $this -> product -> language['tab_description_2'] or $this -> product['producer'] ):?>
|
||||
<? if ( $this -> product['language']['description'] or $this -> product['language']['tab_description_1'] or $this -> product['language']['tab_description_2'] or $this -> product['producer'] ):?>
|
||||
<div id="description" class="product_info__desc">
|
||||
<div class="description_accordion">
|
||||
|
||||
<!-- accordion 1 -->
|
||||
<? if ($this -> product -> language['description']) : ?>
|
||||
<? if ($this -> product['language']['description']) : ?>
|
||||
<div class="accordion_tile accordion_active">
|
||||
<div class="accordion_title"><p><?= ucfirst( \S::lang( 'opis' ) );?></p></div>
|
||||
<div class="accordion_data"><?= $this -> product -> language['description'];?></div>
|
||||
<div class="accordion_title"><p><?= ucfirst( \Shared\Helpers\Helpers::lang( 'opis' ) );?></p></div>
|
||||
<div class="accordion_data"><?= $this -> product['language']['description'];?></div>
|
||||
</div>
|
||||
<? endif; ?>
|
||||
|
||||
<? if ( $this -> product -> language['tab_name_1'] ):?>
|
||||
<? if ( $this -> product['language']['tab_name_1'] ):?>
|
||||
<!-- accordion 2 -->
|
||||
<div class="accordion_tile">
|
||||
<div class="accordion_title"><p><?= $this -> product -> language['tab_name_1'];?></p></div>
|
||||
<div class="accordion_data"><?= $this -> product -> language['tab_description_1'];?></div>
|
||||
<div class="accordion_title"><p><?= $this -> product['language']['tab_name_1'];?></p></div>
|
||||
<div class="accordion_data"><?= $this -> product['language']['tab_description_1'];?></div>
|
||||
</div>
|
||||
<? endif;?>
|
||||
|
||||
<? if ( $this -> product -> language['tab_name_2'] ):?>
|
||||
<? if ( $this -> product['language']['tab_name_2'] ):?>
|
||||
<!-- accordion 3 -->
|
||||
<div class="accordion_tile">
|
||||
<div class="accordion_title"><p><?= $this -> product -> language['tab_name_2'];?></p></div>
|
||||
<div class="accordion_data" style="display: none;"><?= $this -> product -> language['tab_description_2'];?></div>
|
||||
<div class="accordion_title"><p><?= $this -> product['language']['tab_name_2'];?></p></div>
|
||||
<div class="accordion_data" style="display: none;"><?= $this -> product['language']['tab_description_2'];?></div>
|
||||
</div>
|
||||
<? endif;?>
|
||||
|
||||
@@ -208,24 +214,24 @@
|
||||
<div class="col-12">
|
||||
<div class="box-title">Opinie o produkcie</div>
|
||||
<div id="2bf0c481-66d6-447c-83e5-76b6bf312513"></div>
|
||||
<script defer src="https://trustmate.io/widget/api/2bf0c481-66d6-447c-83e5-76b6bf312513/script?product=<?= $this -> product -> id;?>"></script>
|
||||
<script defer src="https://trustmate.io/widget/api/2bf0c481-66d6-447c-83e5-76b6bf312513/script?product=<?= $this -> product['id'];?>"></script>
|
||||
</div>
|
||||
</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">
|
||||
<div class="swiper otherProductsSwiper">
|
||||
<div class="swiper-wrapper">
|
||||
<?
|
||||
foreach ( $this -> product['products_sets'] as $product_sets_id ):
|
||||
$product = new \shop\Product( $product_sets_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',
|
||||
'product_mini_class' => 'swiper-slide'
|
||||
@@ -243,7 +249,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">
|
||||
@@ -253,9 +259,9 @@
|
||||
<div class="swiper-wrapper">
|
||||
<?
|
||||
foreach ( $this -> product['products_related'] as $product_related_id ):
|
||||
$product = new \shop\Product( $product_related_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',
|
||||
'product_mini_class' => 'swiper-slide'
|
||||
@@ -273,12 +279,14 @@
|
||||
</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="/plugins/swiper/swiper-bundle.min.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="/plugins/swiper/swiper-bundle.min.js"></script>
|
||||
<script class="footer" type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/ScrollMagic/2.0.8/ScrollMagic.min.js"></script>
|
||||
<script type="text/javascript">
|
||||
$( function() {
|
||||
@@ -288,9 +296,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,
|
||||
google_business_vertical: "retail"
|
||||
}
|
||||
@@ -322,17 +330,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' );
|
||||
@@ -371,21 +379,21 @@
|
||||
{
|
||||
e.preventDefault();
|
||||
$.alert({
|
||||
title: '<?= ucfirst( \S::lang( 'dodaj-opinie' ) );?>',
|
||||
title: '<?= ucfirst( \Shared\Helpers\Helpers::lang( 'dodaj-opinie' ) );?>',
|
||||
content: '<form method="POST">'
|
||||
+ '<div class="row form-group">'
|
||||
+ '<div class="col-12 text-left">'
|
||||
+ '<?= ucfirst( \S::lang( 'ocena' ) );?>: <i class="fa fa-star"><\/i> <i class="fa fa-star"><\/i> <i class="fa fa-star"><\/i> <i class="fa fa-star"><\/i> <i class="fa fa-star"><\/i> <i class="fa fa-star"><\/i>'
|
||||
+ '<?= ucfirst( \Shared\Helpers\Helpers::lang( 'ocena' ) );?>: <i class="fa fa-star"><\/i> <i class="fa fa-star"><\/i> <i class="fa fa-star"><\/i> <i class="fa fa-star"><\/i> <i class="fa fa-star"><\/i> <i class="fa fa-star"><\/i>'
|
||||
+ '<\/div>'
|
||||
+ '<\/div>'
|
||||
+ '<div class="row form-group">'
|
||||
+ '<div class="col-12">'
|
||||
+ '<input type="text" class="form-control" name="name" placeholder="<?= ucfirst( \S::lang( 'imie' ) );?>">'
|
||||
+ '<input type="text" class="form-control" name="name" placeholder="<?= ucfirst( \Shared\Helpers\Helpers::lang( 'imie' ) );?>">'
|
||||
+ '<\/div>'
|
||||
+ '<\/div>'
|
||||
+ '<div class="row form-group">'
|
||||
+ '<div class="col-12">'
|
||||
+ '<textarea name="review" class="form-control" placeholder="<?= ucfirst( \S::lang( 'opinia' ) );?>"><\/textarea>'
|
||||
+ '<textarea name="review" class="form-control" placeholder="<?= ucfirst( \Shared\Helpers\Helpers::lang( 'opinia' ) );?>"><\/textarea>'
|
||||
+ '<\/div>'
|
||||
+ '<\/div>'
|
||||
+ '<\/form>',
|
||||
@@ -400,7 +408,7 @@
|
||||
{
|
||||
cancel:
|
||||
{
|
||||
text: '<?= \S::lang( 'anuluj' );?>',
|
||||
text: '<?= \Shared\Helpers\Helpers::lang( 'anuluj' );?>',
|
||||
btnClass: 'btn-danger',
|
||||
action: function () {}
|
||||
}
|
||||
@@ -422,7 +430,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,
|
||||
@@ -435,7 +443,7 @@
|
||||
icon: 'fa fa-exclamation',
|
||||
buttons: {
|
||||
confirm: {
|
||||
text: '<?= \S::lang( 'zamknij' );?>',
|
||||
text: '<?= \Shared\Helpers\Helpers::lang( 'zamknij' );?>',
|
||||
btnClass: 'btn-blue',
|
||||
keys: ['enter'],
|
||||
action: function () {}
|
||||
@@ -462,7 +470,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,
|
||||
@@ -475,7 +483,7 @@
|
||||
icon: 'fa fa-exclamation',
|
||||
buttons: {
|
||||
confirm: {
|
||||
text: '<?= \S::lang( 'zamknij' );?>',
|
||||
text: '<?= \Shared\Helpers\Helpers::lang( 'zamknij' );?>',
|
||||
btnClass: 'btn-blue',
|
||||
keys: ['enter'],
|
||||
action: function () {}
|
||||
@@ -513,8 +521,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>',
|
||||
] );
|
||||
@@ -532,8 +540,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>',
|
||||
] );
|
||||
@@ -545,7 +553,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>',
|
||||
@@ -560,7 +568,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>',
|
||||
@@ -573,8 +581,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(
|
||||
{
|
||||
@@ -603,18 +611,18 @@
|
||||
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 ); else: echo \S::normalize_decimal( $this -> product -> price_brutto ); endif;?>',
|
||||
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;?>',
|
||||
currency: 'PLN'
|
||||
});
|
||||
}
|
||||
<? 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({
|
||||
event: "add_to_cart",
|
||||
ecommerce: {
|
||||
@@ -622,9 +630,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,
|
||||
google_business_vertical: "retail"
|
||||
}
|
||||
@@ -783,6 +791,8 @@ console.log(direcion);
|
||||
|
||||
//* Galleria
|
||||
$( function () {
|
||||
if ( typeof Swiper === 'undefined' ) return;
|
||||
|
||||
var swiper = new Swiper(".mySwiper", {
|
||||
loop: false,
|
||||
spaceBetween: 4,
|
||||
@@ -809,6 +819,8 @@ console.log(direcion);
|
||||
//* grid row
|
||||
$( function ()
|
||||
{
|
||||
if ( typeof Swiper === 'undefined' ) return;
|
||||
|
||||
if ( $( ".otherProductsSwiper" ).length )
|
||||
{
|
||||
var swiper3 = new Swiper(".otherProductsSwiper", {
|
||||
@@ -887,3 +899,4 @@ console.log(direcion);
|
||||
})
|
||||
|
||||
</script>
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<?
|
||||
foreach ( $this -> products as $product ):
|
||||
if ( $product -> status ):
|
||||
echo \Tpl::view( 'shop-product/product-mini', [
|
||||
echo \Shared\Tpl\Tpl::view( 'shop-product/product-mini', [
|
||||
'product' => $product,
|
||||
'class' => 'item',
|
||||
'product_mini_class' => 'swiper-slide'
|
||||
|
||||
Reference in New Issue
Block a user