Add view classes for articles, banners, languages, menu, newsletter, containers, shop categories, clients, payment methods, products, and search

- Created Articles.php for rendering article views including full articles, miniature lists, and news sections.
- Added Banners.php for handling banner displays.
- Introduced Languages.php for rendering language options.
- Implemented Menu.php for dynamic menu rendering.
- Developed Newsletter.php for newsletter view rendering.
- Created Scontainers.php for rendering specific containers.
- Added ShopCategory.php for category descriptions and product listings.
- Introduced ShopClient.php for managing client-related views such as address editing and order history.
- Implemented ShopPaymentMethod.php for displaying payment methods in the basket.
- Created ShopProduct.php for generating product URLs.
- Added ShopSearch.php for rendering a simple search form.
- Added .htaccess file to enhance security by restricting access to sensitive files and directories.
This commit is contained in:
2026-02-21 23:00:15 +01:00
parent b51244c1d6
commit 3ecbe628dc
435 changed files with 44107 additions and 31270 deletions

View File

@@ -1,12 +1,12 @@
<? global $lang;?>
<div class="col-12 col-sm-6 ">
<div class="article-entry">
<? $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'] );?>
<div class="blog-image">
<a href="/<?= $url;?>" title="<?= $this -> article['language']['title'];?>" <? if ( $this -> article['language']['noindex'] ):?>rel="nofollow"<? endif;?>> <img src="<?= \front\factory\Articles::get_image( $this -> article );?>" alt="<?= $this -> article['language']['title'];?>"></a>
<a href="/<?= $url;?>" title="<?= $this -> article['language']['title'];?>" <? if ( $this -> article['language']['noindex'] ):?>rel="nofollow"<? endif;?>> <img src="<?= \front\Views\Articles::getImage( $this -> article );?>" alt="<?= $this -> article['language']['title'];?>"></a>
</div>
<h3 class="article-title">
<a href="/<? if ( \S::get_session( 'current-lang' ) != \front\factory\Languages::default_language() ) echo \S::get_session( 'current-lang' ) . '/';?><?= $url;?>" title="<?= $this -> article['language']['title'];?>" <? if ( $this -> article['language']['noindex'] ):?>rel="nofollow"<? endif;?>><?= $this -> article['language']['title'];?></a>
<a href="/<? if ( \Shared\Helpers\Helpers::get_session( 'current-lang' ) != (new \Domain\Languages\LanguagesRepository( $GLOBALS['mdb'] ))->defaultLanguage() ) echo \Shared\Helpers\Helpers::get_session( 'current-lang' ) . '/';?><?= $url;?>" title="<?= $this -> article['language']['title'];?>" <? if ( $this -> article['language']['noindex'] ):?>rel="nofollow"<? endif;?>><?= $this -> article['language']['title'];?></a>
</h3>
<div class="entry">
<?

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">
<div class="row">
@@ -16,7 +16,7 @@ $text = \front\factory\Articles::generateHeadersIds( $text );
<? else:?>
<div class="table-of-contents">
<div class="title">Spis treści</div>
<?= \front\factory\Articles::generateTableOfContents( $text );?>
<?= \front\Views\Articles::generateTableOfContents( $text );?>
</div>
<? endif;?>
<? endif;?>
@@ -38,7 +38,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>';
@@ -106,7 +106,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

