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:
2026-02-21 23:00:54 +01:00
parent a605e0f4ad
commit fc45bbf20e
322 changed files with 35722 additions and 21849 deletions

View File

@@ -1,11 +1,11 @@
<? global $lang;?>
<?
$text = $this -> article['language']['text'];
$text = \front\factory\Articles::generateHeadersIds( $text );
$text = \front\Views\Articles::generateHeadersIds( $text );
?>
<div class="article article-<?= $this -> article['id'];?>">
<?
$this -> article['language']['seo_link'] ? $url = $this -> article['language']['seo_link'] : $url = 'a-' . $this -> article['id'] . '-' . \S::seo( $this -> article['language']['title'] );
$this -> article['language']['seo_link'] ? $url = $this -> article['language']['seo_link'] : $url = 'a-' . $this -> article['id'] . '-' . \Shared\Helpers\Helpers::seo( $this -> article['language']['title'] );
if ( $this -> article['show_title'] )
echo '<h3 class="article-title">' . $this -> article['language']['title'] . '</h3>';
@@ -46,16 +46,16 @@ $text = \front\factory\Articles::generateHeadersIds( $text );
<? if ( $this -> article['language']['table_of_contents'] ):?>
<div class="table-of-contents">
<div class="title">
<?= \S::lang( 'spis-tresci' );?>
<?= \Shared\Helpers\Helpers::lang( 'spis-tresci' );?>
</div>
<?= $this -> article['language']['table_of_contents'];?>
</div>
<? else:?>
<div class="table-of-contents">
<div class="title">
<?= \S::lang( 'spis-tresci' );?>
<?= \Shared\Helpers\Helpers::lang( 'spis-tresci' );?>
</div>
<?= \front\factory\Articles::generateTableOfContents( $text );?>
<?= \front\Views\Articles::generateTableOfContents( $text );?>
</div>
<? endif;?>
<? endif;?>
@@ -67,7 +67,11 @@ $text = \front\factory\Articles::generateHeadersIds( $text );
{
$article_tmp = explode( ':', $article_tmp );
if ( $article_tmp[1] != $this -> article['id'] )
$text = str_replace( '[ARTYKUL:' . $article_tmp[1] . ']', \front\view\Articles::article_full( $article_tmp[1], $lang_id ), $text );
{
$nestedArticleRepo = new \Domain\Article\ArticleRepository( $GLOBALS['mdb'] );
$nestedArticle = $nestedArticleRepo->articleDetailsFrontend( (int)$article_tmp[1], $lang_id );
$text = str_replace( '[ARTYKUL:' . $article_tmp[1] . ']', $nestedArticle ? \front\Views\Articles::fullArticle( $nestedArticle ) : '', $text );
}
else
$text = str_replace( '[ARTYKUL:' . $article_tmp[1] . ']', '', $text );
}
@@ -76,7 +80,7 @@ $text = \front\factory\Articles::generateHeadersIds( $text );
if ( strpos( $this -> article['language']['text'], '[GALERIA]' ) !== false )
{
if ( is_array( $this -> article['images'] ) ):
$tpl = new \Tpl;
$tpl = new \Shared\Tpl\Tpl;
$tpl -> article = $this -> article;
$tpl -> images = $this -> article['images'];
$gallery = $tpl -> render( 'articles/article-gallery' );
@@ -88,7 +92,7 @@ $text = \front\factory\Articles::generateHeadersIds( $text );
if ( strpos( $this -> article['language']['text'], '[ZALACZNIKI]' ) !== false )
{
if ( is_array( $this -> article['files'] ) ):
$tpl = new \Tpl;
$tpl = new \Shared\Tpl\Tpl;
$tpl -> article = $this -> article;
$tpl -> files = $this -> article['files'];
$files = $tpl -> render( 'articles/article-files' );
@@ -117,7 +121,7 @@ $text = \front\factory\Articles::generateHeadersIds( $text );
$images[] = $image;
}
$tpl = new \Tpl;
$tpl = new \Shared\Tpl\Tpl;
$tpl -> images = $images;
$tpl -> article_id = $this -> article['id'];
$tpl -> i = $i;
@@ -157,14 +161,14 @@ $text = \front\factory\Articles::generateHeadersIds( $text );
</div>
<?
if ( is_array( $this -> article['images'] ) and strpos( $this -> article['language']['text'], '[GALERIA]' ) === false ):
$tpl = new \Tpl;
$tpl = new \Shared\Tpl\Tpl;
$tpl -> article = $this -> article;
$tpl -> images = $this -> article['images'];
echo $tpl -> render( 'articles/article-gallery' );
endif;
if ( is_array( $this -> article['files'] ) and strpos( $this -> article['language']['text'], '[ZALACZNIKI]' ) === false ):
$tpl = new \Tpl;
$tpl = new \Shared\Tpl\Tpl;
$tpl -> article = $this -> article;
$tpl -> files = $this -> article['files'];
echo $tpl -> render( 'articles/article-files' );
@@ -185,4 +189,4 @@ $text = \front\factory\Articles::generateHeadersIds( $text );
}
});
});
</script>
</script>

View File

@@ -1,7 +1,7 @@
<? global $lang;?>
<?
$text = $this -> article['language']['text'];
$text = \front\factory\Articles::generateHeadersIds( $text );
$text = \front\Views\Articles::generateHeadersIds( $text );
?>
<div class="article article-<?= $this -> article['id'];?>">
<div class="row">
@@ -11,16 +11,16 @@ $text = \front\factory\Articles::generateHeadersIds( $text );
<? if ( $this -> article['language']['table_of_contents'] ):?>
<div class="table-of-contents">
<div class="title">
<?= \S::lang( 'spis-tresci' );?>
<?= \Shared\Helpers\Helpers::lang( 'spis-tresci' );?>
</div>
<?= $this -> article['language']['table_of_contents'];?>
</div>
<? else:?>
<div class="table-of-contents">
<div class="title">
<?= \S::lang( 'spis-tresci' );?>
<?= \Shared\Helpers\Helpers::lang( 'spis-tresci' );?>
</div>
<?= \front\factory\Articles::generateTableOfContents( $text );?>
<?= \front\Views\Articles::generateTableOfContents( $text );?>
</div>
<? endif;?>
<? endif;?>
@@ -42,7 +42,7 @@ $text = \front\factory\Articles::generateHeadersIds( $text );
endif;
?>
<?
$this -> article['language']['seo_link'] ? $url = $this -> article['language']['seo_link'] : $url = 'a-' . $this -> article['id'] . '-' . \S::seo( $this -> article['language']['title'] );
$this -> article['language']['seo_link'] ? $url = $this -> article['language']['seo_link'] : $url = 'a-' . $this -> article['id'] . '-' . \Shared\Helpers\Helpers::seo( $this -> article['language']['title'] );
if ( $this -> article['show_title'] )
echo '<h2 class="article-title">' . $this -> article['language']['title'] . '</h2>';
@@ -110,7 +110,7 @@ $text = \front\factory\Articles::generateHeadersIds( $text );
<span></span>
<span></span>
<span></span>
<div class="title"><?= ucfirst( \S::lang( 'podziel-sie-z-innymi' ) );?></div>
<div class="title"><?= ucfirst( \Shared\Helpers\Helpers::lang( 'podziel-sie-z-innymi' ) );?></div>
<div class="content">
<a class="fb" href="http://www.facebook.com/sharer.php?u=http://www.<?= $_SERVER['SERVER_NAME'];?>/<?= $url;?>" onclick="javascript:window.open(this.href, '', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=600,width=600');return false;" title="facebook" target="_blank" rel="nofollow">
<img src="/images/system/logo-facebook.jpg" alt="facebook" />

