|
|
|
|
@@ -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,69 +19,69 @@
|
|
|
|
|
<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">
|
|
|
|
|
<h1><?= $this -> product -> language['name'];?></h1>
|
|
|
|
|
<h1><?= $this -> product['language']['name'];?></h1>
|
|
|
|
|
<div id="3f362dba-b3a2-4f6e-a950-ce0d10696fba"></div>
|
|
|
|
|
<script defer src="https://trustmate.io/widget/api/3f362dba-b3a2-4f6e-a950-ce0d10696fba/script?product=<?= $this -> product -> id;?>"></script>
|
|
|
|
|
<script defer src="https://trustmate.io/widget/api/3f362dba-b3a2-4f6e-a950-ce0d10696fba/script?product=<?= $this -> product['id'];?>"></script>
|
|
|
|
|
<div class="prices">
|
|
|
|
|
<? if ( $this -> product -> price_brutto_promo ):?>
|
|
|
|
|
<? if ( $this -> product['price_brutto_promo'] ):?>
|
|
|
|
|
|
|
|
|
|
<? if ( \shop\Shop::shortPrice( $this -> product -> price_brutto_promo )) : ?>
|
|
|
|
|
<? if ( \Shared\Helpers\Helpers::shortPrice( $this -> product['price_brutto_promo'] )) : ?>
|
|
|
|
|
<div class="flag flag-promotion" title="Produkt w promocji">Promocja</div>
|
|
|
|
|
<? endif; ?>
|
|
|
|
|
|
|
|
|
|
<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( $this -> product['id'], $this -> product['price_brutto_promo'] ) );?> zł</strong>
|
|
|
|
|
</div>
|
|
|
|
|
<? if ( $this -> product -> weight && $this -> product -> product_unit_id ):?>
|
|
|
|
|
<? if ( $this -> product['weight'] && $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( $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 @@
|
|
|
|
|
|
|
|
|
|
<div class="warehouse-message-box">
|
|
|
|
|
<img src="/upload/filemanager/icons/wysylka.svg" alt="">
|
|
|
|
|
<?= \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
|
|
|
|
|
@@ -109,7 +110,7 @@
|
|
|
|
|
<textarea class="form-control" id="product-message" name="product-message" rows="1" <? if ( $this -> product['additional_message_required'] ):?>required="required"<? endif;?> placeholder="<?= $this -> product['additional_message_text'] ? $this -> product['additional_message_text'] : '';?>"></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">
|
|
|
|
|
@@ -122,7 +123,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>
|
|
|
|
|
<?
|
|
|
|
|
@@ -131,8 +132,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;?>
|
|
|
|
|
@@ -140,11 +141,11 @@
|
|
|
|
|
</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;?>
|
|
|
|
|
<div class="short-description">
|
|
|
|
|
<?= $this -> product -> language['short_description'];?>
|
|
|
|
|
<?= $this -> product['language']['short_description'];?>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
@@ -153,51 +154,51 @@
|
|
|
|
|
<div class="row">
|
|
|
|
|
<div class="col-12">
|
|
|
|
|
<ul class="tabs" id="tabs-menu">
|
|
|
|
|
<li class="tab-link" 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" 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 current" id="tab-link-2" tab="2"><?= ucfirst( \S::lang( 'opinie' ) );?></li>
|
|
|
|
|
<li class="tab-link current" id="tab-link-2" tab="2"><?= ucfirst( \Shared\Helpers\Helpers::lang( 'opinie' ) );?></li>
|
|
|
|
|
</ul>
|
|
|
|
|
<? if ($this -> product -> language['description']): ?>
|
|
|
|
|
<? if ($this -> product['language']['description']): ?>
|
|
|
|
|
<div id="tab-0" class="tab-content hidden">
|
|
|
|
|
<?= $this -> product -> language['description'];?>
|
|
|
|
|
<?= $this -> product['language']['description'];?>
|
|
|
|
|
</div>
|
|
|
|
|
<? endif; ?>
|
|
|
|
|
<? if ( $this -> product -> language['tab_description_1'] ):?>
|
|
|
|
|
<? if ( $this -> product['language']['tab_description_1'] ):?>
|
|
|
|
|
<div id="tab-1" class="tab-content hidden">
|
|
|
|
|
<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 id="394f178c-745e-4515-ac11-72e5ba551978"></div>
|
|
|
|
|
<script defer src="https://trustmate.io/widget/api/394f178c-745e-4515-ac11-72e5ba551978/script?product=<?= $this -> product -> id;?>"></script>
|
|
|
|
|
<script defer src="https://trustmate.io/widget/api/394f178c-745e-4515-ac11-72e5ba551978/script?product=<?= $this -> product['id'];?>"></script>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="col-12">
|
|
|
|
|
<? 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 = 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'
|
|
|
|
|
] );
|
|
|
|
|
@@ -209,7 +210,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">
|
|
|
|
|
@@ -217,9 +218,9 @@
|
|
|
|
|
<div class="owl-carousel owl-theme">
|
|
|
|
|
<?
|
|
|
|
|
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'
|
|
|
|
|
] );
|
|
|
|
|
@@ -231,7 +232,7 @@
|
|
|
|
|
</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/OwlCarousel/owl.carousel.css">
|
|
|
|
|
@@ -248,14 +249,14 @@
|
|
|
|
|
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"
|
|
|
|
|
}
|
|
|
|
|
],
|
|
|
|
|
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;?>
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
<? endif;?>
|
|
|
|
|
@@ -283,17 +284,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' );
|
|
|
|
|
@@ -369,20 +370,20 @@
|
|
|
|
|
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,
|
|
|
|
|
closeIconClass: 'fa fa-times',
|
|
|
|
|
closeIconClass: 'fas fa-times',
|
|
|
|
|
typeAnimated: true,
|
|
|
|
|
animation: 'opacity',
|
|
|
|
|
useBootstrap: false,
|
|
|
|
|
theme: 'modern',
|
|
|
|
|
autoClose: 'confirm|5000',
|
|
|
|
|
icon: 'fa fa-exclamation',
|
|
|
|
|
icon: 'fas fa-exclamation',
|
|
|
|
|
buttons: {
|
|
|
|
|
confirm: {
|
|
|
|
|
text: '<?= \S::lang( 'zamknij' );?>',
|
|
|
|
|
text: '<?= \Shared\Helpers\Helpers::lang( 'zamknij' );?>',
|
|
|
|
|
btnClass: 'btn-blue',
|
|
|
|
|
keys: ['enter'],
|
|
|
|
|
action: function () {}
|
|
|
|
|
@@ -409,20 +410,20 @@
|
|
|
|
|
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,
|
|
|
|
|
closeIconClass: 'fa fa-times',
|
|
|
|
|
closeIconClass: 'fas fa-times',
|
|
|
|
|
typeAnimated: true,
|
|
|
|
|
animation: 'opacity',
|
|
|
|
|
useBootstrap: false,
|
|
|
|
|
theme: 'modern',
|
|
|
|
|
autoClose: 'confirm|5000',
|
|
|
|
|
icon: 'fa fa-exclamation',
|
|
|
|
|
icon: 'fas fa-exclamation',
|
|
|
|
|
buttons: {
|
|
|
|
|
confirm: {
|
|
|
|
|
text: '<?= \S::lang( 'zamknij' );?>',
|
|
|
|
|
text: '<?= \Shared\Helpers\Helpers::lang( 'zamknij' );?>',
|
|
|
|
|
btnClass: 'btn-blue',
|
|
|
|
|
keys: ['enter'],
|
|
|
|
|
action: function () {}
|
|
|
|
|
@@ -460,8 +461,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>',
|
|
|
|
|
] );
|
|
|
|
|
@@ -479,8 +480,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>',
|
|
|
|
|
] );
|
|
|
|
|
@@ -492,7 +493,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>',
|
|
|
|
|
@@ -507,7 +508,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>',
|
|
|
|
|
@@ -520,8 +521,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(
|
|
|
|
|
{
|
|
|
|
|
@@ -550,18 +551,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: {
|
|
|
|
|
@@ -569,9 +570,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"
|
|
|
|
|
}
|
|
|
|
|
|