@@ -7,10 +7,10 @@
<? foreach ($this->articles as $article) : ?>
<li class="splide__slide">
<div class="article-list">
<? $article['language']['seo_link'] ? $url = $article['language']['seo_link'] : $url = 'a-' . $article['id'] . '-' . \S::seo($article['language']['title']); ?>
<? $article['language']['seo_link'] ? $url = $article['language']['seo_link'] : $url = 'a-' . $article['id'] . '-' . \Shared\Helpers\Helpers::seo($article['language']['title']); ?>
<a href="/<?= $url; ?>" title="<?= $article['language']['title']; ?>" <? if ($article['language']['noindex']) : ?>rel="nofollow" <? endif; ?>>
<div class="blog-image">
<img src="<?= \front\factory\Articles::get_image($article); ?>" alt="<?= $article['language']['title']; ?>">
<img src="<?= \front\Views\Articles::getImage($article); ?>" alt="<?= $article['language']['title']; ?>">
</div>
<div class="article-list-text-container">
<h3 class="article-title"><?= $article['language']['title']; ?></h3>
@@ -51,10 +51,10 @@
<? foreach ($this->articles as $article) : ?>
<div class="col-12 col-lg-6 col-xl-3">
<div class="article-list">
<? $article['language']['seo_link'] ? $url = $article['language']['seo_link'] : $url = 'a-' . $article['id'] . '-' . \S::seo($article['language']['title']); ?>
<? $article['language']['seo_link'] ? $url = $article['language']['seo_link'] : $url = 'a-' . $article['id'] . '-' . \Shared\Helpers\Helpers::seo($article['language']['title']); ?>
<a href="/<?= $url; ?>" title="<?= $article['language']['title']; ?>" <? if ($article['language']['noindex']) : ?>rel="nofollow" <? endif; ?>>
<div class="blog-image">
<img src="<?= \front\factory\Articles::get_image($article); ?>" alt="<?= $article['language']['title']; ?>">
<img src="<?= \front\Views\Articles::getImage($article); ?>" alt="<?= $article['language']['title']; ?>">
<div class="date-add"><?= date('d.m.y', strtotime($article['date_add'])); ?></div>
</div>
<h3 class="article-title"><?= $article['language']['title']; ?></h3>

View File