View File

@@ -3,7 +3,7 @@
</div>
<div id="menu-container-<?= $this -> menu['id'];?>" class="menu-container-<?= $this -> menu['id'];?>">
<nav>
<?= \front\view\Menu::pages( $this -> menu['pages'], 0, $this -> current_page );?>
<?= \front\Views\Menu::pages( $this -> menu['pages'], 0, $this -> current_page );?>
</nav>
</div>
<script class="footer" type="text/javascript" src="/libraries/multilevelpushmenu.js"></script>

View File

@@ -1,5 +1,5 @@
<div id="menu-container-<?= $this -> menu['id'];?>" class="menu-container-<?= $this -> menu['id'];?>">
<nav>
<?= \front\view\Menu::pages( $this -> menu['pages'], 0, $this -> current_page );?>
<?= \front\Views\Menu::pages( $this -> menu['pages'], 0, $this -> current_page );?>
</nav>
</div>

View File

@@ -1,6 +1,6 @@
<?
if ( is_array( $this -> pages ) ) {
$settings = \front\factory\Settings::settings_details();
$settings = ( new \Domain\Settings\SettingsRepository( $GLOBALS['mdb'] ) )->allSettings();
echo '<ul class="level-' . $this -> level . ' clear" level="' . $this -> level . '">';
@@ -10,11 +10,11 @@ if ( is_array( $this -> pages ) ) {
if ( $page['page_type'] == 3 ) {
$page['language']['link'] ? $url = $page['language']['link'] : $url = '#';
} else if ( $page['page_type'] == 5 ) {
$page['category_id'] ? $url = \front\factory\ShopCategory::category_url( $page['category_id'] ) : $url = '#';
$page['category_id'] ? $url = ( new \Domain\Category\CategoryRepository( $GLOBALS['mdb'] ) )->categoryUrl( (int)$page['category_id'], $GLOBALS['lang_id'] ) : $url = '#';
} else {
$page['language']['seo_link'] ? $url = '/' . $page['language']['seo_link'] : $url = '/s-' . $page['id'] . '-' . \S::seo( $page['language']['title'] );
$page['language']['seo_link'] ? $url = '/' . $page['language']['seo_link'] : $url = '/s-' . $page['id'] . '-' . \Shared\Helpers\Helpers::seo( $page['language']['title'] );
}
unset( $children );
$children = [];
if ( is_array( $page['pages'] ) ): foreach ( $page['pages'] as $page_tmp ):
$children[] = $page_tmp['id'];
@@ -34,8 +34,8 @@ if ( is_array( $this -> pages ) ) {
echo '">';
echo '<a href="';
if ( \S::get_session( 'current-lang' ) != \front\factory\Languages::default_language() and $url != '#' and $page['page_type'] != 3 and $page['page_type'] != 5 )
echo '/' . \S::get_session( 'current-lang' );
if ( \Shared\Helpers\Helpers::get_session( 'current-lang' ) != ( new \Domain\Languages\LanguagesRepository( $GLOBALS['mdb'] ) )->defaultLanguage() and $url != '#' and $page['page_type'] != 3 and $page['page_type'] != 5 )
echo '/' . \Shared\Helpers\Helpers::get_session( 'current-lang' );
echo $url . '"';
if ( $page['language']['noindex'] )
echo 'rel="nofollow"';
@@ -47,9 +47,9 @@ if ( is_array( $this -> pages ) ) {
echo '</a>';
if ( is_array( $page['pages'] ) )
echo '<i class="fa fa-chevron-down menu-toggle" menu-id="link-' . $page['id'] . '"></i>';
echo \front\view\Menu::pages( $page['pages'], $this -> level + 1, $this -> current_page );
echo \front\Views\Menu::pages( $page['pages'], $this -> level + 1, $this -> current_page );
echo '</li>';
}
echo '</ul>';
}
?>
?>

View File

@@ -5,22 +5,22 @@ if ( is_array( $this -> pages ) )
echo '<ul class="level-' . $this -> level . '" id="submenu-' . $this -> page_id . '">';
foreach ( $this -> pages as $page )
{
$page['language']['seo_link'] ? $url = '/' . $page['language']['seo_link'] : $url = '/s-' . $page['id'] . '-' . \S::seo( $page['language']['title'] );
$page['language']['seo_link'] ? $url = '/' . $page['language']['seo_link'] : $url = '/s-' . $page['id'] . '-' . \Shared\Helpers\Helpers::seo( $page['language']['title'] );
if ( $page['page_type'] == 3 and $page['link'] )
$url = $page['link'];
echo '<li id="link-' . $page['id'] . '" class="'; if ( $page['id'] == $this -> current_page ) echo ' active'; echo '">';
echo '<a href="';
if ( \S::get_session( 'current-lang' ) != \front\factory\Languages::default_language() and $url != '#' )
echo '/' . \S::get_session( 'current-lang' );
if ( \Shared\Helpers\Helpers::get_session( 'current-lang' ) != ( new \Domain\Languages\LanguagesRepository( $GLOBALS['mdb'] ) )->defaultLanguage() and $url != '#' )
echo '/' . \Shared\Helpers\Helpers::get_session( 'current-lang' );
echo $url . '"'; if ( $page['language']['noindex'] ) echo 'rel="nofollow"'; echo ' title="' . $page['language']['title'] . '"'; if ( is_array( $page['pages'] ) ) echo "class='menu-trigger'"; echo '>';
echo $page['language']['title'];
if ( is_array( $page['pages'] ) and $this -> level == 0 )
echo '<i class="fa fa-chevron-down"></i>';
echo '</a>';
echo \front\view\Menu::submenu( $page['pages'], $this -> current_page, $this -> page_id, $this -> level + 1 );
echo \front\Views\Menu::pages( $page['pages'], $this -> level + 1, $this -> current_page );
echo '</li>';
}
echo '</ul>';
}
}

View File

@@ -3,7 +3,7 @@
<div class="custom-field">
<div class="_name">
<?
$custom_field = \shop\ProductCustomField::getFromCache( $key );
$custom_field = ( new \Domain\Product\ProductRepository( $GLOBALS['mdb'] ) )->findCustomFieldCached( $key );
echo $custom_field['name'] . ':';
?>
</div>
@@ -12,4 +12,4 @@
</div>
</div>
<? endif;?>
<? endforeach; endif;?>
<? endforeach; endif;?>

View File

@@ -1,12 +1,24 @@
<div class="mini-box">
<h1 class="box-title"><?= ucfirst( \S::lang( 'zawartosc-koszyka' ) ); ?>:</h1>
<h1 class="box-title"><?= ucfirst( \Shared\Helpers\Helpers::lang( 'zawartosc-koszyka' ) ); ?>:</h1>
<div id="basket" class="content">
<? if ( is_array( $this -> basket ) and count($this->basket)) : ?>
<? foreach ($this->basket as $position_hash => $position) : ?>
<?
unset( $price );
unset( $price_new );
$product = new \shop\Product( (int)$position['product-id'], $this -> lang_id );
$product = (new \Domain\Product\ProductRepository($GLOBALS['mdb']))->findCached( (int)$position['product-id'], $this -> lang_id );
$permutation = null;
if ( isset( $position['parent_id'] ) and (int)$position['parent_id'] and isset( $position['product-id'] ) )
$permutation = (new \Domain\Product\ProductRepository($GLOBALS['mdb']))->getProductPermutationHash( (int)$position['product-id'] );
if ( !$permutation and isset( $position['attributes'] ) and is_array( $position['attributes'] ) and count( $position['attributes'] ) )
$permutation = implode( '|', $position['attributes'] );
$quantity_options = (new \Domain\Product\ProductRepository($GLOBALS['mdb']))->getProductPermutationQuantityOptions(
(int)( $position['parent_id'] ? $position['parent_id'] : $position['product-id'] ),
$permutation
);
$max_quantity = (int)$quantity_options['quantity'];
if ( !$max_quantity and (int)$quantity_options['stock_0_buy'] )
$max_quantity = 999;
?>
<div class="basket-product">
<div class="image">
@@ -18,10 +30,10 @@
</div>
<div class="details">
<?php
$url = \front\factory\ShopProduct::product_url( $product );
$url = \front\Views\ShopProduct::productUrl( $product );
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="name">
<a href="<?= $url; ?>"><?= $product['language']['name']; ?></a>
@@ -33,9 +45,10 @@
if ($row)
{
$row = explode('-', $row);
$attribute = \front\factory\ShopAttribute::attribute_details($row[0], $this->lang_id);
$attributeRepo = new \Domain\Attribute\AttributeRepository($GLOBALS['mdb']);
$attribute = $attributeRepo->frontAttributeDetails((int)$row[0], $this->lang_id);
echo '<div>' . $attribute['language']['name'] . ':</div>';
$value = \front\factory\ShopAttribute::value_details($row[1], $this->lang_id);
$value = $attributeRepo->frontValueDetails((int)$row[1], $this->lang_id);
echo '<div>' . $value['language']['name'] . '</div>';
}
?>
@@ -43,10 +56,10 @@
<? endforeach; ?>
<hr>
<? endif; ?>
<?= \Tpl::view( 'shop-basket/_partials/product-custom-fields', [
<?= \Shared\Tpl\Tpl::view( 'shop-basket/_partials/product-custom-fields', [
'custom_fields' => $position['custom_fields']
] ); ?>
<? if ( $product -> additional_message ):?>
<? if ( $product['additional_message'] ):?>
<div class="basket-product-message">
<textarea name="product-message" class="form-control" position="<?= $position_hash;?>" placeholder="Miejsce na dodatkową wiadomość"><?= htmlspecialchars( $position['message'] );?></textarea>
</div>
@@ -55,16 +68,16 @@
<div class="prices">
<div class="price">
<?
$price_product = \shop\Product::calculate_basket_product_price( (float)$product['price_brutto_promo'], (float)$product['price_brutto'], $this -> coupon, $position );
$price_product = \Domain\Basket\BasketCalculator::calculateBasketProductPrice( (float)$product['price_brutto_promo'], (float)$product['price_brutto'], $this -> coupon, $position );
if ( $price_product['price_new'] )
echo \S::decimal( $price_product['price_new'] ) . ' zł';
echo \Shared\Helpers\Helpers::decimal( $price_product['price_new'] ) . ' zł';
if ($price_product['price_new'] and $price_product['price_new'] < $price_product['price'])
echo '<u>' . \S::decimal( $price_product['price'] ) . ' zł</u>';
echo '<u>' . \Shared\Helpers\Helpers::decimal( $price_product['price'] ) . ' zł</u>';
if ($price_product['price_new'] and $price_product['price_new'] < $price_product['price'])
$discount += \S::normalize_decimal(($price_product['price'] - $price_product['price_new']) * $position['quantity']);
$discount += \Shared\Helpers\Helpers::normalize_decimal(($price_product['price'] - $price_product['price_new']) * $position['quantity']);
?>
</div>
</div>
@@ -72,7 +85,7 @@
<a href="#" class="btn btn-default btn-minus" product-hash="<?= $position_hash; ?>">
<i class="fa fa-minus"></i>
</a>
<input type="text" name="quantity" id="quantity" class="int-format form-control" min="1" max="<?= \shop\Product::get_product_quantity( (int)$position['product-id'] ); ?>" value="<?= $position['quantity']; ?>" product-hash="<?= $position_hash; ?>">
<input type="text" name="quantity" id="quantity" class="int-format form-control" min="1" max="<?= $max_quantity; ?>" value="<?= $position['quantity']; ?>" product-hash="<?= $position_hash; ?>">
<a href="#" class="btn btn-default btn-plus" product-hash="<?= $position_hash; ?>">
<i class="fa fa-plus"></i>
</a>
@@ -84,16 +97,16 @@
<? $summary += $price_product['price'] * $position['quantity'];?>
<? endforeach; ?>
<div class="basket-summary">
Wartość koszyka: <span class="price"><?= \S::decimal($summary); ?> zł</span>
Wartość koszyka: <span class="price"><?= \Shared\Helpers\Helpers::decimal($summary); ?> zł</span>
</div>
<? if ($discount) : ?>
<div class="basket-summary">
Rabat:
<span class="text-danger">-<?= \S::decimal($discount); ?> zł</span>
<span class="text-danger">-<?= \Shared\Helpers\Helpers::decimal($discount); ?> zł</span>
</div>
<div class="basket-summary">
Wartość koszyka po rabacie:
<span class="text-danger"><?= \S::decimal($summary - $discount); ?> zł</span>
<span class="text-danger"><?= \Shared\Helpers\Helpers::decimal($summary - $discount); ?> zł</span>
</div>
<? endif; ?>
<div class="basket-bottom">
@@ -101,8 +114,8 @@
<textarea name="basket-message" class="form-control" id="basket-message" placeholder="Dodatkowe informacje..."><?= htmlspecialchars($this->basket_message); ?></textarea>
</div>
<div class="coupon">
<?= \Tpl::view( 'shop-coupon/form', [
'coupon' => \S::get_session('coupon')
<?= \Shared\Tpl\Tpl::view( 'shop-coupon/form', [
'coupon' => \Shared\Helpers\Helpers::get_session('coupon')
] );
?>
</div>
@@ -111,4 +124,4 @@
<div class="alert alert-danger">Brak produktów w koszyku</div>
<? endif; ?>
</div>
</div>
</div>

View File

@@ -11,24 +11,24 @@
<div class="basket-options">
<div class="content">
<div class="left">
<div class="box-title"><?= ucfirst(\S::lang('dostawa')); ?>:</div>
<div class="box-title"><?= ucfirst(\Shared\Helpers\Helpers::lang('dostawa')); ?>:</div>
<div id="transport-methods">
<?= $this->transport_methods; ?>
</div>
<div class="inpost-map-container">
<a href="#" onclick="inpost_check(); return false;" class="inpost-hide"><?= \S::lang('zamknij'); ?></a>
<a href="#" onclick="inpost_check(); return false;" class="inpost-hide"><?= \Shared\Helpers\Helpers::lang('zamknij'); ?></a>
<div id="inpost-map"></div>
</div>
</div>
<div class="right">
<div class="box-title"><?= ucfirst(\S::lang('platnosc')); ?>:</div>
<div class="box-title"><?= ucfirst(\Shared\Helpers\Helpers::lang('platnosc')); ?>:</div>
<div id="payment-methods"></div>
</div>
</div>
</div>
<div class="row">
<div class="col-12">
<a href="/koszyk-podsumowanie" id="btn-basket-summary" class="btn btn-success disabled float-right"><span class="text"><?= ucfirst(\S::lang('przejdz-do-podsumowania')); ?></span></a>
<a href="/koszyk-podsumowanie" id="btn-basket-summary" class="btn btn-success disabled float-right"><span class="text"><?= ucfirst(\Shared\Helpers\Helpers::lang('przejdz-do-podsumowania')); ?></span></a>
</div>
</div>
<? endif; ?>
@@ -245,7 +245,7 @@
$.alert({
title: '<?= ucfirst(\S::lang('uwaga')); ?>',
title: '<?= ucfirst(\Shared\Helpers\Helpers::lang('uwaga')); ?>',
content: 'Proszę wybrać punkt odbioru',
type: 'blue',
closeIcon: true,
@@ -257,7 +257,7 @@
autoClose: 'confirm|5000',
buttons: {
confirm: {
text: '<?= \S::lang('zamknij'); ?>',
text: '<?= \Shared\Helpers\Helpers::lang('zamknij'); ?>',
btnClass: 'btn-blue',
keys: ['enter'],
action: function() {}
@@ -406,8 +406,8 @@
var product_hash = $(this).attr('product-hash');
$.alert({
title: '<?= ucfirst(\S::lang('potwierdz')); ?>',
content: '<?= \S::lang('potwierdz-usuniecie-produktu-z-koszyka'); ?>',
title: '<?= ucfirst(\Shared\Helpers\Helpers::lang('potwierdz')); ?>',
content: '<?= \Shared\Helpers\Helpers::lang('potwierdz-usuniecie-produktu-z-koszyka'); ?>',
closeIcon: true,
closeIconClass: 'fa fa-close',
typeAnimated: true,
@@ -417,7 +417,7 @@
autoClose: 'cancel|10000',
buttons: {
confirm: {
text: '<?= \S::lang('usun'); ?>',
text: '<?= \Shared\Helpers\Helpers::lang('usun'); ?>',
btnClass: 'btn-orange',
keys: ['enter'],
action: function() {
@@ -454,7 +454,7 @@
}
},
cancel: {
text: '<?= \S::lang('zamknij'); ?>',
text: '<?= \Shared\Helpers\Helpers::lang('zamknij'); ?>',
btnClass: 'btn-blue',
action: function() {}
}

View File

@@ -1,10 +1,10 @@
<? global $client, $lang_id;?>
<div class="basket-summary-container box">
<h1 class="box-title"><?= ucfirst( \S::lang( 'podsumowanie-zamowienia' ) );?>:</h1>
<h1 class="box-title"><?= ucfirst( \Shared\Helpers\Helpers::lang( 'podsumowanie-zamowienia' ) );?>:</h1>
<div id="basket-summary" class="content">
<? if ( is_array( $this -> basket ) and count( $this -> basket ) ):?>
<? foreach ( $this -> basket as $position_hash => $position ):?>
<? $product = new \shop\Product( $position[ 'product-id' ], $this -> lang_id );?>
<? $product = (new \Domain\Product\ProductRepository($GLOBALS['mdb']))->findCached( $position[ 'product-id' ], $this -> lang_id );?>
<div class="basket-product">
<div class="image">
<? if ( file_exists( substr( $product[ 'images' ][ 0 ][ 'src' ], 1 ) ) ):?>
@@ -15,10 +15,10 @@
</div>
<div class="details">
<?
$product[ 'language' ][ 'seo_link' ] ? $url = '/' . $product[ 'language' ][ 'seo_link' ] : $url = '/p-' . $product[ 'id' ] . '-' . \S::seo( $product[ 'language' ][ 'name' ] );
$product[ 'language' ][ 'seo_link' ] ? $url = '/' . $product[ 'language' ][ 'seo_link' ] : $url = '/p-' . $product[ 'id' ] . '-' . \Shared\Helpers\Helpers::seo( $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="name">
<a href="<?= $url;?>"><?= $product[ 'language' ][ 'name' ];?></a>
@@ -30,9 +30,10 @@
if ($row)
{
$row = explode('-', $row);
$attribute = \front\factory\ShopAttribute::attribute_details($row[0], $this->lang_id);
$attributeRepo = new \Domain\Attribute\AttributeRepository($GLOBALS['mdb']);
$attribute = $attributeRepo->frontAttributeDetails((int)$row[0], $this->lang_id);
echo '<span>' . $attribute['language']['name'] . ':</span> ';
$value = \front\factory\ShopAttribute::value_details($row[1], $this->lang_id);
$value = $attributeRepo->frontValueDetails((int)$row[1], $this->lang_id);
echo $value['language']['name'];
}
?>
@@ -40,7 +41,7 @@
<? endforeach; ?>
<hr>
<? endif;?>
<?= \Tpl::view( 'shop-basket/_partials/product-custom-fields', [
<?= \Shared\Tpl\Tpl::view( 'shop-basket/_partials/product-custom-fields', [
'custom_fields' => $position['custom_fields']
] ); ?>
<div class="product-message">
@@ -50,23 +51,23 @@
<div class="prices">
<div class="price">
<?
$price_product = \shop\Product::calculate_basket_product_price((float)$product['price_brutto_promo'], (float)$product['price_brutto'], $this -> coupon, $position);
$price_product = \Domain\Basket\BasketCalculator::calculateBasketProductPrice((float)$product['price_brutto_promo'], (float)$product['price_brutto'], $this -> coupon, $position);
if ($price_product['price_new'])
echo \S::decimal($price_product['price_new']) . ' zł';
echo \Shared\Helpers\Helpers::decimal($price_product['price_new']) . ' zł';
if ($price_product['price_new'] and $price_product['price_new'] < $price_product['price'])
echo '<u>' . \S::decimal($price_product['price']) . ' zł</u>';
echo '<u>' . \Shared\Helpers\Helpers::decimal($price_product['price']) . ' zł</u>';
if ($price_product['price_new'] and $price_product['price_new'] < $price_product['price'])
$discount += \S::normalize_decimal(($price_product['price'] - $price_product['price_new']) * $position['quantity']);
$discount += \Shared\Helpers\Helpers::normalize_decimal(($price_product['price'] - $price_product['price_new']) * $position['quantity']);
?>
<span>x <?= $position[ 'quantity' ];?> <?= \S::lang( 'szt' );?>.</span>
<?= \S::decimal( \S::normalize_decimal( $price_product['price_new'] * $position[ 'quantity' ] ) );?> zł
<span>x <?= $position[ 'quantity' ];?> <?= \Shared\Helpers\Helpers::lang( 'szt' );?>.</span>
<?= \Shared\Helpers\Helpers::decimal( \Shared\Helpers\Helpers::normalize_decimal( $price_product['price_new'] * $position[ 'quantity' ] ) );?> zł
</div>
</div>
</div>
<? $summary += \S::normalize_decimal( $price_product['price'] * $position[ 'quantity' ] );?>
<? $summary += \Shared\Helpers\Helpers::normalize_decimal( $price_product['price'] * $position[ 'quantity' ] );?>
<?
if ( $begin_checkout_items )
$begin_checkout_items .= ',';
@@ -74,7 +75,7 @@
$begin_checkout_items .= '{';
$begin_checkout_items .= '"id": "' . $product['id'] . '",';
$begin_checkout_items .= '"name": "' . $product['language']['name'] . '",';
$begin_checkout_items .= '"price": ' . \S::normalize_decimal( $price_product['price_new'] ) . ',';
$begin_checkout_items .= '"price": ' . \Shared\Helpers\Helpers::normalize_decimal( $price_product['price_new'] ) . ',';
$begin_checkout_items .= '"quantity": ' . $position['quantity'];
$begin_checkout_items .= '}';
?>
@@ -83,19 +84,19 @@
<div class="basket-summary">
Wartość koszyka:
<span>
<?= \S::decimal( $summary );?> zł
<?= \Shared\Helpers\Helpers::decimal( $summary );?> zł
</span>
</div>
<? if ( $discount ):?>
<div class="basket-summary">
Rabat:
<span class="text-danger">-<?= \S::decimal( $discount ); ?> zł</span>
<span class="text-danger">-<?= \Shared\Helpers\Helpers::decimal( $discount ); ?> zł</span>
</div>
<? endif;?>
<div class="basket-summary">
<?= $this -> transport[ 'name_visible' ];?>:
<span>
<?= $summary >= $this -> settings[ 'free_delivery' ] ? '0,00' : \S::decimal( $this -> transport[ 'cost' ] );?> zł
<?= $summary >= $this -> settings[ 'free_delivery' ] ? '0,00' : \Shared\Helpers\Helpers::decimal( $this -> transport[ 'cost' ] );?> zł
</span>
</div>
<div class="basket-summary big">
@@ -104,7 +105,7 @@
if ( $discount )
$summary -= $discount;
?>
<span id="order-summary"><?= $summary >= $this -> settings[ 'free_delivery' ] ? \S::decimal( $summary ) : \S::decimal( $summary + $this -> transport[ 'cost' ] );?> zł</span>
<span id="order-summary"><?= $summary >= $this -> settings[ 'free_delivery' ] ? \Shared\Helpers\Helpers::decimal( $summary ) : \Shared\Helpers\Helpers::decimal( $summary + $this -> transport[ 'cost' ] );?> zł</span>
</div>
<div class="basket-summary">
<?= $this -> payment_method[ 'name' ];?>
@@ -126,25 +127,25 @@
<? if ( !$this -> client ):?>
<div class="left">
<?=
\front\view\ShopClient::login_form( [
\front\Views\ShopClient::loginForm( [
'long' => true
] );
?>
</div>
<div class="right">
<?= \Tpl::view( 'shop-basket/address-form', [
<?= \Shared\Tpl\Tpl::view( 'shop-basket/address-form', [
'transport_method' => $this -> transport
] );?>
</div>
<? else:?>
<?= \Tpl::view( 'shop-basket/address-form', [
<?= \Shared\Tpl\Tpl::view( 'shop-basket/address-form', [
'client' => $this -> client,
'addresses' => $this -> addresses,
'transport_method' => $this -> transport
] );?>
<? endif;?>
</div>
<a href="/koszyk" class="btn btn-dark"><?= \S::lang( 'wroc-do-koszyka' );?></span></a>
<a href="/koszyk" class="btn btn-dark"><?= \Shared\Helpers\Helpers::lang( 'wroc-do-koszyka' );?></span></a>
</div>
<? endif;?>
</div>
@@ -165,11 +166,11 @@
event: "begin_checkout",
ecommerce: {
currency: "PLN",
value: <?= \S::normalize_decimal( \front\factory\ShopBasket::summary_price( $this -> basket, $this -> coupon ) );?>,
value: <?= \Shared\Helpers\Helpers::normalize_decimal( \Domain\Basket\BasketCalculator::summaryPrice( $this -> basket, $this -> coupon ) );?>,
items: [
<?= $begin_checkout_items;?>
]
}
});
<? endif;?>
</script>
</script>

View File

@@ -7,9 +7,9 @@ $hash = md5( time() . rand( 0, 9999999999 ) );
<div class="swiper-wrapper">
<?
foreach ( $this -> products as $product ):
$product_obj = \shop\Product::getFromCache( (int)$product, $lang_id );
if ( $product_obj -> status ):
echo \Tpl::view( 'shop-product/product-mini', [
$product_obj = (new \Domain\Product\ProductRepository($GLOBALS['mdb']))->findCached( (int)$product, $lang_id );
if ( $product_obj and $product_obj['status'] ):
echo \Shared\Tpl\Tpl::view( 'shop-product/product-mini', [
'product' => $product_obj,
'class' => 'item',
'product_mini_class' => 'swiper-slide'
@@ -69,4 +69,4 @@ $hash = md5( time() . rand( 0, 9999999999 ) );
});
}
});
</script>
</script>

View File

@@ -1,28 +1,27 @@
<? global $lang_id; ?>
<? if ($this->query) : ?>
<div class="box-title">
<?= \S::lang('wyniki-wyszukiwania-dla-zapytania') . ': <strong>' . $this->query . '</strong>'; ?>
<?= \Shared\Helpers\Helpers::lang('wyniki-wyszukiwania-dla-zapytania') . ': <strong>' . $this->query . '</strong>'; ?>
</div>
<? endif; ?>
<?
if ($this->category_additional_text) :
echo \Tpl::view('shop-category/_partials/category-additional-text', [
echo \Shared\Tpl\Tpl::view('shop-category/_partials/category-additional-text', [
'category' => $this->category
]);
endif;
?>
<div class="category-content">
<? if (is_array($this->products)) : foreach ($this->products as $product_id) :
$product = new \shop\Product($product_id);
echo \Tpl::view('shop-product/product-mini', [
'product' => new \shop\Product($product_id, $lang_id)
echo \Shared\Tpl\Tpl::view('shop-product/product-mini', [
'product' => (new \Domain\Product\ProductRepository($GLOBALS['mdb']))->findCached( $product_id, $lang_id )
]);
endforeach;
endif; ?>
</div>
<?
if ($this->category_description) :
echo \Tpl::view('shop-category/category-description', [
echo \Shared\Tpl\Tpl::view('shop-category/category-description', [
'category' => $this->category
]);
endif;
@@ -73,4 +72,4 @@ endif;
$( document ).on( 'scroll', checkScroll );
loadProducts();
});
</script>
</script>

View File

@@ -1,27 +1,27 @@
<? global $lang_id;?>
<? if ( $this -> query ):?>
<div class="box-title">
<?= \S::lang( 'wyniki-wyszukiwania-dla-zapytania' ) . ': <strong>' . $this -> query . '</strong>';?>
<?= \Shared\Helpers\Helpers::lang( 'wyniki-wyszukiwania-dla-zapytania' ) . ': <strong>' . $this -> query . '</strong>';?>
</div>
<? endif;?>
<?
if ( $this -> category_additional_text ):
echo \Tpl::view( 'shop-category/_partials/category-additional-text', [
echo \Shared\Tpl\Tpl::view( 'shop-category/_partials/category-additional-text', [
'category' => $this -> category
] );
endif;
?>
<?php
if ( $this -> category['view_subcategories'] ):
echo \Tpl::view( 'shop-category/_partials/category-subcategory-tiles', [
'categories' => \shop\Category::get_subcategory_by_category( $this -> category['id'] ),
echo \Shared\Tpl\Tpl::view( 'shop-category/_partials/category-subcategory-tiles', [
'categories' => ( new \Domain\Category\CategoryRepository( $GLOBALS['mdb'] ) )->categoriesTree( $lang_id, (int)$this -> category['id'] ),
] );
endif;
?>
<div class="category-content">
<? if ( is_array( $this -> products ) ): foreach ( $this -> products as $product_id ):
$product = \shop\Product::getFromCache( $product_id, $lang_id );
echo \Tpl::view( 'shop-product/product-mini', [
$product = (new \Domain\Product\ProductRepository($GLOBALS['mdb']))->findCached( $product_id, $lang_id );
echo \Shared\Tpl\Tpl::view( 'shop-product/product-mini', [
'product' => $product
] );
endforeach; endif;?>
@@ -29,8 +29,8 @@ endif;
<?= $this -> pager;?>
<?
if ( $this -> category_description ):
echo \Tpl::view( 'shop-category/category-description', [
echo \Shared\Tpl\Tpl::view( 'shop-category/category-description', [
'category' => $this -> category
] );
endif;
?>
?>

View File

@@ -1,28 +1,28 @@
<? global $config; $this -> settings['ssl'] ? $base = 'https' : $base = 'http';?>
<? global $config; $this -> settings['ssl'] ? $base = 'https' : $base = 'http'; $base_secure = 'https'; $paymentRepo = new \Domain\PaymentMethod\PaymentMethodRepository( $GLOBALS['mdb'] );?>
<div class="order-summary">
<div class="box-title">
<?= ucfirst( \S::lang( 'szczegoly-zamowienia' ) );?>: <?= $this -> order['number'];?>
<?= ucfirst( \Shared\Helpers\Helpers::lang( 'szczegoly-zamowienia' ) );?>: <?= $this -> order['number'];?>
</div>
<?= \Tpl::view( 'shop-order/order-simple', [
<?= \Shared\Tpl\Tpl::view( 'shop-order/order-simple', [
'order' => $this -> order,
'coupon' => $this -> coupon,
'statuses' => \shop\Order::order_statuses()
'statuses' => ( new \Domain\Order\OrderRepository( $GLOBALS['mdb'] ) )->orderStatuses()
] );?>
<? if ( $this -> order['status'] == 0 or $this -> order['status'] == 2 ):?>
<div class="order-bottom">
<div class="left">
<div class="content">
<div class="box-title"><?= ucfirst( \S::lang( 'dane-do-przelewu' ) );?>:</div>
<?= str_replace( [ '[KWOTA]', '[NR-ZAMOWIENIA]' ], [ \S::decimal( $this -> order['summary'] ) . ' zł', $this -> order['number'] ], $this -> settings['shop_bank_account_info'] );?>
<div class="box-title"><?= ucfirst( \Shared\Helpers\Helpers::lang( 'dane-do-przelewu' ) );?>:</div>
<?= str_replace( [ '[KWOTA]', '[NR-ZAMOWIENIA]' ], [ \Shared\Helpers\Helpers::decimal( $this -> order['summary'] ) . ' zł', $this -> order['number'] ], $this -> settings['shop_bank_account_info'] );?>
</div>
</div>
<div class="right">
<div class="content">
<div class="box-title"><?= $this -> order['payment_method_id'] == 6 ? 'Zapłać za pomocą PAYPO' : ucfirst( \S::lang( 'platnosc-online' ) );?>:</div>
<div class="box-title"><?= $this -> order['payment_method_id'] == 6 ? 'Zapłać za pomocą PAYPO' : ucfirst( \Shared\Helpers\Helpers::lang( 'platnosc-online' ) );?>:</div>
<? if ( $this -> order['payment_method_id'] == 1 or $this -> order['payment_method_id'] == 3 ):?>
<div class="payment-info">Co prawda nie wybrałeś żadnej z dostępnych form "szybkich płatności", ale w każdej chwili możesz z nich skorzystać.</div>
<? endif;?>
<? if ( ( $this -> order['payment_method_id'] == 2 or $this -> order['payment_method_id'] == 1 or $this -> order['payment_method_id'] == 3 ) and \front\factory\ShopPaymentMethod::is_payment_active( 2 ) ):?>
<? if ( ( $this -> order['payment_method_id'] == 2 or $this -> order['payment_method_id'] == 1 or $this -> order['payment_method_id'] == 3 ) and $paymentRepo->isActive( 2 ) ):?>
<form id="order" action="https://platnosc.hotpay.pl/" method="post">
<input required name="SEKRET" value="<?= $this -> settings['hotpay_api'];?>" type="hidden">
<input required name="KWOTA" value="<?= round( $this -> order['summary'], 2 );?>" type="hidden">
@@ -33,17 +33,17 @@
<input name="DANE_OSOBOWE" value="" type="hidden">
<div class="form-group row agreement">
<div class="col-12">
<input type="checkbox" required id="agreement"> <?= \S::lang( 'akceptuje-regulamin-sklepu' );?>
<input type="checkbox" required id="agreement"> <?= \Shared\Helpers\Helpers::lang( 'akceptuje-regulamin-sklepu' );?>
</div>
</div>
<div class="form-group row agreement">
<div class="col-12">
<button type="submit" class="btn btn-success"><?= \S::lang( 'zaplac-online' );?> <b><?= \S::decimal( $this -> order['summary'] );?> zł</b></button>
<button type="submit" class="btn btn-success"><?= \Shared\Helpers\Helpers::lang( 'zaplac-online' );?> <b><?= \Shared\Helpers\Helpers::decimal( $this -> order['summary'] );?> zł</b></button>
</div>
</div>
</form>
<? endif;?>
<? if ( $this -> order['payment_method_id'] == 6 and \front\factory\ShopPaymentMethod::is_payment_active( 6 ) ):?>
<? if ( $this -> order['payment_method_id'] == 6 and $paymentRepo->isActive( 6 ) ):?>
<?
global $mdb;
$przelewy24_hash = md5( time() );
@@ -69,13 +69,13 @@
<input type="hidden" name="p24_wait_for_result" value="1">
<input type="hidden" name="p24_method" value="227">
<input type="hidden" name="p24_sign" value="<?= md5( $przelewy24_hash . '|' . $this -> settings['przelewy24_merchant_id'] . '|' . ( $this -> order['summary'] * 100 ) . '|PLN|' . $this -> settings['przelewy24_crc_key'] );?>" />
<button type="submit" name="submit_send" class="btn btn-success">Zapłać za pomocą PAYPO&nbsp;<b><?= \S::decimal( $this -> order['summary'] );?> zł</b></button>
<button type="submit" name="submit_send" class="btn btn-success">Zapłać za pomocą PAYPO&nbsp;<b><?= \Shared\Helpers\Helpers::decimal( $this -> order['summary'] );?> zł</b></button>
</form>
<? endif;?>
<? if ( $this -> order['payment_method_id'] == 6 ):?>
<div class="box-title">lub skorzystaj z płatności online</div>
<? endif;?>
<? if ( ( $this -> order['payment_method_id'] == 6 or $this -> order['payment_method_id'] == 4 or $this -> order['payment_method_id'] == 1 or $this -> order['payment_method_id'] == 3 ) and \front\factory\ShopPaymentMethod::is_payment_active( 4 ) ):?>
<? if ( ( $this -> order['payment_method_id'] == 6 or $this -> order['payment_method_id'] == 4 or $this -> order['payment_method_id'] == 1 or $this -> order['payment_method_id'] == 3 ) and $paymentRepo->isActive( 4 ) ):?>
<?
global $mdb;
$przelewy24_hash = md5( time() );
@@ -100,11 +100,11 @@
<input type="hidden" name="p24_api_version" value="3.2" />
<input type="hidden" name="p24_wait_for_result" value="1">
<input type="hidden" name="p24_sign" value="<?= md5( $przelewy24_hash . '|' . $this -> settings['przelewy24_merchant_id'] . '|' . ( $this -> order['summary'] * 100 ) . '|PLN|' . $this -> settings['przelewy24_crc_key'] );?>" />
<button type="submit" name="submit_send" class="btn btn-success"><?= \S::lang( 'zaplac-online' );?>&nbsp;<b><?= \S::decimal( $this -> order['summary'] );?> zł</b></button>
<button type="submit" name="submit_send" class="btn btn-success"><?= \Shared\Helpers\Helpers::lang( 'zaplac-online' );?>&nbsp;<b><?= \Shared\Helpers\Helpers::decimal( $this -> order['summary'] );?> zł</b></button>
</form>
<? endif;?>
<?
if ( ( $this -> order['payment_method_id'] == 6 or $this -> order['payment_method_id'] == 5 or $this -> order['payment_method_id'] == 1 or $this -> order['payment_method_id'] == 3 ) and \front\factory\ShopPaymentMethod::is_payment_active( 5 ) ):
if ( ( $this -> order['payment_method_id'] == 6 or $this -> order['payment_method_id'] == 5 or $this -> order['payment_method_id'] == 1 or $this -> order['payment_method_id'] == 3 ) and $paymentRepo->isActive( 5 ) ):
$url = 'https://secure.tpay.com';
@@ -119,12 +119,12 @@
$url .= '&email=' . urlencode( $this -> order['client_email'] );
$url .= '&nazwisko=' . urlencode( $this -> order['client_name'] . ' ' . $this -> order['client_surname'] );
$url .= '&crc=' . $this -> order['hash'];
$url .= '&result_url=' . urlencode( $base . "://" . $_SERVER['SERVER_NAME'] . '/tpay-status' );
$url .= '&return_url=' . urlencode( $base . "://" . $_SERVER['SERVER_NAME'] . '/potwierdzenie-platnosci/' . $this -> order['hash'] );
$url .= '&return_error_url=' . urlencode( $base . "://" . $_SERVER['SERVER_NAME'] . '/zamowienie/' . $this -> order['hash'] );
$url .= '&result_url=' . urlencode( $base_secure . "://" . $_SERVER['SERVER_NAME'] . '/tpay-status' );
$url .= '&return_url=' . urlencode( $base_secure . "://" . $_SERVER['SERVER_NAME'] . '/potwierdzenie-platnosci/' . $this -> order['hash'] );
$url .= '&return_error_url=' . urlencode( $base_secure . "://" . $_SERVER['SERVER_NAME'] . '/zamowienie/' . $this -> order['hash'] );
$url .= '&md5sum=' . md5( $id . '&' . str_replace( ',', '.', round( $this -> order['summary'], 2 ) ) . '&' . $this -> order['hash'] . '&' . $code );
?>
<button type="button" onclick="document.location.href='<?= $url;?>'" class="btn btn-success"><?= \S::lang( 'zaplac-online' );?> <?= \S::decimal( $this -> order['summary'] );?> zł</b></button>
<button type="button" onclick="document.location.href='<?= $url;?>'" class="btn btn-success"><?= \Shared\Helpers\Helpers::lang( 'zaplac-online' );?> <?= \Shared\Helpers\Helpers::decimal( $this -> order['summary'] );?> zł</b></button>
<? endif;?>
</div>
</div>
@@ -141,7 +141,7 @@
radioClass: 'iradio_minimal-blue'
});
<? if ( \S::get_session( 'piksel_purchase' ) and $this -> settings[ 'piksel' ] ):?>
<? if ( \Shared\Helpers\Helpers::get_session( 'piksel_purchase' ) and $this -> settings[ 'piksel' ] ):?>
<? unset( $_SESSION['piksel_purchase'] );?>
fbq(
'track',
@@ -157,15 +157,15 @@
} );
<? endif;?>
<? if ( \S::get_session('google-analytics-purchase') ):?>
<? if ( \Shared\Helpers\Helpers::get_session('google-analytics-purchase') ):?>
<? if ( $this -> settings['google_tag_manager_id'] ):?>
dataLayer.push({
event: "purchase",
ecommerce: {
transaction_id: "<?= $this -> order['id'];?>",
currency: "PLN",
value: <?= \S::normalize_decimal( round( $this -> order['summary'], 2 ) ) - str_replace( ',', '.', round( $this -> order['transport_cost'], 2 ) );?>,
shipping: <?= \S::normalize_decimal( $this -> order['transport_cost'] );?>,
value: <?= \Shared\Helpers\Helpers::normalize_decimal( round( $this -> order['summary'], 2 ) ) - str_replace( ',', '.', round( $this -> order['transport_cost'], 2 ) );?>,
shipping: <?= \Shared\Helpers\Helpers::normalize_decimal( $this -> order['transport_cost'] );?>,
user_email: "<?= $this -> order['client_email'] ?>",
user_phone: "<?= $this -> order['client_phone'] ?>",
user_name: "<?= $this -> order['client_name'] ?>",
@@ -191,4 +191,4 @@
<? unset( $_SESSION['google-adwords-purchase'] );?>
<? endif;?>
});
</script>
</script>

View File

@@ -1,25 +1,25 @@
<? global $lang_id;?>
<?
$this -> product -> language['seo_link'] ? $url = '/' . $this -> product -> language['seo_link'] : $url = '/p-' . $this -> product['id'] . '-' . \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>

View File

@@ -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>

View File

@@ -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'

View File

@@ -0,0 +1,68 @@
<? $hash = md5( time() . rand( 0, 9999999999 ) );?>
<div class="products-box-<?= $hash;?>">
<div class="swiper">
<div class="swiper-wrapper">
<?
foreach ( $this -> products as $product ):
if ( $product -> status ):
echo \Shared\Tpl\Tpl::view( 'shop-product/product-mini', [
'product' => $product,
'class' => 'item',
'product_mini_class' => 'swiper-slide'
] );
endif;
endforeach;
?>
</div>
</div>
<div class="swiper-button-next products-box-<?= $hash;?>-next"></div>
<div class="swiper-button-prev products-box-<?= $hash;?>-prev"></div>
</div>
<script class="footer" type="text/javascript">
$( function()
{
if( $( ".products-box-<?= $hash;?> .swiper").length ) {
const swiper<?= $hash;?> = new Swiper(".products-box-<?= $hash;?> .swiper", {
slidesPerView: 6,
spaceBetween: 30,
initialSlide : 1,
centeredSlides: true,
lazy: true,
pagination: {
el: ".swiper-pagination",
clickable: true,
},
navigation: {
nextEl: ".products-box-<?= $hash;?>-next",
prevEl: ".products-box-<?= $hash;?>-prev",
},
breakpoints: {
1400: {
slidesPerView: 6,
},
1200: {
slidesPerView: 5,
},
991: {
slidesPerView: 4,
},
576: {
slidesPerView: 3,
},
300: {
slidesPerView: 2,
},
200: {
slidesPerView: 1,
}
},
on: {
slideChange: function() {
observer.observe();
}
}
});
}
});
</script>