@@ -40,10 +40,10 @@
</div>
<div class="col-md-12 col-lg-3 col-xl-3 mb-5 mb-lg-0">
<div class="box-title">O firmie</div>
<?= \front\view\Menu::menu( \front\factory\Menu::menu_details( 2 ), $page['id'] ); ?>
<?= \front\Views\Menu::menu( (new \Domain\Pages\PagesRepository( $GLOBALS['mdb'] ))->frontMenuDetails( 2, $GLOBALS['lang_id'] ), $page['id'] ); ?>
</div>
<div class="col-md-12 col-lg-3 col-xl-3 mb-5 mb-lg-0">
<?= \front\view\Scontainers::scontainer( 11 ); ?>
<?= \front\Views\Scontainers::scontainer( 11 ); ?>
</div>
<div class="col-md-12 col-lg-3 col-xl-3 mb-5 mb-lg-0">
<div class="box-title">Dołącz do nas</div>
@@ -62,7 +62,7 @@
</ul>
</nav>
<!-- <?= \front\view\Scontainers::scontainer( 16 ); ?> -->
<!-- <?= \front\Views\Scontainers::scontainer( 16 ); ?> -->
</div>
</div>
</div>
@@ -71,7 +71,7 @@
<div class="container">
<div class="row">
<div class="col-12 col-lg-8">
<?= \front\view\Site::copyright(); ?>
<?= \front\LayoutEngine::copyright(); ?>
</div>
<div class="col-12 col-lg-4"></div>
</div>

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,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,9 +10,9 @@ 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 );
@@ -26,7 +26,7 @@ if ( is_array( $this -> pages ) ) {
if ( $page['id'] == $this -> current_page )
echo ' active';
if ( is_array( $page['pages'] ) and in_array( $this -> current_page, $children ) )
if ( is_array( $page['pages'] ) and is_array( $children ) and in_array( $this -> current_page, $children ) )
echo ' open';
if ( is_array( $page['pages'] ) )
@@ -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,7 +47,7 @@ if ( is_array( $this -> pages ) ) {
if ( is_array( $page['pages'] ) )
echo '<i class="fa fa-chevron-down menu-toggle" menu-id="link-' . $page['id'] . '"></i>';
echo '</a>';
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

@@ -43,7 +43,7 @@
content: '<?= $lang['newsletter-zgoda-komunikat'];?>',
type: 'blue',
closeIcon: true,
closeIconClass: 'fa fa-times',
closeIconClass: 'fas fa-times',
typeAnimated: true,
animation: 'opacity',
useBootstrap: false,
@@ -74,7 +74,7 @@
content: '<?= $lang['newsletter-prosze-uzupelnic-email'];?>',
type: 'orange',
closeIcon: true,
closeIconClass: 'fa fa-times',
closeIconClass: 'fas fa-times',
typeAnimated: true,
animation: 'opacity',
useBootstrap: false,
@@ -111,7 +111,7 @@
content: '<?= $lang['prosze-czekac'];?>',
type: 'orange',
closeIcon: true,
closeIconClass: 'fa fa-times',
closeIconClass: 'fas fa-times',
typeAnimated: true,
animation: 'opacity',
useBootstrap: false,
@@ -147,7 +147,7 @@
content: msg,
type: 'orange',
closeIcon: true,
closeIconClass: 'fa fa-times',
closeIconClass: 'fas fa-times',
typeAnimated: true,
animation: 'opacity',
useBootstrap: false,

View File

@@ -1,12 +1,12 @@
<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 );
?>
<div class="basket-product">
<div class="image">
@@ -18,10 +18,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,19 +33,21 @@
if ($row)
{
$row = explode('-', $row);
$attribute = \front\factory\ShopAttribute::attribute_details($row[0], $this->lang_id);
echo '<span>' . $attribute['language']['name'] . ':</span> ';
$value = \front\factory\ShopAttribute::value_details($row[1], $this->lang_id);
echo $value['language']['name'];
$attributeRepo = new \Domain\Attribute\AttributeRepository($GLOBALS['mdb']);
$attribute = $attributeRepo->frontAttributeDetails((int)$row[0], $this->lang_id);
echo '<div>' . $attribute['language']['name'] . ':</div>';
$value = $attributeRepo->frontValueDetails((int)$row[1], $this->lang_id);
echo '<div>' . $value['language']['name'] . '</div>';
}
?>
</div>
<? 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>
@@ -54,16 +56,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>
@@ -71,7 +73,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="<?= (new \Domain\Product\ProductRepository($GLOBALS['mdb']))->getQuantity( (int)$position['product-id'] ); ?>" 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>
@@ -83,16 +85,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">
@@ -100,8 +102,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>

View File

@@ -7,7 +7,7 @@
<div class="basket-details">
<div class="title">Twój koszyk</div>
<div class="details">
<b><?= ucfirst( $lang['ilosc'] );?></b>: <span id="products-count"><?= $count = \front\factory\ShopBasket::count_products( $this -> basket );?>
<b><?= ucfirst( $lang['ilosc'] );?></b>: <span id="products-count"><?= $count = \Domain\Basket\BasketCalculator::countProducts( $this -> basket );?>
<?
switch ( true )
{
@@ -17,7 +17,7 @@
case ( $count >= 5 ): echo 'produktów'; break;
}
?></span><br />
<b><?= ucfirst( $lang['suma'] );?></b>: <span id="basket-value"><?= \S::decimal( \front\factory\ShopBasket::summary_price( $this -> basket, $this -> coupon ) );?></span> zł
<b><?= ucfirst( $lang['suma'] );?></b>: <span id="basket-value"><?= \Shared\Helpers\Helpers::decimal( \Domain\Basket\BasketCalculator::summaryPrice( $this -> basket, $this -> coupon ) );?></span> zł
</div>
</div>
</a>

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,11 +245,11 @@
$.alert({
title: '<?= ucfirst(\S::lang('uwaga')); ?>',
title: '<?= ucfirst(\Shared\Helpers\Helpers::lang('uwaga')); ?>',
content: 'Proszę wybrać punkt odbioru',
type: 'blue',
closeIcon: true,
closeIconClass: 'fa fa-times',
closeIconClass: 'fas fa-times',
typeAnimated: true,
animation: 'opacity',
useBootstrap: false,
@@ -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,10 +406,10 @@
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',
closeIconClass: 'fas fa-close',
typeAnimated: true,
animation: 'opacity',
useBootstrap: false,
@@ -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,17 +30,18 @@
if ($row)
{
$row = explode('-', $row);
$attribute = \front\factory\ShopAttribute::attribute_details($row[0], $this->lang_id);
echo '<span>' . $attribute['language']['name'] . ':</span> ';
$value = \front\factory\ShopAttribute::value_details($row[1], $this->lang_id);
echo $value['language']['name'];
$attributeRepo = new \Domain\Attribute\AttributeRepository($GLOBALS['mdb']);
$attribute = $attributeRepo->frontAttributeDetails((int)$row[0], $this->lang_id);
echo '<div>' . $attribute['language']['name'] . ':</div>';
$value = $attributeRepo->frontValueDetails((int)$row[1], $this->lang_id);
echo '<div>' . $value['language']['name'] . '</div>';
}
?>
</div>
<? 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,7 +166,7 @@
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;?>
]
@@ -173,7 +174,7 @@
});
gtag('event', 'conversion', {
'send_to': 'AW-11122553653/O1ImCNnJ9ecYELXm0rcp',
'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 ) );?>,
'currency': 'PLN'
});
console.log( 'Fired up event GADS purchase conversion marianek.pl' );

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;

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,7 +29,7 @@ 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'; $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';
@@ -124,14 +124,14 @@
$url .= '&return_error_url=' . urlencode( $base . "://" . $_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>
<? endif;?>
</div>
</div>
<? if ( \S::get_session( 'ekomi-purchase' ) and $this -> settings['ekomi_survey'] and ( $this -> order['payment_method_id'] == 1 or $this -> order['payment_method_id'] == 3 ) ):?>
<? if ( \Shared\Helpers\Helpers::get_session( 'ekomi-purchase' ) and $this -> settings['ekomi_survey'] and ( $this -> order['payment_method_id'] == 1 or $this -> order['payment_method_id'] == 3 ) ):?>
<? unset( $_SESSION['ekomi-purchase'] );?>
<?= $this -> settings['ekomi_survey'];?>
<? endif;?>
@@ -145,7 +145,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',
@@ -161,15 +161,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'] ?>",

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/500/0/<?= substr( $this -> product -> images[0]['src'], 1, strlen( $this -> product -> images[0]['src'] ) );?>" alt="<?= $this -> product -> images[0]['alt'];?>">
<? if ( file_exists( substr( $this -> product -> images[1]['src'], 1 ) ) ):?>
<img class="second" src="/thumb/1000/0/<?= substr( $this -> product -> images[1]['src'], 1, strlen( $this -> product -> images[1]['src'] ) );?>" alt="<?= $this -> product -> images[1]['alt'];?>">
<img class="first" src="/thumb/500/0/<?= substr( $this -> product['images'][0]['src'], 1, strlen( $this -> product['images'][0]['src'] ) );?>" alt="<?= $this -> product['images'][0]['alt'];?>">
<? if ( file_exists( substr( $this -> product['images'][1]['src'], 1 ) ) ):?>
<img class="second" src="/thumb/1000/0/<?= substr( $this -> product['images'][1]['src'], 1, strlen( $this -> product['images'][1]['src'] ) );?>" alt="<?= $this -> product['images'][1]['alt'];?>">
<? else:?>
<img class="second" src="/thumb/1000/0/<?= substr( $this -> product -> images[0]['src'], 1, strlen( $this -> product -> images[0]['src'] ) );?>" alt="<?= $this -> product -> images[0]['alt'];?>">
<img class="second" src="/thumb/1000/0/<?= substr( $this -> product['images'][0]['src'], 1, strlen( $this -> product['images'][0]['src'] ) );?>" alt="<?= $this -> product['images'][0]['alt'];?>">
<? endif;?>
<? endif;?>
<? else:?>
@@ -28,38 +28,38 @@
</div>
<div class="product-details">
<h2 class="name">
<?= $this -> product -> language['name'];?>
<?= $this -> product['language']['name'];?>
</h2>
<div class="prices">
<?
$prices = $this -> product -> getDefaultCombinationPrices();
$prices = ( new \Domain\Product\ProductRepository( $GLOBALS['mdb'] ) )->getDefaultCombinationPrices( $this -> product );
if ( $prices )
{
if ( $prices['price_brutto_promo'] ):?>
<div class="price-old">
<?= \shop\Shop::shortPrice( $prices['price_brutto'] );?> <span class="small">zł</span>
<?= \Shared\Helpers\Helpers::shortPrice( $prices['price_brutto'] );?> <span class="small">zł</span>
</div>
<div class="price">
<?= \shop\Shop::shortPrice( $prices['price_brutto_promo'] );?> <span class="small">zł</span>
<?= \Shared\Helpers\Helpers::shortPrice( $prices['price_brutto_promo'] );?> <span class="small">zł</span>
</div>
<? else:?>
<div class="price">
<?= \shop\Shop::shortPrice( $prices['price_brutto'] );?> <span class="small">zł</span>
<?= \Shared\Helpers\Helpers::shortPrice( $prices['price_brutto'] );?> <span class="small">zł</span>
</div>
<? endif;
}
else
{
if ( $this -> product -> price_brutto_promo ):?>
if ( $this -> product['price_brutto_promo'] ):?>
<div class="price-old">
<?= \shop\Shop::shortPrice( $this -> product -> price_brutto );?> <span class="small">zł</span>
<?= \Shared\Helpers\Helpers::shortPrice( $this -> product['price_brutto'] );?> <span class="small">zł</span>
</div>
<div class="price">
<?= \shop\Shop::shortPrice( $this -> product -> price_brutto_promo );?> <span class="small">zł</span>
<?= \Shared\Helpers\Helpers::shortPrice( $this -> product['price_brutto_promo'] );?> <span class="small">zł</span>
</div>
<? else:?>
<div class="price">
<?= \shop\Shop::shortPrice( $this -> product -> price_brutto );?> <span class="small">zł</span>
<?= \Shared\Helpers\Helpers::shortPrice( $this -> product['price_brutto'] );?> <span class="small">zł</span>
</div>
<? endif;
};?>

View File

@@ -1,6 +1,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"
}

View File

@@ -2,12 +2,12 @@
<? if ( is_array( $this -> products ) ): foreach ( $this -> products as $product ):?>
<?
$product -> languages[$lang_id]['seo_link'] ? $url = '/' . $product -> languages[$lang_id]['seo_link'] : $url = '/p-' . $product['id'] . '-' . \S::seo( $product -> languages[$lang_id]['name'] );
$product['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;
?>
<?= \Tpl::view( 'shop-product/product-mini', [
<?= \Shared\Tpl\Tpl::view( 'shop-product/product-mini', [
'product' => $product,
'class' => 'col-12 col-sm-4 col-md-4 col-lg-3'
] );?>

View File

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

View File

@@ -1,17 +1,12 @@
<? global $lang_id;?>
<div class="box-title"><?= ucfirst( \S::lang( 'polecane-produkty' ) );?></div>
<div class="box-title"><?= ucfirst( \Shared\Helpers\Helpers::lang( 'polecane-produkty' ) );?></div>
<p class="box-description">Interesting Features Is Rich And Colorful, Each Button To Bring A Surprise To The Baby Introduction To Give Your Child Learn In Advance.</p>
<div class="content">
<? if ( is_array( $this -> products ) ): foreach ( $this -> products as $product_id ):?>
<?
$product = new \shop\Product( $product_id );
$product -> languages[$lang_id]['seo_link'] ? $url = '/' . $product -> languages[$lang_id]['seo_link'] : $url = '/p-' . $product['id'] . '-' . \S::seo( $product -> languages[$lang_id]['name'] );
if ( \S::get_session( 'current-lang' ) != \front\factory\Languages::default_language() and $url != '#' )
$url = '/' . \S::get_session( 'current-lang' ) . $url;
$product = (new \Domain\Product\ProductRepository($GLOBALS['mdb']))->findCached( $product_id, $lang_id );
?>
<?= \Tpl::view( 'shop-product/product-mini', [
<?= \Shared\Tpl\Tpl::view( 'shop-product/product-mini', [
'product' => $product,
'class' => 'col-12 col-sm-4 col-md-4 col-lg-3'
] );?>

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-search">
<? if ( $this -> product -> new_to_date and $this -> product -> new_to_date >= date( 'Y-m-d' ) ):?>
<div class="new"><?= \S::lang( 'nowosc' );?></div>
<? if ( $this -> product['new_to_date'] and $this -> product['new_to_date'] >= date( 'Y-m-d' ) ):?>
<div class="new"><?= \Shared\Helpers\Helpers::lang( 'nowosc' );?></div>
<? endif;?>
<a href="<?= $url;?>" class="a-img">
<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="owl-lazy" data-src="/thumb/490/0/<?= substr( $this -> product -> images[0]['src'], 1, strlen( $this -> product -> images[0]['src'] ) );?>" alt="<?= $this -> product -> images[0]['alt'];?>">
<img class="owl-lazy" data-src="/thumb/490/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/490/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/490/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/490/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/490/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/490/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/490/0/<?= substr( $this -> product['images'][0]['src'], 1, strlen( $this -> product['images'][0]['src'] ) );?>" alt="<?= $this -> product['images'][0]['alt'];?>">
<? endif;?>
<? endif;?>
<? else:?>
@@ -30,20 +30,20 @@
<div class="product-details">
<h2 class="name">
<a href="<?= $url;?>" class="a-name">
<?= $this -> product -> language['name'];?>
<?= $this -> product['language']['name'];?>
</a>
</h2>
<div class="prices">
<? 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>

View File

@@ -8,10 +8,10 @@
<div class="row">
<div class="col-12">
<div class="small-title">
<?= \S::lang( 'czego-szukasz' );?>?
<?= \Shared\Helpers\Helpers::lang( 'czego-szukasz' );?>?
</div>
<div class="input">
<input type="text" name="q" class="form-control" placeholder="<?= \S::lang( 'wpisz-szukany-produkt' );?>">
<input type="text" name="q" class="form-control" placeholder="<?= \Shared\Helpers\Helpers::lang( 'wpisz-szukany-produkt' );?>">
<button type="submit" class="button--search" value=""><img class="search" src="/layout/images/white-search.svg"></button>
<a href="#" class="search-form-big-close"><img src="/layout/images/exit.svg" alt="exit"></a>
</div>
@@ -69,7 +69,7 @@
var time = 0;
if ( data == null )
{
$( '.search-big-results' ).html( '<div class="no-found"><?= \S::lang( 'nie-znaleziono-produktow' );?><\/div>' );
$( '.search-big-results' ).html( '<div class="no-found"><?= \Shared\Helpers\Helpers::lang( 'nie-znaleziono-produktow' );?><\/div>' );
$( '.search-more-button' ).html('');
}
else
@@ -88,7 +88,7 @@
{
setTimeout( function()
{
$( '.search-more-button' ).html( '<a href="/wyszukiwarka/' + _this.val() + '" class="btn btn-success"><?= \S::lang( 'zobacz-wiecej' );?><\/a>' );
$( '.search-more-button' ).html( '<a href="/wyszukiwarka/' + _this.val() + '" class="btn btn-success"><?= \Shared\Helpers\Helpers::lang( 'zobacz-wiecej' );?><\/a>' );
}, time );
}
});