Add view classes for articles, banners, languages, menu, newsletter, containers, shop categories, clients, payment methods, products, and search
- Created `Articles` class for rendering article views including full articles, miniature lists, and news sections. - Added `Banners` class for handling banner displays. - Introduced `Languages` class for rendering language options. - Implemented `Menu` class for rendering page and menu structures. - Developed `Newsletter` class for newsletter rendering. - Created `Scontainers` class for rendering specific containers. - Added `ShopCategory` class for managing shop category views and pagination. - Implemented `ShopClient` class for client-related views including address management and login forms. - Created `ShopPaymentMethod` class for displaying payment methods in the basket. - Added `ShopProduct` class for generating product URLs. - Introduced `ShopSearch` class for rendering a simple search form. - Added `.htaccess` file in the plugins directory to enhance security by restricting access to sensitive files and directories.
This commit is contained in:
@@ -1,12 +1,12 @@
|
||||
<? global $lang;?>
|
||||
<div class="col-12 col-md-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="date-add"><?= date( 'd.m.Y', strtotime( $this -> article['date_add'] ) );?></div>
|
||||
<div class="entry">
|
||||
|
||||
@@ -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">
|
||||
<?
|
||||
$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' );
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
<div class="gallery <? if ( $this -> article['pixieset'] ):?>pixieset<? endif;?>">
|
||||
<? if ( $this -> article['pixieset'] ):?>
|
||||
<div class="buttons">
|
||||
<a id="gallery-download-<?= $this -> article['id'];?>" class="btn btn-success"><?= \S::lang( 'pobierz-wszystkie' );?></a>
|
||||
<a id="gallery-download-<?= $this -> article['id'];?>" class="btn btn-success"><?= \Shared\Helpers\Helpers::lang( 'pobierz-wszystkie' );?></a>
|
||||
<? if ( $this -> article['pixieset'] == 2 ):?>
|
||||
<a id="gallery-favorite-submit-<?= $this -> article['id'];?>" class="btn btn-info"><?= \S::lang( 'zatwierdz-wybrane-fotografie' );?></a>
|
||||
<a id="gallery-favorite-submit-<?= $this -> article['id'];?>" class="btn btn-info"><?= \Shared\Helpers\Helpers::lang( 'zatwierdz-wybrane-fotografie' );?></a>
|
||||
<? endif;?>
|
||||
</div>
|
||||
<? endif;?>
|
||||
@@ -35,7 +35,7 @@
|
||||
<? endif;?>
|
||||
<? if ( $this -> article['pixieset'] ):?>
|
||||
<div class="pixieset-image-big">
|
||||
<a href="#" class="close" title="<?= \S::lang( 'zamknij' );?>">
|
||||
<a href="#" class="close" title="<?= \Shared\Helpers\Helpers::lang( 'zamknij' );?>">
|
||||
<i class="fa fa-times"></i>
|
||||
</a>
|
||||
<div class="buttons">
|
||||
@@ -187,13 +187,13 @@
|
||||
},
|
||||
beforeSend: function()
|
||||
{
|
||||
button.addClass( 'disabled' ).html( '<?= \S::lang( 'zaczekaj-trwa-tworzenie-pliku' );?>' );
|
||||
button.addClass( 'disabled' ).html( '<?= \Shared\Helpers\Helpers::lang( 'zaczekaj-trwa-tworzenie-pliku' );?>' );
|
||||
},
|
||||
success: function( response )
|
||||
{
|
||||
data = jQuery.parseJSON( response );
|
||||
window.location = '/' + data.url;
|
||||
button.removeClass( 'disabled' ).html( '<?= \S::lang( 'pobierz-wszystkie' );?>' );
|
||||
button.removeClass( 'disabled' ).html( '<?= \Shared\Helpers\Helpers::lang( 'pobierz-wszystkie' );?>' );
|
||||
}
|
||||
});
|
||||
});
|
||||
@@ -226,8 +226,8 @@
|
||||
{
|
||||
$.alert(
|
||||
{
|
||||
title: '<?= ucfirst( \S::lang( 'informacja' ) );?>',
|
||||
content: '<?= \S::lang( 'lista-wybranych-zdjec-zostala-zatwierdzona' );?>',
|
||||
title: '<?= ucfirst( \Shared\Helpers\Helpers::lang( 'informacja' ) );?>',
|
||||
content: '<?= \Shared\Helpers\Helpers::lang( 'lista-wybranych-zdjec-zostala-zatwierdzona' );?>',
|
||||
type: 'orange',
|
||||
closeIcon: true,
|
||||
closeIconClass: 'fa fa-close',
|
||||
@@ -240,7 +240,7 @@
|
||||
{
|
||||
confirm:
|
||||
{
|
||||
text: '<?= \S::lang( 'zamknij' );?>',
|
||||
text: '<?= \Shared\Helpers\Helpers::lang( 'zamknij' );?>',
|
||||
btnClass: 'btn-blue',
|
||||
keys: ['enter'],
|
||||
action: function() {}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<? global $lang;?>
|
||||
<div class="article-miniature">
|
||||
<?
|
||||
$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'] );
|
||||
|
||||
?>
|
||||
<h3 class="article-title">
|
||||
@@ -15,7 +15,7 @@
|
||||
if ( $this -> article['show_date_modify'] )
|
||||
echo '<div class="date-add">' . $lang['data-modyfikacji'] . ': ' . $this -> article['date_modify'] . '</div>';
|
||||
|
||||
if ( $img = \front\factory\Articles::get_image( $this -> article ) ):
|
||||
if ( $img = \front\Views\Articles::getImage( $this -> article ) ):
|
||||
?>
|
||||
<a href="./<?= $url;?>" title="<?= $this -> article['language']['title'];?>" <? if ( $this -> article['language']['noindex'] ):?>rel="nofollow"<? endif;?>>
|
||||
<div style="background: url( '/libraries/thumb.php?img=<?= $img;?>&w=250&h=250' ) no-repeat center;"></div>
|
||||
|
||||
@@ -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">
|
||||
<?
|
||||
$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>';
|
||||
@@ -23,16 +23,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;?>
|
||||
@@ -89,7 +89,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" />
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<div class="row">
|
||||
<? if ( is_array( $this -> articles ) ): foreach ( $this -> articles as $article ):
|
||||
$tpl = new \Tpl;
|
||||
$tpl = new \Shared\Tpl\Tpl;
|
||||
$tpl -> page_id = $this -> page_id;
|
||||
$tpl -> article = $article;
|
||||
echo $tpl -> render( 'articles/article-entry' );
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<ul class="news-list">
|
||||
<? if ( \S::is_array_fix( $this -> articles ) ): foreach ( $this -> articles as $article ):?>
|
||||
<? $article['language']['seo_link'] ? $url = $article['language']['seo_link'] : $url = 'a-' . $article['id'] . '-' . \S::seo( $article['language']['title'] );?>
|
||||
<? if ( \Shared\Helpers\Helpers::is_array_fix( $this -> articles ) ): foreach ( $this -> articles as $article ):?>
|
||||
<? $article['language']['seo_link'] ? $url = $article['language']['seo_link'] : $url = 'a-' . $article['id'] . '-' . \Shared\Helpers\Helpers::seo( $article['language']['title'] );?>
|
||||
<li>
|
||||
<a href="/<? if ( \S::get_session( 'current-lang' ) != \front\factory\Languages::default_language( \S::get_domain( $_SERVER['HTTP_HOST'] ) ) ) echo \S::get_session( 'current-lang' ) . '/';?><?= $url;?>" title="<?= $article['language']['title'];?>" <? if ( $article['language']['noindex'] ):?>rel="nofollow"<? endif;?>><i class="far fa-file-alt"></i><?= $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="<?= $article['language']['title'];?>" <? if ( $article['language']['noindex'] ):?>rel="nofollow"<? endif;?>><i class="far fa-file-alt"></i><?= $article['language']['title'];?></a>
|
||||
<div class="date-add"><?= date( 'd.m.Y', strtotime( $article['date_add'] ) );?></div>
|
||||
</li>
|
||||
<? endforeach; endif;?>
|
||||
|
||||
@@ -2,10 +2,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>
|
||||
|
||||
@@ -1,31 +1,32 @@
|
||||
<? global $lang_id;?>
|
||||
<? if ( \S::is_array_fix( $this -> products ) ):?>
|
||||
<? if ( \Shared\Helpers\Helpers::is_array_fix( $this -> products ) ):?>
|
||||
<h2>Dobierz inne produkty do kompletu</h2>
|
||||
<? endif;?>
|
||||
<div class="product-sets">
|
||||
<? $productRepo = new \Domain\Product\ProductRepository( $GLOBALS['mdb'] ); ?>
|
||||
<? if ( is_array( $this -> products ) ): foreach ( $this -> products as $product_id ):
|
||||
$product = new \shop\Product( $product_id );
|
||||
$product = $productRepo->findCached( $product_id, $lang_id );
|
||||
|
||||
$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="product">
|
||||
<? if ( $product -> new_to_date and $product -> new_to_date >= date( 'Y-m-d' ) ):?>
|
||||
<div class="new"><?= \S::lang( 'nowosc' );?></div>
|
||||
<? if ( $product['new_to_date'] and $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( $product -> images[0]['src'], 1 ) ) ):?>
|
||||
<? if ( file_exists( substr( $product['images'][0]['src'], 1 ) ) ):?>
|
||||
<? if ( $this -> class == 'item' ):?>
|
||||
<img class="owl-lazy" data-src="/thumb/490/0/<?= substr( $product -> images[0]['src'], 1, strlen( $product -> images[0]['src'] ) );?>" alt="<?= $product -> images[0]['alt'];?>">
|
||||
<img class="owl-lazy" data-src="/thumb/490/0/<?= substr( $product['images'][0]['src'], 1, strlen( $product['images'][0]['src'] ) );?>" alt="<?= $product['images'][0]['alt'];?>">
|
||||
<? else:?>
|
||||
<img class="lozad first" data-src="/thumb/490/0/<?= substr( $product -> images[0]['src'], 1, strlen( $product -> images[0]['src'] ) );?>" alt="<?= $product -> images[0]['alt'];?>">
|
||||
<? if ( file_exists( substr( $product -> images[1]['src'], 1 ) ) ):?>
|
||||
<img class="lozad second" data-src="/thumb/490/0/<?= substr( $product -> images[1]['src'], 1, strlen( $product -> images[1]['src'] ) );?>" alt="<?= $product -> images[1]['alt'];?>">
|
||||
<img class="lozad first" data-src="/thumb/490/0/<?= substr( $product['images'][0]['src'], 1, strlen( $product['images'][0]['src'] ) );?>" alt="<?= $product['images'][0]['alt'];?>">
|
||||
<? if ( file_exists( substr( $product['images'][1]['src'], 1 ) ) ):?>
|
||||
<img class="lozad second" data-src="/thumb/490/0/<?= substr( $product['images'][1]['src'], 1, strlen( $product['images'][1]['src'] ) );?>" alt="<?= $product['images'][1]['alt'];?>">
|
||||
<? else:?>
|
||||
<img class="lozad second" data-src="/thumb/490/0/<?= substr( $product -> images[0]['src'], 1, strlen( $product -> images[0]['src'] ) );?>" alt="<?= $product -> images[0]['alt'];?>">
|
||||
<img class="lozad second" data-src="/thumb/490/0/<?= substr( $product['images'][0]['src'], 1, strlen( $product['images'][0]['src'] ) );?>" alt="<?= $product['images'][0]['alt'];?>">
|
||||
<? endif;?>
|
||||
<? endif;?>
|
||||
<? else:?>
|
||||
@@ -36,20 +37,20 @@
|
||||
<div class="product-details">
|
||||
<h2 class="name">
|
||||
<a href="<?= $url;?>" class="a-name">
|
||||
<?= $product -> language['name'];?>
|
||||
<?= $product['language']['name'];?>
|
||||
</a>
|
||||
</h2>
|
||||
<div class="prices">
|
||||
<? if ( $product -> price_brutto_promo ):?>
|
||||
<? if ( $product['price_brutto_promo'] ):?>
|
||||
<div class="price-old">
|
||||
<?= \shop\Shop::shortPrice( $product -> price_brutto );?> <span class="small">zł</span>
|
||||
<?= \Shared\Helpers\Helpers::shortPrice( $product['price_brutto'] );?> <span class="small">zł</span>
|
||||
</div>
|
||||
<div class="price">
|
||||
<?= \shop\Shop::shortPrice( $product -> price_brutto_promo );?> <span class="small">zł</span>
|
||||
<?= \Shared\Helpers\Helpers::shortPrice( $product['price_brutto_promo'] );?> <span class="small">zł</span>
|
||||
</div>
|
||||
<? else:?>
|
||||
<div class="price">
|
||||
<?= \shop\Shop::shortPrice( $product -> price_brutto );?> <span class="small">zł</span>
|
||||
<?= \Shared\Helpers\Helpers::shortPrice( $product['price_brutto'] );?> <span class="small">zł</span>
|
||||
</div>
|
||||
<? endif;?>
|
||||
</div>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
@@ -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 );
|
||||
|
||||
@@ -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 ) ) {
|
||||
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>';
|
||||
|
||||
@@ -1,26 +0,0 @@
|
||||
<?
|
||||
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'] );
|
||||
|
||||
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' );
|
||||
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 '</li>';
|
||||
}
|
||||
echo '</ul>';
|
||||
}
|
||||
@@ -3,10 +3,10 @@
|
||||
</div>
|
||||
<div style="border-bottom: 1px solid #ccc; padding: 10px 0 0 0;">
|
||||
<? if ( is_array( $this -> articles ) ): foreach ( $this -> articles as $article ):?>
|
||||
<? $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'] );?>
|
||||
<div style="padding: 10px; background: #F1F1F1; margin-bottom: 10px">
|
||||
<?
|
||||
$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="http://www.<?= $_SERVER['SERVER_NAME'];?>/<?= $url;?>" title="<?= $article['language']['title'];?>" style="margin-bottom: 10px; display: block; font-size: 14px; color: #5b7fb1; font-weight: 600;">
|
||||
<?= $article['language']['title'];?>
|
||||
|
||||
@@ -1,13 +1,20 @@
|
||||
<? if ( $this -> custom_fields ): foreach ( $this -> custom_fields as $key => $val ):?>
|
||||
<div class="custom-field">
|
||||
<div class="_name">
|
||||
<?
|
||||
$custom_field = \shop\ProductCustomField::getFromCache( $key );
|
||||
echo $custom_field['name'] . ':';
|
||||
?>
|
||||
</div>
|
||||
<div class="_text">
|
||||
<?= $val;?>
|
||||
</div>
|
||||
</div>
|
||||
<? endforeach; endif;?>
|
||||
<? if ( $this -> custom_fields ) : ?>
|
||||
<? foreach ( $this -> custom_fields as $key => $val ) : ?>
|
||||
<? $custom_field = ( new \Domain\Product\ProductRepository( $GLOBALS['mdb'] ) )->findCustomFieldCached( $key ); ?>
|
||||
|
||||
<? if ( $custom_field['type'] == 'text' ) : ?>
|
||||
<div class="custom-field">
|
||||
<div class="_name">
|
||||
<?
|
||||
echo $custom_field['name'] . ':';
|
||||
?>
|
||||
</div>
|
||||
<div class="_text">
|
||||
<?= $val;?>
|
||||
</div>
|
||||
</div>
|
||||
<? elseif ( $custom_field['type'] == 'image' ) : ?>
|
||||
|
||||
<? endif; ?>
|
||||
<? endforeach; ?>
|
||||
<? endif;?>
|
||||
@@ -1,6 +1,6 @@
|
||||
<div class="basket-address-form">
|
||||
<? if ( !$this -> client ):?>
|
||||
<div class="box-title"><?= \S::lang( 'zloz-zamowienie-bez-rejestraji' );?></div>
|
||||
<div class="box-title"><?= \Shared\Helpers\Helpers::lang( 'zloz-zamowienie-bez-rejestraji' );?></div>
|
||||
<? else:?>
|
||||
<?
|
||||
if ( is_array( $this -> addresses ) ) for ( $i = 0; $i < count( $this -> addresses ); $i++ )
|
||||
@@ -24,7 +24,7 @@
|
||||
<br/><span field="postal_code"><?= $address['postal_code'] . '</span> <span field="city">' . $address['city'] . '</span>';?>
|
||||
<br/><span field="phone"><?= $address['phone'];?></span>
|
||||
<div class="buttons">
|
||||
<a href="#" class="btn-select" address="<?= $address['id'];?>"><?= \S::lang( 'wybierz' );?></a>
|
||||
<a href="#" class="btn-select" address="<?= $address['id'];?>"><?= \Shared\Helpers\Helpers::lang( 'wybierz' );?></a>
|
||||
</div>
|
||||
</div>
|
||||
<? endforeach;?>
|
||||
@@ -37,30 +37,30 @@
|
||||
<? if ( !$this -> client ):?>
|
||||
<div class="form-group row">
|
||||
<div class="col-12">
|
||||
<input type="email" name="email" class="form-control" required placeholder="<?= ucfirst( \S::lang( 'email' ) );?>">
|
||||
<input type="email" name="email" class="form-control" required placeholder="<?= ucfirst( \Shared\Helpers\Helpers::lang( 'email' ) );?>">
|
||||
</div>
|
||||
</div>
|
||||
<? endif;?>
|
||||
<div class="form-group row">
|
||||
<div class="col-12">
|
||||
<input type="text" id="name" name="name" class="form-control" required placeholder="<?= ucfirst( \S::lang( 'imie' ) );?>" value="<?= htmlspecialchars( $address_current['name'] );?>">
|
||||
<input type="text" id="name" name="name" class="form-control" required placeholder="<?= ucfirst( \Shared\Helpers\Helpers::lang( 'imie' ) );?>" value="<?= htmlspecialchars( $address_current['name'] );?>">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<div class="col-12">
|
||||
<input type="text" id="surname" name="surname" class="form-control" required placeholder="<?= ucfirst( \S::lang( 'nazwisko' ) );?>" value="<?= htmlspecialchars( $address_current['surname'] );?>">
|
||||
<input type="text" id="surname" name="surname" class="form-control" required placeholder="<?= ucfirst( \Shared\Helpers\Helpers::lang( 'nazwisko' ) );?>" value="<?= htmlspecialchars( $address_current['surname'] );?>">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<input type="text" id="street" name="street" class="form-control" <? if ( !in_array( $this -> transport_method['id'], [ 1, 2, 3, 9] ) ):?> required<? endif;?> placeholder="<?= ucfirst( \S::lang( 'ulica-i-nr-domu' ) );?> <? if ( in_array( $this -> transport_method['id'], [ 1, 2, 3, 9] ) ):?> (<?= \S::lang( 'opcjonalnie' );?>)<? endif;?>" value="<?= htmlspecialchars( $address_current['street'] );?>">
|
||||
<input type="text" id="street" name="street" class="form-control" <? if ( !in_array( $this -> transport_method['id'], [ 1, 2, 3, 9] ) ):?> required<? endif;?> placeholder="<?= ucfirst( \Shared\Helpers\Helpers::lang( 'ulica-i-nr-domu' ) );?> <? if ( in_array( $this -> transport_method['id'], [ 1, 2, 3, 9] ) ):?> (<?= \Shared\Helpers\Helpers::lang( 'opcjonalnie' );?>)<? endif;?>" value="<?= htmlspecialchars( $address_current['street'] );?>">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="row">
|
||||
<div class="col-12 col-md-6">
|
||||
<input type="text" id="postal_code" name="postal_code" pattern="[0-9]{2}-[0-9]{3}" title="Format xx-xxx" class="form-control" <? if ( !in_array( $this -> transport_method['id'], [ 1, 2, 3, 9] ) ):?> required<? endif;?> placeholder="<?= ucfirst( \S::lang( 'kod-pocztowy' ) );?><? if ( in_array( $this -> transport_method['id'], [ 1, 2, 3, 9] ) ):?> (<?= \S::lang( 'opcjonalnie' );?>)<? endif;?>" " value="<?= htmlspecialchars( $address_current['postal_code'] );?>">
|
||||
<input type="text" id="postal_code" name="postal_code" pattern="[0-9]{2}-[0-9]{3}" title="Format xx-xxx" class="form-control" <? if ( !in_array( $this -> transport_method['id'], [ 1, 2, 3, 9] ) ):?> required<? endif;?> placeholder="<?= ucfirst( \Shared\Helpers\Helpers::lang( 'kod-pocztowy' ) );?><? if ( in_array( $this -> transport_method['id'], [ 1, 2, 3, 9] ) ):?> (<?= \Shared\Helpers\Helpers::lang( 'opcjonalnie' );?>)<? endif;?>" " value="<?= htmlspecialchars( $address_current['postal_code'] );?>">
|
||||
</div>
|
||||
<div class="col-12 col-md-6">
|
||||
<input type="text" id="city" name="city" class="form-control" <? if ( !in_array( $this -> transport_method['id'], [ 1, 2, 3, 9] ) ):?> required<? endif;?> placeholder="<?= ucfirst( \S::lang( 'miasto' ) );?><? if ( in_array( $this -> transport_method['id'], [ 1, 2, 3, 9] ) ):?> (<?= \S::lang( 'opcjonalnie' );?>)<? endif;?>" " value="<?= htmlspecialchars( $address_current['city'] );?>">
|
||||
<input type="text" id="city" name="city" class="form-control" <? if ( !in_array( $this -> transport_method['id'], [ 1, 2, 3, 9] ) ):?> required<? endif;?> placeholder="<?= ucfirst( \Shared\Helpers\Helpers::lang( 'miasto' ) );?><? if ( in_array( $this -> transport_method['id'], [ 1, 2, 3, 9] ) ):?> (<?= \Shared\Helpers\Helpers::lang( 'opcjonalnie' );?>)<? endif;?>" " value="<?= htmlspecialchars( $address_current['city'] );?>">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -70,14 +70,14 @@
|
||||
<img src="/images/system/lang_pl.png" alt="">
|
||||
<span>+48</span>
|
||||
</div>
|
||||
<input type="tel" id="phone" name="phone" class="form-control form-control-input" required placeholder="<?= ucfirst(\S::lang('telefon')); ?>" value="<?= htmlspecialchars($address_current['phone']); ?>" pattern="[0-9]{9}">
|
||||
<input type="tel" id="phone" name="phone" class="form-control form-control-input" required placeholder="<?= ucfirst(\Shared\Helpers\Helpers::lang('telefon')); ?>" value="<?= htmlspecialchars($address_current['phone']); ?>" pattern="[0-9]{9}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="row">
|
||||
<div class="col-12" id="fvat">
|
||||
<input type="checkbox" name="fvat">
|
||||
<?= \S::lang( 'faktura-vat' );?>
|
||||
<?= \Shared\Helpers\Helpers::lang( 'faktura-vat' );?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -85,31 +85,31 @@
|
||||
<div class="form-group">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<input type="text" id="firm_name" name="firm_name" class="form-control" placeholder="<?= ucfirst( \S::lang( 'nazwa-firmy' ) );?>" value="">
|
||||
<input type="text" id="firm_name" name="firm_name" class="form-control" placeholder="<?= ucfirst( \Shared\Helpers\Helpers::lang( 'nazwa-firmy' ) );?>" value="">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<input type="text" id="firm_street" name="firm_street" class="form-control" placeholder="<?= ucfirst( \S::lang( 'ulica-i-nr-domu' ) );?>" value="">
|
||||
<input type="text" id="firm_street" name="firm_street" class="form-control" placeholder="<?= ucfirst( \Shared\Helpers\Helpers::lang( 'ulica-i-nr-domu' ) );?>" value="">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="row">
|
||||
<div class="col-12 col-md-6">
|
||||
<input type="text" id="firm_postal_code" name="firm_postal_code" pattern="[0-9]{2}-[0-9]{3}" title="Format xx-xxx" class="form-control" placeholder="<?= ucfirst( \S::lang( 'kod-pocztowy' ) );?>" value="">
|
||||
<input type="text" id="firm_postal_code" name="firm_postal_code" pattern="[0-9]{2}-[0-9]{3}" title="Format xx-xxx" class="form-control" placeholder="<?= ucfirst( \Shared\Helpers\Helpers::lang( 'kod-pocztowy' ) );?>" value="">
|
||||
</div>
|
||||
<div class="col-12 col-md-6">
|
||||
<input type="text" id="firm_city" name="firm_city" class="form-control" placeholder="<?= ucfirst( \S::lang( 'miasto' ) );?>" value="">
|
||||
<input type="text" id="firm_city" name="firm_city" class="form-control" placeholder="<?= ucfirst( \Shared\Helpers\Helpers::lang( 'miasto' ) );?>" value="">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<input type="text" id="firm_nip" name="firm_nip" class="form-control" placeholder="<?= ucfirst( \S::lang( 'nip' ) );?>" value="">
|
||||
<input type="text" id="firm_nip" name="firm_nip" class="form-control" placeholder="<?= ucfirst( \Shared\Helpers\Helpers::lang( 'nip' ) );?>" value="">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -119,14 +119,14 @@
|
||||
<div class="row">
|
||||
<div class="col-12" id="agreement">
|
||||
<input type="checkbox" name="agreement" required="">
|
||||
<?= \S::lang( 'przeczytalem-i-akceptuje-polityke-prywatnosci-i-regulamin' );?>
|
||||
<?= \Shared\Helpers\Helpers::lang( 'przeczytalem-i-akceptuje-polityke-prywatnosci-i-regulamin' );?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<button type="submit" class="btn btn-success" id="order-send"><span class="text"><?= ucfirst( \S::lang( 'zamawiam-z-obowiazkiem-zaplaty' ) );?></span></button>
|
||||
<button type="submit" class="btn btn-success" id="order-send"><span class="text"><?= ucfirst( \Shared\Helpers\Helpers::lang( 'zamawiam-z-obowiazkiem-zaplaty' ) );?></span></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,31 +1,32 @@
|
||||
<? global $lang_id;?>
|
||||
<? if ( \S::is_array_fix( $this -> products ) ):?>
|
||||
<? if ( \Shared\Helpers\Helpers::is_array_fix( $this -> products ) ):?>
|
||||
<h2>Dobierz inne produkty do kompletu</h2>
|
||||
<? endif;?>
|
||||
<div class="product-sets">
|
||||
<? $productRepo = new \Domain\Product\ProductRepository( $GLOBALS['mdb'] ); ?>
|
||||
<? if ( is_array( $this -> products ) ): foreach ( $this -> products as $product_id ):
|
||||
$product = \shop\Product::getFromCache( $product_id, $lang_id );
|
||||
$product = $productRepo->findCached( $product_id, $lang_id );
|
||||
|
||||
$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="product">
|
||||
<? if ( $product -> new_to_date and $product -> new_to_date >= date( 'Y-m-d' ) ):?>
|
||||
<div class="new"><?= \S::lang( 'nowosc' );?></div>
|
||||
<? if ( $product['new_to_date'] and $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( $product -> images[0]['src'], 1 ) ) ):?>
|
||||
<? if ( file_exists( substr( $product['images'][0]['src'], 1 ) ) ):?>
|
||||
<? if ( $this -> class == 'item' ):?>
|
||||
<img class="owl-lazy" data-src="/thumb/490/0/<?= substr( $product -> images[0]['src'], 1, strlen( $product -> images[0]['src'] ) );?>" alt="<?= $product -> images[0]['alt'];?>">
|
||||
<img class="owl-lazy" data-src="/thumb/490/0/<?= substr( $product['images'][0]['src'], 1, strlen( $product['images'][0]['src'] ) );?>" alt="<?= $product['images'][0]['alt'];?>">
|
||||
<? else:?>
|
||||
<img class="first" src="/thumb/490/0/<?= substr( $product -> images[0]['src'], 1, strlen( $product -> images[0]['src'] ) );?>" alt="<?= $product -> images[0]['alt'];?>">
|
||||
<? if ( file_exists( substr( $product -> images[1]['src'], 1 ) ) ):?>
|
||||
<img class="second" src="/thumb/490/0/<?= substr( $product -> images[1]['src'], 1, strlen( $product -> images[1]['src'] ) );?>" alt="<?= $product -> images[1]['alt'];?>">
|
||||
<img class="first" src="/thumb/490/0/<?= substr( $product['images'][0]['src'], 1, strlen( $product['images'][0]['src'] ) );?>" alt="<?= $product['images'][0]['alt'];?>">
|
||||
<? if ( file_exists( substr( $product['images'][1]['src'], 1 ) ) ):?>
|
||||
<img class="second" src="/thumb/490/0/<?= substr( $product['images'][1]['src'], 1, strlen( $product['images'][1]['src'] ) );?>" alt="<?= $product['images'][1]['alt'];?>">
|
||||
<? else:?>
|
||||
<img class="second" src="/thumb/490/0/<?= substr( $product -> images[0]['src'], 1, strlen( $product -> images[0]['src'] ) );?>" alt="<?= $product -> images[0]['alt'];?>">
|
||||
<img class="second" src="/thumb/490/0/<?= substr( $product['images'][0]['src'], 1, strlen( $product['images'][0]['src'] ) );?>" alt="<?= $product['images'][0]['alt'];?>">
|
||||
<? endif;?>
|
||||
<? endif;?>
|
||||
<? else:?>
|
||||
@@ -36,39 +37,39 @@
|
||||
<div class="product-details">
|
||||
<h2 class="name">
|
||||
<a href="<?= $url;?>" class="a-name">
|
||||
<?= $product -> language['name'];?>
|
||||
<?= $product['language']['name'];?>
|
||||
</a>
|
||||
</h2>
|
||||
<div class="prices">
|
||||
<?
|
||||
$prices = $product -> getDefaultCombinationPrices();
|
||||
$prices = $productRepo->getDefaultCombinationPrices( $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 ( $product -> price_brutto_promo ):?>
|
||||
if ( $product['price_brutto_promo'] ):?>
|
||||
<div class="price-old">
|
||||
<?= \shop\Shop::shortPrice( $product -> price_brutto );?> <span class="small">zł</span>
|
||||
<?= \Shared\Helpers\Helpers::shortPrice( $product['price_brutto'] );?> <span class="small">zł</span>
|
||||
</div>
|
||||
<div class="price">
|
||||
<?= \shop\Shop::shortPrice( $product -> price_brutto_promo );?> <span class="small">zł</span>
|
||||
<?= \Shared\Helpers\Helpers::shortPrice( $product['price_brutto_promo'] );?> <span class="small">zł</span>
|
||||
</div>
|
||||
<? else:?>
|
||||
<div class="price">
|
||||
<?= \shop\Shop::shortPrice( $product -> price_brutto );?> <span class="small">zł</span>
|
||||
<?= \Shared\Helpers\Helpers::shortPrice( $product['price_brutto'] );?> <span class="small">zł</span>
|
||||
</div>
|
||||
<? endif;
|
||||
};?>
|
||||
|
||||
@@ -1,12 +1,28 @@
|
||||
<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 = \shop\Product::getFromCache( (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 +34,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 +49,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 +60,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 +72,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 +89,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 +101,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 +118,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 +128,4 @@
|
||||
<div class="alert alert-danger">Brak produktów w koszyku</div>
|
||||
<? endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -2,15 +2,15 @@
|
||||
$pm_found = false;
|
||||
|
||||
if ( is_array( $this -> payment_methods ) ): foreach ( $this -> payment_methods as $payment_method ):
|
||||
if ( $payment_method['id'] == \S::get_session( 'basket-payment-method-id' ) )
|
||||
if ( $payment_method['id'] == \Shared\Helpers\Helpers::get_session( 'basket-payment-method-id' ) )
|
||||
$pm_found = true;
|
||||
endforeach; endif;
|
||||
|
||||
$basket = \S::get_session( 'basket' );
|
||||
$coupon = \S::get_session( 'coupon' );
|
||||
$transport_cost = \front\factory\ShopTransport::transport_cost( \S::get_session( 'basket-transport-method-id' ) );
|
||||
$basket = \Shared\Helpers\Helpers::get_session( 'basket' );
|
||||
$coupon = \Shared\Helpers\Helpers::get_session( 'coupon' );
|
||||
$transport_cost = ( new \Domain\Transport\TransportRepository( $GLOBALS['mdb'] ) )->transportCostCached( (int)\Shared\Helpers\Helpers::get_session( 'basket-transport-method-id' ) ) ?? 0.0;
|
||||
|
||||
$basket_summary = \front\factory\ShopBasket::summary_price( $basket, $coupon ) + $transport_cost;
|
||||
$basket_summary = \Domain\Basket\BasketCalculator::summaryPrice( $basket, $coupon ) + $transport_cost;
|
||||
?>
|
||||
<? if ( is_array( $this -> payment_methods ) ): foreach ( $this -> payment_methods as $payment_method ):?>
|
||||
<? if ( $payment_method['id'] != 6 or $payment_method['id'] == 6 and $basket_summary >= 40 and $basket_summary <= 1000 ):?>
|
||||
@@ -19,16 +19,16 @@
|
||||
<input type="radio" class="icheck" name="payment_method" value="<?= $payment_method['id'];?>"
|
||||
<?
|
||||
if (
|
||||
$payment_method['id'] == \S::get_session( 'basket-payment-method-id' )
|
||||
$payment_method['id'] == \Shared\Helpers\Helpers::get_session( 'basket-payment-method-id' )
|
||||
or
|
||||
count( $this -> payment_methods ) === 1
|
||||
or
|
||||
!\S::get_session( 'basket-payment-method-id' ) and $payment_method == end( $this -> payment_methods )
|
||||
!\Shared\Helpers\Helpers::get_session( 'basket-payment-method-id' ) and $payment_method == end( $this -> payment_methods )
|
||||
or
|
||||
\S::get_session( 'basket-payment-method-id' ) and !$pm_found and $payment_method == end( $this -> payment_methods )
|
||||
\Shared\Helpers\Helpers::get_session( 'basket-payment-method-id' ) and !$pm_found and $payment_method == end( $this -> payment_methods )
|
||||
):
|
||||
|
||||
\S::set_session( 'basket-payment-method-id', $payment_method['id'] );
|
||||
\Shared\Helpers\Helpers::set_session( 'basket-payment-method-id', $payment_method['id'] );
|
||||
|
||||
echo 'checked="checked"';
|
||||
endif;
|
||||
@@ -41,4 +41,4 @@
|
||||
</div>
|
||||
</div>
|
||||
<? endif;?>
|
||||
<? endforeach; endif;?>
|
||||
<? endforeach; endif;?>
|
||||
|
||||
@@ -16,7 +16,7 @@ if ( is_array( $this -> transports_methods ) )
|
||||
if ( !$transport_found )
|
||||
{
|
||||
$this -> transport_id = $default_transport_id;
|
||||
\S::set_session( 'basket-transport-method-id', $default_transport_id );
|
||||
\Shared\Helpers\Helpers::set_session( 'basket-transport-method-id', $default_transport_id );
|
||||
}
|
||||
}
|
||||
?>
|
||||
@@ -30,33 +30,33 @@ if ( is_array( $this -> transports_methods ) )
|
||||
<div class="small"><?= $transport_method['description'];?></div>
|
||||
</div>
|
||||
<div class="price">
|
||||
<?= \S::decimal( $transport_method['cost'], 2 );?> zł
|
||||
<?= \Shared\Helpers\Helpers::decimal( $transport_method['cost'], 2 );?> zł
|
||||
</div>
|
||||
</div>
|
||||
<? if ( $transport_method['id'] == 1 or $transport_method['id'] == 2 ):?>
|
||||
<div class="inpost-info inpost-info-<?= $transport_method['id'];?>">
|
||||
<? if ( $transport_method['id'] == $this -> transport_id ):?><?= \S::get_session( 'basket-inpost-info' );?>
|
||||
<a href="#" onclick="inpost_map( <?= $transport_method['id'];?> ); return false;"><?= \S::lang( 'wybierz' );?></a>
|
||||
<? if ( $transport_method['id'] == $this -> transport_id ):?><?= \Shared\Helpers\Helpers::get_session( 'basket-inpost-info' );?>
|
||||
<a href="#" onclick="inpost_map( <?= $transport_method['id'];?> ); return false;"><?= \Shared\Helpers\Helpers::lang( 'wybierz' );?></a>
|
||||
<? endif;?>
|
||||
</div>
|
||||
<? endif;?>
|
||||
<? if ( $transport_method['id'] == 9 ):?>
|
||||
<div class="orlen-info orlen-info-<?= $transport_method['id'];?>">
|
||||
<input type="hidden" name="orlen_point_id" id="orlen_point_id" value="<?= \S::get_session( 'basket_orlen_point_id' );?>">
|
||||
<input type="hidden" name="orlen_point_id" id="orlen_point_id" value="<?= \Shared\Helpers\Helpers::get_session( 'basket_orlen_point_id' );?>">
|
||||
<?
|
||||
if ( \S::get_session( 'basket-transport-method-id' ) != 9 )
|
||||
if ( \Shared\Helpers\Helpers::get_session( 'basket-transport-method-id' ) != 9 )
|
||||
$class = 'hidden';
|
||||
?>
|
||||
<span id="orlen_point_info" class="<?= $class;?>"><?= \S::get_session( 'basket_orlen_point_info' );?></span>
|
||||
<a href="#" class="orlen-widget <?= $class;?>" data-target="#orlen_point_id" data-label="#orlen_point_info" data-type="all" data-layout="tabs" onclick="return false;"><?= \S::lang( 'wybierz' );?></a>
|
||||
<span id="orlen_point_info" class="<?= $class;?>"><?= \Shared\Helpers\Helpers::get_session( 'basket_orlen_point_info' );?></span>
|
||||
<a href="#" class="orlen-widget <?= $class;?>" data-target="#orlen_point_id" data-label="#orlen_point_info" data-type="all" data-layout="tabs" onclick="return false;"><?= \Shared\Helpers\Helpers::lang( 'wybierz' );?></a>
|
||||
</div>
|
||||
<? endif;?>
|
||||
<? endforeach; endif;?>
|
||||
<script class="footer" type="text/javascript">
|
||||
$( function() {
|
||||
|
||||
<? if ( \S::get_session( 'basket-transport-method-id' ) ):?>
|
||||
transport_checked( <?= \S::get_session( 'basket-transport-method-id' );?>, <?= \S::get_session( 'basket-payment-method-id' ) != '' ? \S::get_session( 'basket-payment-method-id' ) : 0;?>, false );
|
||||
<? if ( \Shared\Helpers\Helpers::get_session( 'basket-transport-method-id' ) ):?>
|
||||
transport_checked( <?= \Shared\Helpers\Helpers::get_session( 'basket-transport-method-id' );?>, <?= \Shared\Helpers\Helpers::get_session( 'basket-payment-method-id' ) != '' ? \Shared\Helpers\Helpers::get_session( 'basket-payment-method-id' ) : 0;?>, false );
|
||||
<? endif;?>
|
||||
|
||||
$( '#transport-methods .icheck' ).iCheck({
|
||||
|
||||
@@ -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; ?>
|
||||
@@ -242,7 +242,7 @@
|
||||
|
||||
$.alert({
|
||||
|
||||
title: '<?= ucfirst(\S::lang('uwaga')); ?>',
|
||||
title: '<?= ucfirst(\Shared\Helpers\Helpers::lang('uwaga')); ?>',
|
||||
content: 'Proszę wybrać punkt odbioru',
|
||||
type: 'blue',
|
||||
closeIcon: true,
|
||||
@@ -254,7 +254,7 @@
|
||||
autoClose: 'confirm|5000',
|
||||
buttons: {
|
||||
confirm: {
|
||||
text: '<?= \S::lang('zamknij'); ?>',
|
||||
text: '<?= \Shared\Helpers\Helpers::lang('zamknij'); ?>',
|
||||
btnClass: 'btn-blue',
|
||||
keys: ['enter'],
|
||||
action: function() {}
|
||||
@@ -403,8 +403,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: 'fas fa-close',
|
||||
typeAnimated: true,
|
||||
@@ -414,7 +414,7 @@
|
||||
autoClose: 'cancel|10000',
|
||||
buttons: {
|
||||
confirm: {
|
||||
text: '<?= \S::lang('usun'); ?>',
|
||||
text: '<?= \Shared\Helpers\Helpers::lang('usun'); ?>',
|
||||
btnClass: 'btn-orange',
|
||||
keys: ['enter'],
|
||||
action: function() {
|
||||
@@ -451,7 +451,7 @@
|
||||
}
|
||||
},
|
||||
cancel: {
|
||||
text: '<?= \S::lang('zamknij'); ?>',
|
||||
text: '<?= \Shared\Helpers\Helpers::lang('zamknij'); ?>',
|
||||
btnClass: 'btn-blue',
|
||||
action: function() {}
|
||||
}
|
||||
|
||||
@@ -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 = \shop\Product::getFromCache( $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 '<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>';
|
||||
}
|
||||
?>
|
||||
@@ -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,13 +84,13 @@
|
||||
<div class="basket-summary">
|
||||
Wartość koszyka: 1
|
||||
<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">
|
||||
@@ -99,7 +100,7 @@
|
||||
<span>0,00 zł</span>
|
||||
<? else:?>
|
||||
<span>
|
||||
<?= \S::decimal( $this -> transport[ 'cost' ] );?> zł
|
||||
<?= \Shared\Helpers\Helpers::decimal( $this -> transport[ 'cost' ] );?> zł
|
||||
</span>
|
||||
<? endif;?>
|
||||
</div>
|
||||
@@ -109,7 +110,7 @@
|
||||
$summary -= $discount;
|
||||
?>
|
||||
<span id="order-summary">
|
||||
<?= $this -> transport[ 'delivery_free' ] == 1 ? \S::decimal( $summary ) : \S::decimal( $summary + $this -> transport[ 'cost' ] );?> zł
|
||||
<?= $this -> transport[ 'delivery_free' ] == 1 ? \Shared\Helpers\Helpers::decimal( $summary ) : \Shared\Helpers\Helpers::decimal( $summary + $this -> transport[ 'cost' ] );?> zł
|
||||
</span>
|
||||
</div>
|
||||
<div class="basket-summary">
|
||||
@@ -132,25 +133,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>
|
||||
@@ -172,7 +173,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;?>
|
||||
]
|
||||
|
||||
@@ -1,9 +1,22 @@
|
||||
<div id="category-subcategory-tiles">
|
||||
<ul class="category-subcategory-tiles">
|
||||
<?php foreach ( $this -> categories as $category ): ?>
|
||||
<?php
|
||||
global $lang_id;
|
||||
$categoryRepo = new \Domain\Category\CategoryRepository( $GLOBALS['mdb'] );
|
||||
foreach ( $this -> categories as $category ):
|
||||
$title = $category['language']['title'] ?? ( $category['title'] ?? '' );
|
||||
$url = '#';
|
||||
if ( !empty( $category['id'] ) ) {
|
||||
$url = $categoryRepo->categoryUrl( (int)$category['id'], (string)$lang_id );
|
||||
} elseif ( !empty( $category['language']['seo_link'] ) ) {
|
||||
$url = '/' . ltrim( (string)$category['language']['seo_link'], '/' );
|
||||
} elseif ( !empty( $category['seo_link'] ) ) {
|
||||
$url = '/' . ltrim( (string)$category['seo_link'], '/' );
|
||||
}
|
||||
?>
|
||||
<li class="category-subcategory-tile">
|
||||
<a href="/<?= $category['seo_link']; ?>"><?= $category['title']; ?></a>
|
||||
<a href="<?= $url; ?>"><?= $title; ?></a>
|
||||
</li>
|
||||
<?php endforeach; ?>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<? global $lang_id;?>
|
||||
<div class="row">
|
||||
<? if ( is_array( $this -> products ) ): foreach ( $this -> products as $product_id ):?>
|
||||
<?= \Tpl::view( 'shop-product/product-mini', [
|
||||
'product' => \shop\Product::getFromCache( $product_id, $lang_id ),
|
||||
<?= \Shared\Tpl\Tpl::view( 'shop-product/product-mini', [
|
||||
'product' => (new \Domain\Product\ProductRepository($GLOBALS['mdb']))->findCached( $product_id, $lang_id ),
|
||||
'class' => 'col-12 col-sm-6 col-lg-3'
|
||||
] );?>
|
||||
<? endforeach; endif;?>
|
||||
|
||||
@@ -14,10 +14,10 @@ if ( is_array( $this -> categories ) ):
|
||||
endif;
|
||||
?>">
|
||||
<?
|
||||
$category['language']['seo_link'] ? $url = '/' . $category['language']['seo_link'] : $url = '/k-' . $category['id'] . '-' . \S::seo( $category['language']['title'] );
|
||||
$category['language']['seo_link'] ? $url = '/' . $category['language']['seo_link'] : $url = '/k-' . $category['id'] . '-' . \Shared\Helpers\Helpers::seo( $category['language']['title'] );
|
||||
|
||||
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;
|
||||
?>
|
||||
<a href="<?= $url;?>" title="<?= $category['language']['title'];?>" <? if ( is_array( $category['categories'] ) ) echo "class='menu-trigger'";?>>
|
||||
<?= $category['language']['title'];?>
|
||||
@@ -28,7 +28,7 @@ if ( is_array( $this -> categories ) ):
|
||||
<? if ( is_array( $category['categories'] ) and $category['id'] != $this -> current_category and $this -> level != 0 ):?>
|
||||
<i class="fa fa-chevron-down toggle" category="<?= $category['id'];?>"></i>
|
||||
<? endif;?>
|
||||
<? if ( is_array( $category['categories'] ) ) echo \front\view\ShopCategory::categories( $category['categories'], $this -> current_category, $this -> level + 1 );?>
|
||||
<? if ( is_array( $category['categories'] ) ) echo \front\Views\ShopCategory::categories( $category['categories'], $this -> current_category, $this -> level + 1 );?>
|
||||
</li>
|
||||
<? endif;?>
|
||||
<? endforeach;?>
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<div id="visible"><?= $this->category['language']['text']; ?></div>
|
||||
<div id="hidden"><?= $this->category['language']['text_hidden']; ?></div>
|
||||
<? if ($this->category['language']['text_hidden']) : ?>
|
||||
<a href="#" class="btn"><?= \S::lang('wiecej'); ?></a>
|
||||
<a href="#" class="btn"><?= \Shared\Helpers\Helpers::lang('wiecej'); ?></a>
|
||||
<? endif; ?>
|
||||
</div>
|
||||
<? endif; ?>
|
||||
@@ -14,10 +14,10 @@
|
||||
e.preventDefault();
|
||||
if ($('#category-description #hidden').is(':visible')) {
|
||||
$('#category-description #hidden').slideToggle();
|
||||
$('#category-description .btn').html('<?= \S::lang('wiecej'); ?>');
|
||||
$('#category-description .btn').html('<?= \Shared\Helpers\Helpers::lang('wiecej'); ?>');
|
||||
} else {
|
||||
$('#category-description #hidden').slideToggle();
|
||||
$('#category-description .btn').html('<?= \S::lang('mniej'); ?>');
|
||||
$('#category-description .btn').html('<?= \Shared\Helpers\Helpers::lang('mniej'); ?>');
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
@@ -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;
|
||||
?>
|
||||
<div class="category-content">
|
||||
<? if (is_array($this->products)) : foreach ($this->products as $product_id) :
|
||||
echo \Tpl::view('shop-product/product-mini', [
|
||||
'product' => \shop\Product::getFromCache( $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;
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
<? 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;
|
||||
@@ -15,8 +15,8 @@ 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;
|
||||
@@ -24,16 +24,16 @@ endif;
|
||||
|
||||
<div class="category-content" t='2'>
|
||||
<? if ( is_array( $this -> products ) ): foreach ( $this -> products as $product_id ):
|
||||
echo \Tpl::view( 'shop-product/product-mini', [
|
||||
'product' => \shop\Product::getFromCache( $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>
|
||||
<?= $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;
|
||||
?>
|
||||
?>
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
<? 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;?>
|
||||
<div class="category-content">
|
||||
<? $productRepo = new \Domain\Product\ProductRepository( $GLOBALS['mdb'] ); ?>
|
||||
<? 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' => $productRepo->findCached( $product_id, $lang_id )
|
||||
] );
|
||||
endforeach; endif;?>
|
||||
</div>
|
||||
@@ -1,33 +1,33 @@
|
||||
<div class="client-panel address-edit box">
|
||||
<?= \front\view\ShopClient::client_menu( [
|
||||
<?= \front\Views\ShopClient::clientMenu( [
|
||||
'active_page' => 'addresses'
|
||||
] );?>
|
||||
<div class="box-title">
|
||||
<?= ucfirst( \S::lang( 'adresy-do-wysylki' ) );?>
|
||||
<?= ucfirst( \Shared\Helpers\Helpers::lang( 'adresy-do-wysylki' ) );?>
|
||||
</div>
|
||||
<form method="POST" class="box-mini" action="/shopClient/address_save" id="f-new-address">
|
||||
<? if ( $this -> address['id'] ):?>
|
||||
<input type="hidden" name="address_id" value="<?= $this -> address['id'];?>">
|
||||
<? endif;?>
|
||||
<div class="form-group">
|
||||
<input type="text" name="name" required class="form-control" placeholder="<?= ucfirst( \S::lang( 'imie' ) );?>" value="<?= htmlspecialchars( $this -> address['name'] );?>">
|
||||
<input type="text" name="name" required class="form-control" placeholder="<?= ucfirst( \Shared\Helpers\Helpers::lang( 'imie' ) );?>" value="<?= htmlspecialchars( $this -> address['name'] );?>">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<input type="text" name="surname" required class="form-control" placeholder="<?= ucfirst( \S::lang( 'nazwisko' ) );?>" value="<?= htmlspecialchars( $this -> address['surname'] );?>">
|
||||
<input type="text" name="surname" required class="form-control" placeholder="<?= ucfirst( \Shared\Helpers\Helpers::lang( 'nazwisko' ) );?>" value="<?= htmlspecialchars( $this -> address['surname'] );?>">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<input type="text" name="street" required class="form-control" placeholder="<?= ucfirst( \S::lang( 'ulica-i-numer' ) );?>" value="<?= htmlspecialchars( $this -> address['street'] );?>">
|
||||
<input type="text" name="street" required class="form-control" placeholder="<?= ucfirst( \Shared\Helpers\Helpers::lang( 'ulica-i-numer' ) );?>" value="<?= htmlspecialchars( $this -> address['street'] );?>">
|
||||
</div>
|
||||
<div class="form-group row-flex">
|
||||
<input type="text" name="postal_code" required class="form-control" pattern="[0-9]{2}-[0-9]{3}" title="Format xx-xxx" placeholder="<?= ucfirst( \S::lang( 'kod-pocztowy' ) );?>" value="<?= htmlspecialchars( $this -> address['postal_code'] );?>">
|
||||
<input type="text" name="city" required class="form-control" placeholder="<?= ucfirst( \S::lang( 'miejscowosc' ) );?>" value="<?= htmlspecialchars( $this -> address['city'] );?>">
|
||||
<input type="text" name="postal_code" required class="form-control" pattern="[0-9]{2}-[0-9]{3}" title="Format xx-xxx" placeholder="<?= ucfirst( \Shared\Helpers\Helpers::lang( 'kod-pocztowy' ) );?>" value="<?= htmlspecialchars( $this -> address['postal_code'] );?>">
|
||||
<input type="text" name="city" required class="form-control" placeholder="<?= ucfirst( \Shared\Helpers\Helpers::lang( 'miejscowosc' ) );?>" value="<?= htmlspecialchars( $this -> address['city'] );?>">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<input type="text" name="phone" required class="form-control" placeholder="<?= ucfirst( \S::lang( 'numer-telefonu' ) );?>" value="<?= htmlspecialchars( $this -> address['phone'] );?>">
|
||||
<input type="text" name="phone" required class="form-control" placeholder="<?= ucfirst( \Shared\Helpers\Helpers::lang( 'numer-telefonu' ) );?>" value="<?= htmlspecialchars( $this -> address['phone'] );?>">
|
||||
</div>
|
||||
<div class="form-group row-flex">
|
||||
<a href="/panel-klienta/adresy" class="btn btn-dark"><?= ucfirst( \S::lang( 'anuluj' ) );?></a>
|
||||
<button type="submit" class="btn btn-success"><?= ucfirst( \S::lang( 'zapisz' ) );?></button>
|
||||
<a href="/panel-klienta/adresy" class="btn btn-dark"><?= ucfirst( \Shared\Helpers\Helpers::lang( 'anuluj' ) );?></a>
|
||||
<button type="submit" class="btn btn-success"><?= ucfirst( \Shared\Helpers\Helpers::lang( 'zapisz' ) );?></button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
@@ -1,11 +1,11 @@
|
||||
<div class="client-panel client-addresses box">
|
||||
<?= \front\view\ShopClient::client_menu( [
|
||||
<?= \front\Views\ShopClient::clientMenu( [
|
||||
'active_page' => 'addresses'
|
||||
] );?>
|
||||
<div class="box-title">
|
||||
<?= ucfirst( \S::lang( 'adresy-do-wysylki' ) );?>
|
||||
<?= ucfirst( \Shared\Helpers\Helpers::lang( 'adresy-do-wysylki' ) );?>
|
||||
</div>
|
||||
<a href="/panel-klienta/nowy-adres" class="btn btn-success btn-big"><?= ucfirst( \S::lang( 'dodaj-nowy-adres' ) );?></span></a>
|
||||
<a href="/panel-klienta/nowy-adres" class="btn btn-success btn-big"><?= ucfirst( \Shared\Helpers\Helpers::lang( 'dodaj-nowy-adres' ) );?></span></a>
|
||||
<? if ( is_array( $this -> addresses ) and count( $this -> addresses ) ):?>
|
||||
<div class="addresses">
|
||||
<? foreach ( $this -> addresses as $address ):?>
|
||||
@@ -16,8 +16,8 @@
|
||||
<br/><?= $address['postal_code'] . ' ' . $address['city'];?>
|
||||
<br/><?= $address['phone'];?>
|
||||
<div class="buttons">
|
||||
<a href="/panel-klienta/edytuj-adres/<?= $address['id'];?>"><?= \S::lang( 'zmien' );?></a>
|
||||
<a href="/panel-klienta/usun-adres/<?= $address['id'];?>" class="btn-delete text-danger"><?= \S::lang( 'usun' );?></a>
|
||||
<a href="/panel-klienta/edytuj-adres/<?= $address['id'];?>"><?= \Shared\Helpers\Helpers::lang( 'zmien' );?></a>
|
||||
<a href="/panel-klienta/usun-adres/<?= $address['id'];?>" class="btn-delete text-danger"><?= \Shared\Helpers\Helpers::lang( 'usun' );?></a>
|
||||
</div>
|
||||
</div>
|
||||
<? endforeach;?>
|
||||
@@ -35,8 +35,8 @@
|
||||
|
||||
$.alert(
|
||||
{
|
||||
title: '<?= ucfirst( \S::lang( 'potwierdz' ) );?>',
|
||||
content: '<?= \S::lang( 'potwierdz-usuniecie-adresu' );?>',
|
||||
title: '<?= ucfirst( \Shared\Helpers\Helpers::lang( 'potwierdz' ) );?>',
|
||||
content: '<?= \Shared\Helpers\Helpers::lang( 'potwierdz-usuniecie-adresu' );?>',
|
||||
type: 'orange',
|
||||
closeIcon: true,
|
||||
closeIconClass: 'fas fa-close',
|
||||
@@ -50,7 +50,7 @@
|
||||
{
|
||||
confirm:
|
||||
{
|
||||
text: '<?= \S::lang( 'usun' );?>',
|
||||
text: '<?= \Shared\Helpers\Helpers::lang( 'usun' );?>',
|
||||
btnClass: 'btn-orange',
|
||||
keys: ['enter'],
|
||||
action: function()
|
||||
@@ -60,7 +60,7 @@
|
||||
},
|
||||
cancel:
|
||||
{
|
||||
text: '<?= \S::lang( 'zamknij' );?>',
|
||||
text: '<?= \Shared\Helpers\Helpers::lang( 'zamknij' );?>',
|
||||
btnClass: 'btn-blue',
|
||||
action: function() {}
|
||||
}
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
<div class="client-menu">
|
||||
<ul>
|
||||
<li>
|
||||
<a href="/panel-klienta/zamowienia" title="<?= \S::lang( 'historia-zamowien' );?>" class="btn btn-success <? if ( $this -> active_page == 'orders' ):?>active<? endif;?>"><?= \S::lang( 'historia-zamowien' );?></a>
|
||||
<a href="/panel-klienta/zamowienia" title="<?= \Shared\Helpers\Helpers::lang( 'historia-zamowien' );?>" class="btn btn-success <? if ( $this -> active_page == 'orders' ):?>active<? endif;?>"><?= \Shared\Helpers\Helpers::lang( 'historia-zamowien' );?></a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="/panel-klienta/adresy" title="<?= \S::lang( 'adresy' );?>" class="btn btn-success <? if ( $this -> active_page == 'addresses' ):?>active<? endif;?>"><?= \S::lang( 'adresy' );?></a>
|
||||
<a href="/panel-klienta/adresy" title="<?= \Shared\Helpers\Helpers::lang( 'adresy' );?>" class="btn btn-success <? if ( $this -> active_page == 'addresses' ):?>active<? endif;?>"><?= \Shared\Helpers\Helpers::lang( 'adresy' );?></a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
@@ -1,15 +1,15 @@
|
||||
<? global $lang;?>
|
||||
<div class="client-panel client-orders-history box">
|
||||
<?= \front\view\ShopClient::client_menu( [
|
||||
<?= \front\Views\ShopClient::clientMenu( [
|
||||
'active_page' => 'orders'
|
||||
] );?>
|
||||
<div class="box-title">
|
||||
<?= ucfirst( \S::lang( 'historia-zamowien' ) );?>
|
||||
<?= ucfirst( \Shared\Helpers\Helpers::lang( 'historia-zamowien' ) );?>
|
||||
</div>
|
||||
<? if ( is_array( $this -> orders ) ): foreach ( $this -> orders as $order ):?>
|
||||
<?= \Tpl::view( 'shop-order/order-simple', [
|
||||
<?= \Shared\Tpl\Tpl::view( 'shop-order/order-simple', [
|
||||
'order' => $order,
|
||||
'statuses' => \shop\Order::order_statuses()
|
||||
'statuses' => ( new \Domain\Order\OrderRepository( $GLOBALS['mdb'] ) )->orderStatuses()
|
||||
] );?>
|
||||
<? endforeach; endif;?>
|
||||
</div>
|
||||
@@ -1,20 +1,20 @@
|
||||
<div class="user-login">
|
||||
<div class="content">
|
||||
<div class="box-title">
|
||||
<?= ucfirst( \S::lang( 'logowanie' ) );?>
|
||||
<?= ucfirst( \Shared\Helpers\Helpers::lang( 'logowanie' ) );?>
|
||||
</div>
|
||||
<form method="POST" action="/shopClient/login">
|
||||
<input type="hidden" name="redirect" value="<?= $_SERVER['REQUEST_URI'];?>">
|
||||
<div class="form-group">
|
||||
<input type="email" name="email" required id="email" class="form-control" placeholder="<?= ucfirst( \S::lang( 'email' ) );?>">
|
||||
<input type="email" name="email" required id="email" class="form-control" placeholder="<?= ucfirst( \Shared\Helpers\Helpers::lang( 'email' ) );?>">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<input type="password" name="password" required id="password" class="form-control" placeholder="<?= ucfirst( \S::lang( 'haslo' ) );?>">
|
||||
<input type="password" name="password" required id="password" class="form-control" placeholder="<?= ucfirst( \Shared\Helpers\Helpers::lang( 'haslo' ) );?>">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<button type="submit" class="btn btn-success"><?= ucfirst( \S::lang( 'zaloguj-sie' ) );?></button>
|
||||
<span><?= \S::lang( 'nie-pamietasz-hasla' );?> <a href="/odzyskiwanie-hasla"><?= ucfirst( \S::lang( 'nowe-haslo' ) );?></a>.</span><br />
|
||||
<span><?= \S::lang( 'nie-masz-konta' );?> <a href="/rejestracja"><?= ucfirst( \S::lang( 'zarejestruj-sie' ) );?></a>.
|
||||
<button type="submit" class="btn btn-success"><?= ucfirst( \Shared\Helpers\Helpers::lang( 'zaloguj-sie' ) );?></button>
|
||||
<span><?= \Shared\Helpers\Helpers::lang( 'nie-pamietasz-hasla' );?> <a href="/odzyskiwanie-hasla"><?= ucfirst( \Shared\Helpers\Helpers::lang( 'nowe-haslo' ) );?></a>.</span><br />
|
||||
<span><?= \Shared\Helpers\Helpers::lang( 'nie-masz-konta' );?> <a href="/rejestracja"><?= ucfirst( \Shared\Helpers\Helpers::lang( 'zarejestruj-sie' ) );?></a>.
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
@@ -2,6 +2,6 @@
|
||||
<? if ( !$this -> client ):?>
|
||||
<?= ucfirst( $lang['witaj'] );?>! <a href="/logowanie" title="Zaloguj się"> <?= ucfirst( $lang['zaloguj-sie'] );?></a> <?= $lang['lub'];?> <a href="/rejestracja" title="Rejestracja"><?= $lang['zarejestruj-sie'];?></a>
|
||||
<? else:?>
|
||||
<a href="/panel-klienta/zamowienia" title="<?= ucfirst( \S::lang( 'moje-konto' ) );?>" id="user-account"><span class="fa fa-user"></span><?= ucfirst( \S::lang( 'moje-konto' ) );?></a>
|
||||
<a href="/wylogowanie" title="<?= ucfirst( \S::lang( 'wyloguj-sie' ) );?>" id="user-logout"><span class="fa fa-unlock"></span><?= ucfirst( \S::lang( 'wyloguj-sie' ) );?></a>
|
||||
<a href="/panel-klienta/zamowienia" title="<?= ucfirst( \Shared\Helpers\Helpers::lang( 'moje-konto' ) );?>" id="user-account"><span class="fa fa-user"></span><?= ucfirst( \Shared\Helpers\Helpers::lang( 'moje-konto' ) );?></a>
|
||||
<a href="/wylogowanie" title="<?= ucfirst( \Shared\Helpers\Helpers::lang( 'wyloguj-sie' ) );?>" id="user-logout"><span class="fa fa-unlock"></span><?= ucfirst( \Shared\Helpers\Helpers::lang( 'wyloguj-sie' ) );?></a>
|
||||
<? endif; ?>
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
<div class="user-login box">
|
||||
<div class="content">
|
||||
<div class="box-title">
|
||||
<?= ucfirst( \S::lang( 'odzyskiwanie-hasla' ) );?>
|
||||
<?= ucfirst( \Shared\Helpers\Helpers::lang( 'odzyskiwanie-hasla' ) );?>
|
||||
</div>
|
||||
<form method="POST" action="/shopClient/send_email_password_recovery" id="f-password-recovery">
|
||||
<div class="form-group">
|
||||
<input type="email" name="email" required id="email" class="form-control" placeholder="<?= ucfirst( \S::lang( 'email' ) );?>">
|
||||
<input type="email" name="email" required id="email" class="form-control" placeholder="<?= ucfirst( \Shared\Helpers\Helpers::lang( 'email' ) );?>">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<button type="submit" class="btn btn-success"><?= ucfirst( \S::lang( 'resetuj-haslo' ) );?></button>
|
||||
<button type="submit" class="btn btn-success"><?= ucfirst( \Shared\Helpers\Helpers::lang( 'resetuj-haslo' ) );?></button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<div class="user-register box">
|
||||
<div class="content">
|
||||
<div class="box-title">
|
||||
<?= \S::lang('zaloz-konto-klienta');?>
|
||||
<?= \Shared\Helpers\Helpers::lang('zaloz-konto-klienta');?>
|
||||
</div>
|
||||
<form method="POST" action="/" id="f-user-register">
|
||||
<input type="hidden" id="type" name="type" value="0">
|
||||
@@ -9,29 +9,29 @@
|
||||
<input type="hidden" id="firm_id" name="firm_id" value="<?= $this -> firm_id;?>">
|
||||
<? endif;?>
|
||||
<div class="form-group">
|
||||
<input type="email" required id="email" class="form-control" placeholder="<?= ucfirst( \S::lang('email') );?>">
|
||||
<input type="email" required id="email" class="form-control" placeholder="<?= ucfirst( \Shared\Helpers\Helpers::lang('email') );?>">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<input type="password" required id="password" pattern="^\S{6,}$" class="form-control" placeholder="<?= ucfirst( \S::lang('haslo') );?> (<?= \S::lang('min');?> 6 <?= \S::lang('znakow');?>)">
|
||||
<input type="password" required id="password" pattern="^\S{6,}$" class="form-control" placeholder="<?= ucfirst( \Shared\Helpers\Helpers::lang('haslo') );?> (<?= \Shared\Helpers\Helpers::lang('min');?> 6 <?= \Shared\Helpers\Helpers::lang('znakow');?>)">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<input type="password" required id="password-repeat" pattern="^\S{6,}$" class="form-control" oninput="check_match(this)" placeholder="<?= ucfirst( \S::lang('powtorz-haslo') );?>">
|
||||
<input type="password" required id="password-repeat" pattern="^\S{6,}$" class="form-control" oninput="check_match(this)" placeholder="<?= ucfirst( \Shared\Helpers\Helpers::lang('powtorz-haslo') );?>">
|
||||
</div>
|
||||
<div class="form-group agreement">
|
||||
<input type="checkbox" required class="checkbox" name="agreement" id="agreement">
|
||||
<label for="agreement">
|
||||
<?
|
||||
$text = str_replace( '[LINK-REGULAMIN]', '<a href="/regulamin">' . \S::lang('regulamin') . '</a>', \S::lang('rejestracja-akceptacja-regulaminu') );
|
||||
echo $text = str_replace( '[LINK-POLITYKA-PRYWATNOSCI]', '<a href="/polityka-prywatnosci">' . \S::lang('polityke-prywatnosci') . '</a>', $text );
|
||||
$text = str_replace( '[LINK-REGULAMIN]', '<a href="/regulamin">' . \Shared\Helpers\Helpers::lang('regulamin') . '</a>', \Shared\Helpers\Helpers::lang('rejestracja-akceptacja-regulaminu') );
|
||||
echo $text = str_replace( '[LINK-POLITYKA-PRYWATNOSCI]', '<a href="/polityka-prywatnosci">' . \Shared\Helpers\Helpers::lang('polityke-prywatnosci') . '</a>', $text );
|
||||
?>
|
||||
</label>
|
||||
</div>
|
||||
<div class="form-group agreement-marketing">
|
||||
<input type="checkbox" name="agreement-marketing" class="checkbox" id="agreement-marketing"> <label for="agreement-marketing"><?= \S::lang('rejestracja-zgoda-na-marketing');?></label>
|
||||
<input type="checkbox" name="agreement-marketing" class="checkbox" id="agreement-marketing"> <label for="agreement-marketing"><?= \Shared\Helpers\Helpers::lang('rejestracja-zgoda-na-marketing');?></label>
|
||||
</div>
|
||||
<div class="form-group buttons">
|
||||
<button type="submit" class="btn btn-success"><?= ucfirst( \S::lang('zarejestruj-sie') );?></button>
|
||||
<span id="login"><?= ucfirst( \S::lang('masz-juz-konto') );?>? <a href="/logowanie"><?= ucfirst( \S::lang('zaloguj-sie') );?></a></span>
|
||||
<button type="submit" class="btn btn-success"><?= ucfirst( \Shared\Helpers\Helpers::lang('zarejestruj-sie') );?></button>
|
||||
<span id="login"><?= ucfirst( \Shared\Helpers\Helpers::lang('masz-juz-konto') );?>? <a href="/logowanie"><?= ucfirst( \Shared\Helpers\Helpers::lang('zaloguj-sie') );?></a></span>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
@@ -63,8 +63,8 @@
|
||||
{
|
||||
alert1 = $.alert(
|
||||
{
|
||||
title: '<?= ucfirst( \S::lang('informacja') );?>',
|
||||
content: '<?= \S::lang('prosze-czekac');?>',
|
||||
title: '<?= ucfirst( \Shared\Helpers\Helpers::lang('informacja') );?>',
|
||||
content: '<?= \Shared\Helpers\Helpers::lang('prosze-czekac');?>',
|
||||
type: 'orange',
|
||||
closeIcon: true,
|
||||
closeIconClass: 'fas fa-close',
|
||||
@@ -77,7 +77,7 @@
|
||||
{
|
||||
confirm:
|
||||
{
|
||||
text: '<?= \S::lang('zamknij');?>',
|
||||
text: '<?= \Shared\Helpers\Helpers::lang('zamknij');?>',
|
||||
btnClass: 'btn-orange',
|
||||
keys: ['enter'],
|
||||
action: function() {}
|
||||
@@ -92,7 +92,7 @@
|
||||
|
||||
$.alert(
|
||||
{
|
||||
title: '<?= ucfirst( \S::lang('informacja') );?>',
|
||||
title: '<?= ucfirst( \Shared\Helpers\Helpers::lang('informacja') );?>',
|
||||
content: response.msg,
|
||||
type: 'orange',
|
||||
closeIcon: true,
|
||||
@@ -107,7 +107,7 @@
|
||||
{
|
||||
confirm:
|
||||
{
|
||||
text: '<?= \S::lang('zamknij');?>',
|
||||
text: '<?= \Shared\Helpers\Helpers::lang('zamknij');?>',
|
||||
btnClass: 'btn-orange',
|
||||
keys: ['enter'],
|
||||
action: function() {}
|
||||
@@ -129,7 +129,7 @@
|
||||
function check_match(input)
|
||||
{
|
||||
if ( input.value !== document.getElementById( 'password' ).value )
|
||||
input.setCustomValidity( '<?= \S::lang('podane-hasla-sa-rozne');?>');
|
||||
input.setCustomValidity( '<?= \Shared\Helpers\Helpers::lang('podane-hasla-sa-rozne');?>');
|
||||
else
|
||||
input.setCustomValidity('');
|
||||
}
|
||||
|
||||
@@ -4,10 +4,10 @@ global $lang_id;
|
||||
if ( $this -> settings['ssl'] ) $base = 'https'; else $base = 'http';
|
||||
echo $this -> settings['newsletter_header'];
|
||||
?>
|
||||
<p style="font-family: Arial; font-size: 14px; font-weight: normal; margin-bottom: 25px;"><?= ucfirst( \S::lang( 'podsumowanie-zamowienia' ) );?> <?= \S::lang( 'nr' );?> <strong><?= $this -> order['number'];?></strong> <?= \S::lang( 'z-dnia' );?> <strong><?= date( 'd.m.Y H:i', strtotime( $this -> order['date_order'] ) );?></strong></p>
|
||||
<p><a href="<?= $base . "://" . $_SERVER['SERVER_NAME'];?>/zamowienie/<?= $this -> order['hash'];?>" style="display: block; width: 200px; text-align: center; padding: 10px; background: #77cdd1; color: #FFF; text-decoration: none; text-transform: uppercase;"><?= \S::lang( 'szczegoly-zamowienia' );?></a></p>
|
||||
<p style="font-family: Arial; font-size: 14px; font-weight: normal; margin-bottom: 25px;"><?= ucfirst( \Shared\Helpers\Helpers::lang( 'podsumowanie-zamowienia' ) );?> <?= \Shared\Helpers\Helpers::lang( 'nr' );?> <strong><?= $this -> order['number'];?></strong> <?= \Shared\Helpers\Helpers::lang( 'z-dnia' );?> <strong><?= date( 'd.m.Y H:i', strtotime( $this -> order['date_order'] ) );?></strong></p>
|
||||
<p><a href="<?= $base . "://" . $_SERVER['SERVER_NAME'];?>/zamowienie/<?= $this -> order['hash'];?>" style="display: block; width: 200px; text-align: center; padding: 10px; background: #77cdd1; color: #FFF; text-decoration: none; text-transform: uppercase;"><?= \Shared\Helpers\Helpers::lang( 'szczegoly-zamowienia' );?></a></p>
|
||||
<? if ( is_array( $this -> order['products'] ) ): foreach ( $this -> order['products'] as $product ):?>
|
||||
<? $summary_tmp += \S::normalize_decimal( $product['price_brutto'] * $product['quantity'] );?>
|
||||
<? $summary_tmp += \Shared\Helpers\Helpers::normalize_decimal( $product['price_brutto'] * $product['quantity'] );?>
|
||||
<? $quantity += $product['quantity'];?>
|
||||
<? endforeach; endif;?>
|
||||
<?
|
||||
@@ -20,14 +20,14 @@ echo $this -> settings['newsletter_header'];
|
||||
<? $summary_tmp += $this -> order['transport_cost'];?>
|
||||
<? if ( $this -> order['payment_method_id'] == 1 ):?>
|
||||
<div style="border-bottom: 1px solid #eee; margin-bottom: 15px;"></div>
|
||||
<p style="font-family: Arial; font-size: 14px; font-weight: 600; text-transform: uppercase;"><?= \S::lang( 'dane-do-przelewu' );?>:</p>
|
||||
<p style="font-family: Arial; font-size: 14px; font-weight: 600; text-transform: uppercase;"><?= \Shared\Helpers\Helpers::lang( 'dane-do-przelewu' );?>:</p>
|
||||
<div style="font-family: Arial; font-size: 14px;">
|
||||
<?= str_replace( [ '[KWOTA]', '[NR-ZAMOWIENIA]' ], [ \S::decimal( $summary_tmp ) . ' zł', $this -> order['number'] ], $this -> settings['shop_bank_account_info'] );?>
|
||||
<?= str_replace( [ '[KWOTA]', '[NR-ZAMOWIENIA]' ], [ \Shared\Helpers\Helpers::decimal( $summary_tmp ) . ' zł', $this -> order['number'] ], $this -> settings['shop_bank_account_info'] );?>
|
||||
</div>
|
||||
<? endif;?>
|
||||
|
||||
<div style="border-bottom: 1px solid #eee; margin-bottom: 15px;"></div>
|
||||
<p style="font-family: Arial; font-size: 14px; font-weight: 600; text-transform: uppercase;"><?= \S::lang( 'dane-do-dostawy' );?>:</p>
|
||||
<p style="font-family: Arial; font-size: 14px; font-weight: 600; text-transform: uppercase;"><?= \Shared\Helpers\Helpers::lang( 'dane-do-dostawy' );?>:</p>
|
||||
<p style="font-family: Arial; font-size: 14px; ">
|
||||
<?= $this -> order['client_surname'];?> <?= $this -> order['client_name'];?><br />
|
||||
<?= $this -> order['client_street'];?><br />
|
||||
@@ -43,7 +43,7 @@ echo $this -> settings['newsletter_header'];
|
||||
</p>
|
||||
<? if ( $this -> order['firm_name'] ):?>
|
||||
<div style="border-bottom: 1px solid #eee; margin-bottom: 15px;"></div>
|
||||
<p style="font-family: Arial; font-size: 14px; font-weight: 600; text-transform: uppercase;"><?= \S::lang( 'dane-do-faktury' );?>:</p>
|
||||
<p style="font-family: Arial; font-size: 14px; font-weight: 600; text-transform: uppercase;"><?= \Shared\Helpers\Helpers::lang( 'dane-do-faktury' );?>:</p>
|
||||
<p style="font-family: Arial; font-size: 14px; margin-top: 15px;">
|
||||
<?= $this -> order['firm_name'];?><br />
|
||||
<?= $this -> order['firm_street'];?><br />
|
||||
@@ -52,26 +52,26 @@ echo $this -> settings['newsletter_header'];
|
||||
</p>
|
||||
<? endif;?>
|
||||
<div style="border-bottom: 1px solid #eee; margin-bottom: 15px;"></div>
|
||||
<p style="font-family: Arial; font-size: 14px; font-weight: 600; text-transform: uppercase;"><?= \S::lang( 'zamowione-produkty' );?>:</p>
|
||||
<p style="font-family: Arial; font-size: 14px; font-weight: 600; text-transform: uppercase;"><?= \Shared\Helpers\Helpers::lang( 'zamowione-produkty' );?>:</p>
|
||||
<table style="font-family: Arial; width: 100%; max-width: 800px; border-collapse: collapse; font-size: 14px; margin-bottom: 25px;">
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="text-align: left; border-bottom: 1px solid #ccc;"><?= ucfirst( \S::lang( 'produkt' ) );?></th>
|
||||
<th style="text-align: right; border-bottom: 1px solid #ccc; padding: 0 5px;"><?= ucfirst( \S::lang( 'cena' ) );?></th>
|
||||
<th style="text-align: right; border-bottom: 1px solid #ccc; padding: 0 5px;"><?= ucfirst( \S::lang( 'ilosc' ) );?></th>
|
||||
<th style="text-align: right; border-bottom: 1px solid #ccc; padding: 0 5px;"><?= ucfirst( \S::lang( 'razem' ) );?></th>
|
||||
<th style="text-align: left; border-bottom: 1px solid #ccc;"><?= ucfirst( \Shared\Helpers\Helpers::lang( 'produkt' ) );?></th>
|
||||
<th style="text-align: right; border-bottom: 1px solid #ccc; padding: 0 5px;"><?= ucfirst( \Shared\Helpers\Helpers::lang( 'cena' ) );?></th>
|
||||
<th style="text-align: right; border-bottom: 1px solid #ccc; padding: 0 5px;"><?= ucfirst( \Shared\Helpers\Helpers::lang( 'ilosc' ) );?></th>
|
||||
<th style="text-align: right; border-bottom: 1px solid #ccc; padding: 0 5px;"><?= ucfirst( \Shared\Helpers\Helpers::lang( 'razem' ) );?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<? if ( is_array( $this -> order['products'] ) ): foreach ( $this -> order['products'] as $position ):?>
|
||||
<? $product = \shop\Product::getFromCache( $position['product_id'], $lang_id );?>
|
||||
<? $product = (new \Domain\Product\ProductRepository($GLOBALS['mdb']))->findCached( $position['product_id'], $lang_id );?>
|
||||
<tr style="border-bottom: 1px solid #eee;">
|
||||
<td style="padding: 10px 10px 10px 0;" colspan="4">
|
||||
<?
|
||||
$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;
|
||||
|
||||
$regex = "-(<a[^>]+href\s*=\s*['\"])(((?!'|\"|http://).)*)(['\"][^>]*>)-i";
|
||||
echo preg_replace( $regex, "$1" . $base . "://" . $_SERVER['SERVER_NAME'] . "$2$4", '<a href="' . $url . '" target="_blank" style="text-decoration: none; color: #77cdd1; font-size: 14px; font-weight: bold;">' . $product['language']['name'] . '</a>' );
|
||||
@@ -106,33 +106,36 @@ echo $this -> settings['newsletter_header'];
|
||||
</td>
|
||||
<td style="text-align: right; white-space: nowrap; padding: 0 5px;">
|
||||
<?
|
||||
echo \S::decimal( $position['price_brutto_promo'] ) . ' zł';
|
||||
|
||||
if ( $position['price_brutto_promo'] and $position['price_brutto_promo'] < $position['price_brutto'])
|
||||
echo '<u style="font-size: 15px; font-weight: 400; color: #c3c3c3; margin-left: 5px; text-decoration: line-through;">' . \S::decimal( $position['price_brutto'] ) . ' zł</u>';
|
||||
|
||||
if ( $position['price_brutto_promo'] and $position['price_brutto_promo'] < $position['price_brutto'] )
|
||||
$discount += \S::normalize_decimal( ( $position['price_brutto'] - $position['price_brutto_promo'] ) * $position['quantity'] );
|
||||
$_promo = round( (float)$position['price_brutto_promo'], 2 );
|
||||
$_base = round( (float)$position['price_brutto'], 2 );
|
||||
if ( $_promo > 0 and $_promo < $_base ) {
|
||||
echo \Shared\Helpers\Helpers::decimal( $_promo ) . ' zł';
|
||||
echo '<u style="font-size: 15px; font-weight: 400; color: #c3c3c3; margin-left: 5px; text-decoration: line-through;">' . \Shared\Helpers\Helpers::decimal( $_base ) . ' zł</u>';
|
||||
$discount += \Shared\Helpers\Helpers::normalize_decimal( ( $_base - $_promo ) * $position['quantity'] );
|
||||
} else {
|
||||
echo \Shared\Helpers\Helpers::decimal( $_base ) . ' zł';
|
||||
}
|
||||
$_effective = ( $_promo > 0 and $_promo < $_base ) ? $_promo : $_base;
|
||||
?>
|
||||
</td>
|
||||
<td style="text-align: right; white-space: nowrap; padding: 0 5px;">
|
||||
<?= $position['quantity'];?>
|
||||
</td>
|
||||
<td style="text-align: right; white-space: nowrap; padding: 0 5px;">
|
||||
<?= \S::decimal( \S::normalize_decimal( $position['price_brutto_promo'] * $position['quantity'] ) );?> zł
|
||||
<?= \Shared\Helpers\Helpers::decimal( \Shared\Helpers\Helpers::normalize_decimal( $_effective * $position['quantity'] ) );?> zł
|
||||
</td>
|
||||
</tr>
|
||||
<? $summary += \S::normalize_decimal( $position['price_brutto'] * $position['quantity'] );?>
|
||||
<? $summary += \Shared\Helpers\Helpers::normalize_decimal( $_base * $position['quantity'] );?>
|
||||
<? $quantity += $position['quantity'];?>
|
||||
<? endforeach; endif;?>
|
||||
<tr>
|
||||
<td style="text-align: right; font-weight: 600; padding-top: 10px;" colspan="3">Wartość koszyka:</td>
|
||||
<td style="text-align: right; font-weight: 600; padding-top: 10px; white-space: nowrap;"><?= \S::decimal( $summary );?> zł</td>
|
||||
<td style="text-align: right; font-weight: 600; padding-top: 10px; white-space: nowrap;"><?= \Shared\Helpers\Helpers::decimal( $summary );?> zł</td>
|
||||
</tr>
|
||||
<? if ( $discount ):?>
|
||||
<tr>
|
||||
<td style="text-align: right; font-weight: 600; padding-top: 10px;" colspan="4">
|
||||
Rabat: <span style="color: #cc0000;">-<?= \S::decimal( $discount );?> zł</span>
|
||||
Rabat: <span style="color: #cc0000;">-<?= \Shared\Helpers\Helpers::decimal( $discount );?> zł</span>
|
||||
</td>
|
||||
</tr>
|
||||
<? endif;?>
|
||||
@@ -148,11 +151,11 @@ echo $this -> settings['newsletter_header'];
|
||||
</tr>
|
||||
<tr style="border-bottom: 1px solid #eee;">
|
||||
<td style="text-align: right; font-weight: 600; padding-top: 10px; padding-bottom: 10px;" colspan="3"><?= $this -> order['transport'];?><div style="font-weight: 500; font-size: 13px; line-height: 16px; font-style: italic; margin-top: 5px;"><?= $this -> order['transport_description'];?></div></td>
|
||||
<td style="text-align: right; font-weight: 600; padding-top: 10px; padding-bottom: 10px; white-space: nowrap;"><?= \S::decimal( $this -> order['transport_cost'] );?> zł</td>
|
||||
<td style="text-align: right; font-weight: 600; padding-top: 10px; padding-bottom: 10px; white-space: nowrap;"><?= \Shared\Helpers\Helpers::decimal( $this -> order['transport_cost'] );?> zł</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="text-align: right; font-weight: 600; padding-top: 10px; padding-bottom: 10px;" colspan="3"><?= ucfirst( \S::lang( 'razem' ) );?>:</td>
|
||||
<td style="text-align: right; font-weight: 600; padding-top: 10px; padding-bottom: 10px; white-space: nowrap;"><?= \S::decimal( $summary - $discount + $this -> order['transport_cost'] );?> zł</td>
|
||||
<td style="text-align: right; font-weight: 600; padding-top: 10px; padding-bottom: 10px;" colspan="3"><?= ucfirst( \Shared\Helpers\Helpers::lang( 'razem' ) );?>:</td>
|
||||
<td style="text-align: right; font-weight: 600; padding-top: 10px; padding-bottom: 10px; white-space: nowrap;"><?= \Shared\Helpers\Helpers::decimal( $summary - $discount + $this -> order['transport_cost'] );?> zł</td>
|
||||
</tr>
|
||||
<? if ( $this -> order['message'] ):?>
|
||||
<tr style="border-top: 1px solid #eee;">
|
||||
|
||||
@@ -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 <b><?= \S::decimal( $this -> order['summary'] );?> zł</b></button>
|
||||
<button type="submit" name="submit_send" class="btn btn-success">Zapłać za pomocą PAYPO <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' );?> <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' );?> <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,19 +119,19 @@
|
||||
$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>
|
||||
<? 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,7 +161,7 @@
|
||||
} );
|
||||
<? 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({ ecommerce: null });
|
||||
@@ -171,8 +171,8 @@
|
||||
transaction_id: "<?= $this -> order['id'];?>",
|
||||
value: 25.42,
|
||||
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'] );?>,
|
||||
items: [
|
||||
<? foreach ( $this -> order['products'] as $product ):?>
|
||||
{
|
||||
@@ -189,4 +189,4 @@
|
||||
<? unset( $_SESSION['google-analytics-purchase'] );?>
|
||||
<? endif;?>
|
||||
});
|
||||
</script>
|
||||
</script>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<div class="order-summary-content">
|
||||
<div class="top">
|
||||
<div class="basket-summary left">
|
||||
Data zamówienia: <span><?= \S::pretty_date( 'j f Y', strtotime( $this -> order['date_order'] ) );?></span>
|
||||
Data zamówienia: <span><?= \Shared\Helpers\Helpers::pretty_date( 'j f Y', strtotime( $this -> order['date_order'] ) );?></span>
|
||||
</div>
|
||||
<div class="basket-summary left">
|
||||
Status zamówienia: <span><?= $this -> statuses[ $this -> order['status'] ];?></span>
|
||||
@@ -9,7 +9,7 @@
|
||||
</div>
|
||||
<div class="top-second">
|
||||
<div class="column">
|
||||
<h5><?= ucfirst( \S::lang( 'dane-do-dostawy' ) );?></h5>
|
||||
<h5><?= ucfirst( \Shared\Helpers\Helpers::lang( 'dane-do-dostawy' ) );?></h5>
|
||||
<p>
|
||||
<?= $this -> order['client_surname'];?> <?= $this -> order['client_name'];?><br />
|
||||
<?= $this -> order['client_street'];?><br />
|
||||
@@ -26,7 +26,7 @@
|
||||
</div>
|
||||
<div class="column">
|
||||
<? if ( $this -> order['firm_name'] ):?>
|
||||
<h5><?= \S::lang( 'dane-do-faktury' );?>:</h5>
|
||||
<h5><?= \Shared\Helpers\Helpers::lang( 'dane-do-faktury' );?>:</h5>
|
||||
<p>
|
||||
<?= $this -> order['firm_name'];?><br />
|
||||
<?= $this -> order['firm_street'];?><br />
|
||||
@@ -39,7 +39,7 @@
|
||||
<div class="products">
|
||||
<? if ( is_array( $this -> order['products'] ) and count( $this -> order['products'] ) ):?>
|
||||
<? foreach ( $this -> order['products'] as $product ):?>
|
||||
<? $product_tmp = \shop\Product::getFromCache( $product['product_id'], $lang['id'] );?>
|
||||
<? $product_tmp = (new \Domain\Product\ProductRepository($GLOBALS['mdb']))->findCached( $product['product_id'], $lang['id'] );?>
|
||||
<div class="basket-product">
|
||||
<div class="image">
|
||||
<? if ( file_exists( substr( $product_tmp['images'][0]['src'], 1 ) ) ):?>
|
||||
@@ -65,39 +65,42 @@
|
||||
<div class="prices">
|
||||
<div class="price">
|
||||
<?
|
||||
echo \S::decimal( $product['price_brutto_promo'] ) . ' zł';
|
||||
|
||||
if ( $product['price_brutto_promo'] and $product['price_brutto_promo'] < $product['price_brutto'] )
|
||||
echo '<u>' . \S::decimal( $product['price_brutto'] ) . ' zł</u>';
|
||||
|
||||
if ( $product['price_brutto_promo'] and $product['price_brutto_promo'] < $product['price_brutto'] )
|
||||
$discount += \S::normalize_decimal( ( $product['price_brutto'] - $product['price_brutto_promo'] ) * $product['quantity'] );
|
||||
$_promo = round( (float)$product['price_brutto_promo'], 2 );
|
||||
$_base = round( (float)$product['price_brutto'], 2 );
|
||||
if ( $_promo > 0 and $_promo < $_base ) {
|
||||
echo \Shared\Helpers\Helpers::decimal( $_promo ) . ' zł';
|
||||
echo '<u>' . \Shared\Helpers\Helpers::decimal( $_base ) . ' zł</u>';
|
||||
$discount += \Shared\Helpers\Helpers::normalize_decimal( ( $_base - $_promo ) * $product['quantity'] );
|
||||
} else {
|
||||
echo \Shared\Helpers\Helpers::decimal( $_base ) . ' zł';
|
||||
}
|
||||
$effective_price = ( $_promo > 0 and $_promo < $_base ) ? $_promo : $_base;
|
||||
?>
|
||||
<span>x <?= $product['quantity'];?></span>
|
||||
<?= \S::decimal( \S::normalize_decimal( $product['price_brutto'] * $product['quantity'] ) );?> zł
|
||||
<?= \Shared\Helpers\Helpers::decimal( \Shared\Helpers\Helpers::normalize_decimal( $effective_price * $product['quantity'] ) );?> zł
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<? $summary += \S::normalize_decimal( $product['price_brutto'] * $product['quantity'] );?>
|
||||
<? $summary += \Shared\Helpers\Helpers::normalize_decimal( $_base * $product['quantity'] );?>
|
||||
<? endforeach;?>
|
||||
<div class="basket-summary">
|
||||
Wartość koszyka <span><?= \S::decimal( $summary );?> zł</span>
|
||||
Wartość koszyka <span><?= \Shared\Helpers\Helpers::decimal( $summary );?> zł</span>
|
||||
</div>
|
||||
<? if ( $discount ):?>
|
||||
<div class="basket-summary">
|
||||
Rabat <span class="text-danger"><?= \S::decimal( $discount );?> zł</span>
|
||||
Rabat <span class="text-danger"><?= \Shared\Helpers\Helpers::decimal( $discount );?> zł</span>
|
||||
</div>
|
||||
<? endif;?>
|
||||
<? if ( $this -> coupon ):?>
|
||||
<div class="basket-summary">
|
||||
Kod rabatowy: <span style="color: #cc0000;"><?= $this -> coupon -> name;?> - <?= $this -> coupon -> amount;?> <?= $this -> coupon -> type == 1 ? '%' : 'zł';?></span>
|
||||
Kod rabatowy: <span style="color: #cc0000;"><?= $this -> coupon['name'];?> - <?= $this -> coupon['amount'];?> <?= $this -> coupon['type'] == 1 ? '%' : 'zł';?></span>
|
||||
</div>
|
||||
<? endif;?>
|
||||
<div class="basket-summary">
|
||||
<?= $this -> order['transport'];?> <span><?= \S::decimal( $this -> order['transport_cost'] );?> zł</span>
|
||||
<?= $this -> order['transport'];?> <span><?= \Shared\Helpers\Helpers::decimal( $this -> order['transport_cost'] );?> zł</span>
|
||||
</div>
|
||||
<div class="basket-summary big">
|
||||
<?= ucfirst( \S::lang( 'razem-z-dostawa' ) );?>: <span><?= \S::decimal( $summary - $discount + $this -> order['transport_cost'] );?> zł</span>
|
||||
<?= ucfirst( \Shared\Helpers\Helpers::lang( 'razem-z-dostawa' ) );?>: <span><?= \Shared\Helpers\Helpers::decimal( $summary - $discount + $this -> order['transport_cost'] );?> zł</span>
|
||||
</div>
|
||||
<? endif;?>
|
||||
<? if ( $this -> order['message'] ):?>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<div class="producer-list">
|
||||
<? foreach ( $this -> producers as $producer ):?>
|
||||
<div class="producer">
|
||||
<a href="/producent/<?= \S::seo( $producer['name'] );?>">
|
||||
<a href="/producent/<?= \Shared\Helpers\Helpers::seo( $producer['name'] );?>">
|
||||
<? if ( file_exists( substr( $producer['img'], 1, strlen( $producer['img'] ) ) ) ):?>
|
||||
<img src="<?= $producer['img'];?>" alt="<?= $producer['name'];?>">
|
||||
<? endif;?>
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
<? global $lang_id;?>
|
||||
<div class="category-content">
|
||||
<? if ( is_array( $this -> products ) ): foreach ( $this -> products as $product_id ):
|
||||
echo \Tpl::view( 'shop-product/product-mini', [
|
||||
'product' => $product = \shop\Product::getFromCache( $product_id, $lang_id )
|
||||
echo \Shared\Tpl\Tpl::view( 'shop-product/product-mini', [
|
||||
'product' => $product = (new \Domain\Product\ProductRepository($GLOBALS['mdb']))->findCached( $product_id, $lang_id )
|
||||
] );
|
||||
endforeach; endif;?>
|
||||
</div>
|
||||
<?= $this -> pager;?>
|
||||
<?
|
||||
if ( $this -> producer['languages'][$lang_id]['description'] ):
|
||||
echo \Tpl::view( 'shop-producer/description', [
|
||||
echo \Shared\Tpl\Tpl::view( 'shop-producer/description', [
|
||||
'description' => $this -> producer['languages'][$lang_id]['description']
|
||||
] );
|
||||
endif;
|
||||
|
||||
@@ -1,15 +1,16 @@
|
||||
<?php
|
||||
global $lang_id;
|
||||
$attribute_details = \front\factory\ShopAttribute::attribute_details( $this -> attribute['id'], $lang_id );
|
||||
$attributeRepo = new \Domain\Attribute\AttributeRepository( $GLOBALS['mdb'] );
|
||||
$attribute_details = $attributeRepo->frontAttributeDetails( (int)$this -> attribute['id'], $lang_id );
|
||||
if ( $attribute_details['type'] == 0 )
|
||||
{
|
||||
?>
|
||||
<div class="attribute-container fradio-group attribute-<?= \S::seo( $attribute_details['language']['name'] );?>" level="<?= $this -> level;?>" order="<?= $this -> order;?>" attribute="<?= \S::seo( $attribute_details['language']['name'] );?>" attribute-name="<?= $attribute_details['language']['name'];?>">
|
||||
<div class="attribute-container fradio-group attribute-<?= \Shared\Helpers\Helpers::seo( $attribute_details['language']['name'] );?>" level="<?= $this -> level;?>" order="<?= $this -> order;?>" attribute="<?= \Shared\Helpers\Helpers::seo( $attribute_details['language']['name'] );?>" attribute-name="<?= $attribute_details['language']['name'];?>">
|
||||
<p class="attribute-label"><?= $attribute_details['language']['name'];?>:</p>
|
||||
<? foreach ( $this -> attribute['values'] as $value ):?>
|
||||
<div class="fradio">
|
||||
<input type="radio" id="<?= $this -> attribute['id'];?>-<?= $value['id'];?>" <? if ( $value['is_default'] ):?>checked="checked"<? endif;?> require="true" value="<?= $this -> attribute['id'];?>-<?= $value['id'];?>" name="<?= \S::seo( $attribute_details['language']['name'] );?>">
|
||||
<label for="<?= $this -> attribute['id'];?>-<?= $value['id'];?>" order="<?= $this -> order;?>"><?= \shop\ProductAttribute::get_value_name( $value['id'], $lang_id );?></label>
|
||||
<input type="radio" id="<?= $this -> attribute['id'];?>-<?= $value['id'];?>" <? if ( $value['is_default'] ):?>checked="checked"<? endif;?> require="true" value="<?= $this -> attribute['id'];?>-<?= $value['id'];?>" name="<?= \Shared\Helpers\Helpers::seo( $attribute_details['language']['name'] );?>">
|
||||
<label for="<?= $this -> attribute['id'];?>-<?= $value['id'];?>" order="<?= $this -> order;?>"><?= ( new \Domain\Attribute\AttributeRepository( $GLOBALS['mdb'] ) )->getAttributeValueById( $value['id'], $lang_id );?></label>
|
||||
</div>
|
||||
<? if ( $value['is_default'] ):?>
|
||||
<script class="footer" type="text/javascript">
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
<?php
|
||||
use shop\Product;
|
||||
$product_meta = Product::product_meta($this->product_id);
|
||||
$product_meta = ( new \Domain\Product\ProductRepository( $GLOBALS['mdb'] ) )->productMeta( $this->product_id );
|
||||
?>
|
||||
|
||||
<?php if (is_array($product_meta) && count($product_meta)): ?>
|
||||
|
||||
@@ -5,15 +5,15 @@
|
||||
{
|
||||
if ( $this -> product['quantity'] > 0 or $this -> product['quantity'] == 0 and $this -> product['stock_0_buy'] )
|
||||
{
|
||||
if ( $this -> product -> language['warehouse_message_nonzero'] )
|
||||
echo $this -> product -> language['warehouse_message_nonzero'];
|
||||
if ( $this -> product['language']['warehouse_message_nonzero'] )
|
||||
echo $this -> product['language']['warehouse_message_nonzero'];
|
||||
else if ( $this -> settings['warehouse_message_nonzero_' . $this -> lang_id] )
|
||||
echo $this -> settings['warehouse_message_nonzero_' . $this -> lang_id];
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( $this -> product -> language['warehouse_message_zero'] )
|
||||
echo $this -> product -> language['warehouse_message_zero'];
|
||||
if ( $this -> product['language']['warehouse_message_zero'] )
|
||||
echo $this -> product['language']['warehouse_message_zero'];
|
||||
else if ( $this -> settings['warehouse_message_zero_' . $this -> lang_id] )
|
||||
echo $this -> settings['warehouse_message_zero_' . $this -> lang_id];
|
||||
}
|
||||
|
||||
@@ -1,25 +1,25 @@
|
||||
<? global $lang_id;?>
|
||||
<?
|
||||
$this -> product -> language['seo_link'] ? $url = '/' . $this -> product -> language['seo_link'] : $url = '/p-' . $this -> product['id'] . '-' . \S::seo( $this -> product -> language['name'] );
|
||||
$this -> product['language']['seo_link'] ? $url = '/' . $this -> product['language']['seo_link'] : $url = '/p-' . $this -> product['id'] . '-' . \Shared\Helpers\Helpers::seo( $this -> product['language']['name'] );
|
||||
|
||||
if ( \S::get_session( 'current-lang' ) != \front\factory\Languages::default_language() and $url != '#' )
|
||||
$url = '/' . \S::get_session( 'current-lang' ) . $url;
|
||||
if ( \Shared\Helpers\Helpers::get_session( 'current-lang' ) != ( new \Domain\Languages\LanguagesRepository( $GLOBALS['mdb'] ) )->defaultLanguage() and $url != '#' )
|
||||
$url = '/' . \Shared\Helpers\Helpers::get_session( 'current-lang' ) . $url;
|
||||
?>
|
||||
<div class="product-mini <?= $this -> product_mini_class;?>">
|
||||
<? if ( $this -> product -> new_to_date and $this -> product -> new_to_date >= date( 'Y-m-d' ) ):?>
|
||||
<div class="new"><?= \S::lang( 'nowosc' );?></div>
|
||||
<? if ( $this -> product['new_to_date'] and $this -> product['new_to_date'] >= date( 'Y-m-d' ) ):?>
|
||||
<div class="new"><?= \Shared\Helpers\Helpers::lang( 'nowosc' );?></div>
|
||||
<? endif;?>
|
||||
<a href="<?= $url;?>">
|
||||
<div class="img">
|
||||
<? if ( file_exists( substr( $this -> product -> images[0]['src'], 1 ) ) ):?>
|
||||
<? if ( file_exists( substr( $this -> product['images'][0]['src'], 1 ) ) ):?>
|
||||
<? if ( $this -> class == 'item' ):?>
|
||||
<img class="<?= $this -> product_mini_class == 'swiper-slide' ? '' : 'owl-lazy';?>" src="/thumb/500/0/<?= substr( $this -> product -> images[0]['src'], 1, strlen( $this -> product -> images[0]['src'] ) );?>" alt="<?= $this -> product -> images[0]['alt'];?>">
|
||||
<img class="<?= $this -> product_mini_class == 'swiper-slide' ? '' : 'owl-lazy';?>" src="/thumb/500/0/<?= substr( $this -> product['images'][0]['src'], 1, strlen( $this -> product['images'][0]['src'] ) );?>" alt="<?= $this -> product['images'][0]['alt'];?>">
|
||||
<? else:?>
|
||||
<img class="first" src="/thumb/500/0/<?= substr( $this -> product -> images[0]['src'], 1, strlen( $this -> product -> images[0]['src'] ) );?>" alt="<?= $this -> product -> images[0]['alt'];?>">
|
||||
<? if ( file_exists( substr( $this -> product -> images[1]['src'], 1 ) ) ):?>
|
||||
<img class="second" src="/thumb/1000/0/<?= substr( $this -> product -> images[1]['src'], 1, strlen( $this -> product -> images[1]['src'] ) );?>" alt="<?= $this -> product -> images[1]['alt'];?>">
|
||||
<img class="first" src="/thumb/500/0/<?= substr( $this -> product['images'][0]['src'], 1, strlen( $this -> product['images'][0]['src'] ) );?>" alt="<?= $this -> product['images'][0]['alt'];?>">
|
||||
<? if ( file_exists( substr( $this -> product['images'][1]['src'], 1 ) ) ):?>
|
||||
<img class="second" src="/thumb/1000/0/<?= substr( $this -> product['images'][1]['src'], 1, strlen( $this -> product['images'][1]['src'] ) );?>" alt="<?= $this -> product['images'][1]['alt'];?>">
|
||||
<? else:?>
|
||||
<img class="second" src="/thumb/1000/0/<?= substr( $this -> product -> images[0]['src'], 1, strlen( $this -> product -> images[0]['src'] ) );?>" alt="<?= $this -> product -> images[0]['alt'];?>">
|
||||
<img class="second" src="/thumb/1000/0/<?= substr( $this -> product['images'][0]['src'], 1, strlen( $this -> product['images'][0]['src'] ) );?>" alt="<?= $this -> product['images'][0]['alt'];?>">
|
||||
<? endif;?>
|
||||
<? endif;?>
|
||||
<? else:?>
|
||||
@@ -28,38 +28,38 @@
|
||||
</div>
|
||||
<div class="product-details">
|
||||
<h2 class="name">
|
||||
<?= $this -> product -> language['name'];?>
|
||||
<?= $this -> product['language']['name'];?>
|
||||
</h2>
|
||||
<div class="prices">
|
||||
<?
|
||||
$prices = $this -> product -> getDefaultCombinationPrices();
|
||||
$prices = ( new \Domain\Product\ProductRepository( $GLOBALS['mdb'] ) )->getDefaultCombinationPrices( $this -> product );
|
||||
if ( $prices )
|
||||
{
|
||||
if ( $prices['price_brutto_promo'] ):?>
|
||||
<div class="price-old">
|
||||
<?= \shop\Shop::shortPrice( $prices['price_brutto'] );?> <span class="small">zł</span>
|
||||
<?= \Shared\Helpers\Helpers::shortPrice( $prices['price_brutto'] );?> <span class="small">zł</span>
|
||||
</div>
|
||||
<div class="price">
|
||||
<?= \shop\Shop::shortPrice( $prices['price_brutto_promo'] );?> <span class="small">zł</span>
|
||||
<?= \Shared\Helpers\Helpers::shortPrice( $prices['price_brutto_promo'] );?> <span class="small">zł</span>
|
||||
</div>
|
||||
<? else:?>
|
||||
<div class="price">
|
||||
<?= \shop\Shop::shortPrice( $prices['price_brutto'] );?> <span class="small">zł</span>
|
||||
<?= \Shared\Helpers\Helpers::shortPrice( $prices['price_brutto'] );?> <span class="small">zł</span>
|
||||
</div>
|
||||
<? endif;
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( $this -> product -> price_brutto_promo ):?>
|
||||
if ( $this -> product['price_brutto_promo'] ):?>
|
||||
<div class="price-old">
|
||||
<?= \shop\Shop::shortPrice( $this -> product -> price_brutto );?> <span class="small">zł</span>
|
||||
<?= \Shared\Helpers\Helpers::shortPrice( $this -> product['price_brutto'] );?> <span class="small">zł</span>
|
||||
</div>
|
||||
<div class="price">
|
||||
<?= \shop\Shop::shortPrice( $this -> product -> price_brutto_promo );?> <span class="small">zł</span>
|
||||
<?= \Shared\Helpers\Helpers::shortPrice( $this -> product['price_brutto_promo'] );?> <span class="small">zł</span>
|
||||
</div>
|
||||
<? else:?>
|
||||
<div class="price">
|
||||
<?= \shop\Shop::shortPrice( $this -> product -> price_brutto );?> <span class="small">zł</span>
|
||||
<?= \Shared\Helpers\Helpers::shortPrice( $this -> product['price_brutto'] );?> <span class="small">zł</span>
|
||||
</div>
|
||||
<? endif;
|
||||
};?>
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
<? global $lang_id;?>
|
||||
<? global $lang_id, $mdb;?>
|
||||
<?
|
||||
$attributes = \shop\Product::get_product_attributes( $this -> product['product_combinations'] );
|
||||
$attributes = (new \Domain\Product\ProductRepository($GLOBALS['mdb']))->getProductAttributes( $this -> product['product_combinations'] );
|
||||
$dictionariesRepository = new \Domain\Dictionaries\DictionariesRepository( $mdb );
|
||||
?>
|
||||
<script class="footer" type="text/javascript">
|
||||
function fradio_label_click( element, refresh )
|
||||
@@ -18,67 +19,67 @@
|
||||
<div class="row">
|
||||
<div class="col-12 col-md-6">
|
||||
<div id="image-big">
|
||||
<? if ( $this -> product -> new_to_date and $this -> product -> new_to_date >= date( 'Y-m-d' ) ):?>
|
||||
<div class="new"><?= \S::lang( 'nowosc' );?></div>
|
||||
<? if ( $this -> product['new_to_date'] and $this -> product['new_to_date'] >= date( 'Y-m-d' ) ):?>
|
||||
<div class="new"><?= \Shared\Helpers\Helpers::lang( 'nowosc' );?></div>
|
||||
<? endif;?>
|
||||
<? if ( file_exists( substr( $this -> product -> images[0]['src'], 1 ) ) ):?>
|
||||
<? if ( file_exists( substr( $this -> product['images'][0]['src'], 1 ) ) ):?>
|
||||
<a image-id="0">
|
||||
<img src="/thumb/625/0<?= $this -> product -> images[0]['src'];?>" alt="">
|
||||
<img src="/thumb/625/0<?= $this -> product['images'][0]['src'];?>" alt="">
|
||||
</a>
|
||||
<? else:?>
|
||||
|
||||
<? endif;?>
|
||||
</div>
|
||||
<div class="gallery">
|
||||
<? for ( $i = 0; $i < count( $this -> product -> images ); $i++ ): if ( file_exists( substr( $this -> product -> images[$i]['src'], 1 ) ) ):?>
|
||||
<a href="<?= $this -> product -> images[$i]['src'];?>" class="item" data-fancybox="product" id="image-<?= $i;?>" i="<?= $i;?>">
|
||||
<img src="/thumb/180/0<?= $this -> product -> images[$i]['src'];?>" src="" alt="<?= $this -> product -> images[$i]['alt'];?>">
|
||||
<? for ( $i = 0; $i < count( $this -> product['images'] ); $i++ ): if ( file_exists( substr( $this -> product['images'][$i]['src'], 1 ) ) ):?>
|
||||
<a href="<?= $this -> product['images'][$i]['src'];?>" class="item" data-fancybox="product" id="image-<?= $i;?>" i="<?= $i;?>">
|
||||
<img src="/thumb/180/0<?= $this -> product['images'][$i]['src'];?>" src="" alt="<?= $this -> product['images'][$i]['alt'];?>">
|
||||
</a>
|
||||
<? endif; endfor;?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-12 col-md-6">
|
||||
<div class="product-options" id="product-options">
|
||||
<?= \Tpl::view( 'shop-product/_partial/product-warehouse-message', [
|
||||
<?= \Shared\Tpl\Tpl::view( 'shop-product/_partial/product-warehouse-message', [
|
||||
'product' => $this -> product,
|
||||
'lang_id' => $this -> lang_id,
|
||||
'settings' => $this -> settings
|
||||
] );?>
|
||||
<h1><?= $this -> product -> language['name'];?></h1>
|
||||
<h1><?= $this -> product['language']['name'];?></h1>
|
||||
<div class="prices">
|
||||
<? if ( $this -> product -> price_brutto_promo ):?>
|
||||
<? if ( $this -> product['price_brutto_promo'] ):?>
|
||||
<div class="price">
|
||||
<?= \shop\Shop::shortPrice( $this -> product -> price_brutto_promo );?> <span class="small">zł</span>
|
||||
<?= \Shared\Helpers\Helpers::shortPrice( $this -> product['price_brutto_promo'] );?> <span class="small">zł</span>
|
||||
</div>
|
||||
<div class="price-old">
|
||||
<?= \shop\Shop::shortPrice( $this -> product -> price_brutto );?> <span class="small">zł</span>
|
||||
<?= \Shared\Helpers\Helpers::shortPrice( $this -> product['price_brutto'] );?> <span class="small">zł</span>
|
||||
</div>
|
||||
<div class="price-minimal">
|
||||
Najniższa cena w ciągu ostatnich 30 dni: <strong><?= \shop\Shop::shortPrice( \front\factory\ShopProduct::get_minimal_price( $this -> product['id'], $this -> product -> price_brutto_promo ) );?> zł</strong>
|
||||
Najniższa cena w ciągu ostatnich 30 dni: <strong><?= \Shared\Helpers\Helpers::shortPrice( ( new \Domain\Product\ProductRepository( $GLOBALS['mdb'] ) )->getMinimalPriceCached( (int)$this -> product['id'], $this -> product['price_brutto_promo'] ) );?> zł</strong>
|
||||
</div>
|
||||
<? if ( $this -> product -> weight > 0 && $this -> product -> product_unit_id ):?>
|
||||
<? if ( $this -> product['weight'] > 0 && $this -> product['product_unit_id'] ):?>
|
||||
<div class="price_weight">
|
||||
<?= \shop\Shop::shortPrice( $this -> product -> price_brutto_promo / $this -> product -> wegiht * 1 );?> <?= $this -> product -> product_unit;?>
|
||||
<?= \Shared\Helpers\Helpers::shortPrice( $this -> product['price_brutto_promo'] / $this -> product['wegiht'] * 1 );?> <?= $this -> product['product_unit'];?>
|
||||
</div>
|
||||
<? endif;?>
|
||||
<? else:?>
|
||||
<div class="price">
|
||||
<?= \shop\Shop::shortPrice( $this -> product -> price_brutto );?> <span class="small">zł</span>
|
||||
<?= \Shared\Helpers\Helpers::shortPrice( $this -> product['price_brutto'] );?> <span class="small">zł</span>
|
||||
</div>
|
||||
<? if ( $this -> product -> weight > 0 && $this -> product -> product_unit_id ):?>
|
||||
<? if ( $this -> product['weight'] > 0 && $this -> product['product_unit_id'] ):?>
|
||||
<div class="price_weight">
|
||||
<?= \shop\Shop::shortPrice( $this -> product -> price_brutto / $this -> product -> weight );?> <span class="small">zł</span> / <?= \front\factory\Dictionaries::get_name_by_id( $this -> product -> product_unit_id, $this -> lang_id );?>
|
||||
<?= \Shared\Helpers\Helpers::shortPrice( $this -> product['price_brutto'] / $this -> product['weight'] );?> <span class="small">zł</span> / <?= $dictionariesRepository -> getUnitNameById( (int)$this -> product['product_unit_id'], $this -> lang_id );?>
|
||||
</div>
|
||||
<? endif;?>
|
||||
<? endif;?>
|
||||
</div>
|
||||
<form class="product-options" id="product-<?= $this -> product['id'];?>">
|
||||
<input type="hidden" name="product-id" value="<?= $this -> product -> id;?>">
|
||||
<? if ( \S::is_array_fix( $attributes ) ):?>
|
||||
<input type="hidden" name="product-id" value="<?= $this -> product['id'];?>">
|
||||
<? if ( \Shared\Helpers\Helpers::is_array_fix( $attributes ) ):?>
|
||||
<div id="attributes">
|
||||
<div class="title">Opcje produktu</div>
|
||||
<? foreach ( $attributes as $key => $val )
|
||||
echo \Tpl::view( 'shop-product/_partial/product-attribute', [
|
||||
echo \Shared\Tpl\Tpl::view( 'shop-product/_partial/product-attribute', [
|
||||
'attribute' => $val,
|
||||
'order' => $key,
|
||||
'level' => ++$level,
|
||||
@@ -91,7 +92,7 @@
|
||||
<textarea class="form-control" name="product-message" <? if ( $this -> product['additional_message_required'] ):?>required="required"<? endif;?> placeholder="<?= $this -> product['additional_message_text'] ? $this -> product['additional_message_text'] : 'Miejsce na dodatkową wiadomość';?>"></textarea>
|
||||
</div>
|
||||
<? endif;?>
|
||||
<?= \Tpl::view( 'shop-product/_partial/product-custom-fields', [
|
||||
<?= \Shared\Tpl\Tpl::view( 'shop-product/_partial/product-custom-fields', [
|
||||
'custom_fields' => $this -> product['custom_fields']
|
||||
] );?>
|
||||
<div class="add-to-basket">
|
||||
@@ -104,7 +105,7 @@
|
||||
<i class="fa fa-plus"></i>
|
||||
</a>
|
||||
</div>
|
||||
<button id="add-to-basket" class="btn btn-success"><?= \S::lang( 'do-koszyka' );?></span>
|
||||
<button id="add-to-basket" class="btn btn-success"><?= \Shared\Helpers\Helpers::lang( 'do-koszyka' );?></span>
|
||||
</button>
|
||||
<div class="alert hidden">Produkt chwilowo niedostępny.</div>
|
||||
<?
|
||||
@@ -113,8 +114,8 @@
|
||||
<script class="footer" type="text/javascript">
|
||||
$(function ()
|
||||
{
|
||||
$('#product-<?= $this -> product -> id;?> .add-to-basket .quantity-container, #product-<?= $this -> product -> id;?> .add-to-basket #add-to-basket').addClass('hidden');
|
||||
$('#product-<?= $this -> product -> id;?> .add-to-basket .alert').removeClass('hidden');
|
||||
$('#product-<?= $this -> product['id'];?> .add-to-basket .quantity-container, #product-<?= $this -> product['id'];?> .add-to-basket #add-to-basket').addClass('hidden');
|
||||
$('#product-<?= $this -> product['id'];?> .add-to-basket .alert').removeClass('hidden');
|
||||
});
|
||||
</script>
|
||||
<? endif;?>
|
||||
@@ -122,16 +123,16 @@
|
||||
</form>
|
||||
<? if ( $this -> product['producer'] and $this -> product['producer']['status'] ):?>
|
||||
<div class="product-producer">
|
||||
Producent: <a href="/producent/<?= \S::seo( $this -> product['producer']['name'] );?>" title="Produkty marki <?= htmlspecialchars( $this -> product['producer']['name'] );?>"><?= $this -> product['producer']['name'];?></a>
|
||||
Producent: <a href="/producent/<?= \Shared\Helpers\Helpers::seo( $this -> product['producer']['name'] );?>" title="Produkty marki <?= htmlspecialchars( $this -> product['producer']['name'] );?>"><?= $this -> product['producer']['name'];?></a>
|
||||
</div>
|
||||
<? endif;?>
|
||||
|
||||
<?= \Tpl::view( 'shop-product/_partial/product-meta', [
|
||||
<?= \Shared\Tpl\Tpl::view( 'shop-product/_partial/product-meta', [
|
||||
'product_id' => $this->product['id']
|
||||
]);?>
|
||||
|
||||
<div class="short-description">
|
||||
<?= $this -> product -> language['short_description'];?>
|
||||
<?= $this -> product['language']['short_description'];?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -140,25 +141,25 @@
|
||||
<div class="row">
|
||||
<div class="col-12 col-lg-8">
|
||||
<ul class="tabs" id="tabs-menu">
|
||||
<li class="tab-link current" id="tab-link-0" tab="0"><?= ucfirst( \S::lang( 'opis' ) );?></li>
|
||||
<? if ( $this -> product -> language['tab_name_1'] ):?>
|
||||
<li class="tab-link" id="tab-link-1" tab="1"><?= $this -> product -> language['tab_name_1'];?></li>
|
||||
<li class="tab-link current" id="tab-link-0" tab="0"><?= ucfirst( \Shared\Helpers\Helpers::lang( 'opis' ) );?></li>
|
||||
<? if ( $this -> product['language']['tab_name_1'] ):?>
|
||||
<li class="tab-link" id="tab-link-1" tab="1"><?= $this -> product['language']['tab_name_1'];?></li>
|
||||
<? endif;?>
|
||||
<li class="tab-link" id="tab-link-2" tab="2"><?= ucfirst( \S::lang( 'opinie' ) );?></li>
|
||||
<li class="tab-link" id="tab-link-2" tab="2"><?= ucfirst( \Shared\Helpers\Helpers::lang( 'opinie' ) );?></li>
|
||||
<li class="tab-link" id="tab-link-3" tab="3">Bezpieczeństwo</li>
|
||||
</ul>
|
||||
<div id="tab-0" class="tab-content">
|
||||
<div class="tab-title"><?= \S::lang( 'opis-produktu' );?></div>
|
||||
<?= $this -> product -> language['description'];?>
|
||||
<div class="tab-title"><?= \Shared\Helpers\Helpers::lang( 'opis-produktu' );?></div>
|
||||
<?= $this -> product['language']['description'];?>
|
||||
</div>
|
||||
<? if ( $this -> product -> language['tab_description_1'] ):?>
|
||||
<? if ( $this -> product['language']['tab_description_1'] ):?>
|
||||
<div id="tab-1" class="tab-content">
|
||||
<div class="tab-title"><?= $this -> product -> language['tab_name_1'];?></div>
|
||||
<?= $this -> product -> language['tab_description_1'];?>
|
||||
<div class="tab-title"><?= $this -> product['language']['tab_name_1'];?></div>
|
||||
<?= $this -> product['language']['tab_description_1'];?>
|
||||
</div>
|
||||
<? endif;?>
|
||||
<div id="tab-2" class="tab-content reviews">
|
||||
<div class="tab-title"><?= ucfirst( \S::lang( 'opinie' ) );?></div>
|
||||
<div class="tab-title"><?= ucfirst( \Shared\Helpers\Helpers::lang( 'opinie' ) );?></div>
|
||||
<div id="widget-container" class="data-ekomi-emp ekomi-widget-container ekomi-widget-sf14835961656364de9f9" ></div>
|
||||
<div id="ekomi-product-widget-identifier" class="prod-data-emp" style="visibility: hidden"><?= $this -> product['id'];?></div>
|
||||
<a href="https://www.ekomi-pl.com/opinie-marianek.html" target="_blank"><img alt="marianek.pl Reviews with ekomi-pl.com" src="https://smart-widget-assets.ekomiapps.de/resources/ekomi_logo.png" style="display: none;"/></a>
|
||||
@@ -201,28 +202,28 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-12 col-lg-4">
|
||||
<? if ( $this -> product -> language['tab_name_2'] ):?>
|
||||
<? if ( $this -> product['language']['tab_name_2'] ):?>
|
||||
<div class="description-right">
|
||||
<div class="title"><?= $this -> product -> language['tab_name_2'];?></div>
|
||||
<div class="title"><?= $this -> product['language']['tab_name_2'];?></div>
|
||||
<div class="content">
|
||||
<?= $this -> product -> language['tab_description_2'];?>
|
||||
<?= $this -> product['language']['tab_description_2'];?>
|
||||
</div>
|
||||
</div>
|
||||
<? endif;?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<? if ( \S::is_array_fix( $this -> product['products_sets'] ) ):?>
|
||||
<? if ( \Shared\Helpers\Helpers::is_array_fix( $this -> product['products_sets'] ) ):?>
|
||||
<div class="products-sets box">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="box-title"><?= ucfirst( \S::lang( 'dobierz-do-kompletu' ) );?></div>
|
||||
<div class="box-title"><?= ucfirst( \Shared\Helpers\Helpers::lang( 'dobierz-do-kompletu' ) );?></div>
|
||||
<div class="owl-carousel owl-theme">
|
||||
<?
|
||||
foreach ( $this -> product['products_sets'] as $product_sets_id ):
|
||||
$product = \shop\Product::getFromCache( $product_sets_id, $lang_id );
|
||||
if ( $product and $product -> status ):
|
||||
echo \Tpl::view( 'shop-product/product-mini', [
|
||||
$product = (new \Domain\Product\ProductRepository($GLOBALS['mdb']))->findCached( $product_sets_id, $lang_id );
|
||||
if ( $product and $product['status'] ):
|
||||
echo \Shared\Tpl\Tpl::view( 'shop-product/product-mini', [
|
||||
'product' => $product,
|
||||
'class' => 'item'
|
||||
] );
|
||||
@@ -234,7 +235,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<? endif;?>
|
||||
<? if ( \S::is_array_fix( $this -> product['products_related'] ) ):?>
|
||||
<? if ( \Shared\Helpers\Helpers::is_array_fix( $this -> product['products_related'] ) ):?>
|
||||
<div class="products-related box">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
@@ -242,9 +243,9 @@
|
||||
<div class="owl-carousel owl-theme">
|
||||
<?
|
||||
foreach ( $this -> product['products_related'] as $product_related_id ):
|
||||
$product = \shop\Product::getFromCache( $product_related_id, $lang_id );
|
||||
if ( $product and $product -> status ):
|
||||
echo \Tpl::view( 'shop-product/product-mini', [
|
||||
$product = (new \Domain\Product\ProductRepository($GLOBALS['mdb']))->findCached( $product_related_id, $lang_id );
|
||||
if ( $product and $product['status'] ):
|
||||
echo \Shared\Tpl\Tpl::view( 'shop-product/product-mini', [
|
||||
'product' => $product,
|
||||
'class' => 'item'
|
||||
] );
|
||||
@@ -256,14 +257,16 @@
|
||||
</div>
|
||||
</div>
|
||||
<? endif;?>
|
||||
<a href="javascript:history.go(-1)" class="btn btn-success history-back"><?= \S::lang( 'wstecz' );?></a>
|
||||
<a href="javascript:history.go(-1)" class="btn btn-success history-back"><?= \Shared\Helpers\Helpers::lang( 'wstecz' );?></a>
|
||||
</div>
|
||||
<link class="footer" rel="stylesheet" type="text/css" href="/libraries/fancybox3/css/core.css">
|
||||
<link class="footer" rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/swiper@11/swiper-bundle.min.css">
|
||||
<link class="footer" rel="stylesheet" type="text/css" href="/plugins/OwlCarousel/owl.carousel.css">
|
||||
<link class="footer" rel="stylesheet" type="text/css" href="/plugins/OwlCarousel/owl.theme.default.css">
|
||||
<script class="footer" type="text/javascript" src="/libraries/fancybox3/js/core.js"></script>
|
||||
<script class="footer" type="text/javascript" src="/libraries/fancybox3/js/guestures.js"></script>
|
||||
<script class="footer" type="text/javascript" src="/libraries/fancybox3/js/wheel.js"></script>
|
||||
<script class="footer" type="text/javascript" src="https://cdn.jsdelivr.net/npm/swiper@11/swiper-bundle.min.js"></script>
|
||||
<script class="footer" type="text/javascript" src="/plugins/OwlCarousel/owl.carousel.js"></script>
|
||||
<script type="text/javascript">
|
||||
$(function(){
|
||||
@@ -274,9 +277,9 @@
|
||||
ecommerce: {
|
||||
items: [
|
||||
{
|
||||
item_id: "<?= $this -> product -> id;?>",
|
||||
item_name: "<?= str_replace( '"', '', $this -> product -> language['name'] );?>",
|
||||
price: '<? if ( $this -> product -> price_brutto_promo ): echo \S::normalize_decimal( $this -> product -> price_brutto_promo ); else: echo \S::normalize_decimal( $this -> product -> price_brutto ); endif;?>',
|
||||
item_id: "<?= $this -> product['id'];?>",
|
||||
item_name: "<?= str_replace( '"', '', $this -> product['language']['name'] );?>",
|
||||
price: '<? if ( $this -> product['price_brutto_promo'] ): echo \Shared\Helpers\Helpers::normalize_decimal( $this -> product['price_brutto_promo'] ); else: echo \Shared\Helpers\Helpers::normalize_decimal( $this -> product['price_brutto'] ); endif;?>',
|
||||
quantity: 1
|
||||
}
|
||||
]
|
||||
@@ -320,17 +323,17 @@
|
||||
});
|
||||
};
|
||||
|
||||
if ( $( '#product #tab-0' ).visible() )
|
||||
if ( $( '#product #tab-0' ).is( ':visible' ) )
|
||||
$( '#product #tabs-menu #tab-link-0' ).addClass( 'current' );
|
||||
else
|
||||
$( '#product #tabs-menu #tab-link-0' ).removeClass( 'current' );
|
||||
|
||||
if ( $( '#product #tab-1' ).visible() )
|
||||
if ( $( '#product #tab-1' ).is( ':visible' ) )
|
||||
$( '#product #tabs-menu #tab-link-1' ).addClass( 'current' );
|
||||
else
|
||||
$( '#product #tabs-menu #tab-link-1' ).removeClass( 'current' );
|
||||
|
||||
if ( $( '#product #tab-2' ).visible() )
|
||||
if ( $( '#product #tab-2' ).is( ':visible' ) )
|
||||
$( '#product #tabs-menu #tab-link-2' ).addClass( 'current' );
|
||||
else
|
||||
$( '#product #tabs-menu #tab-link-2' ).removeClass( 'current' );
|
||||
@@ -404,7 +407,7 @@
|
||||
quantity = max_value;
|
||||
$.alert(
|
||||
{
|
||||
title: '<?= ucfirst( \S::lang( 'uwaga' ) );?>',
|
||||
title: '<?= ucfirst( \Shared\Helpers\Helpers::lang( 'uwaga' ) );?>',
|
||||
content: 'Maksymalna ilość wybranego produktu wynosi: <b>' + max_value + '<\/b>',
|
||||
type: 'blue',
|
||||
closeIcon: true,
|
||||
@@ -417,7 +420,7 @@
|
||||
icon: 'fas fa-exclamation',
|
||||
buttons: {
|
||||
confirm: {
|
||||
text: '<?= \S::lang( 'zamknij' );?>',
|
||||
text: '<?= \Shared\Helpers\Helpers::lang( 'zamknij' );?>',
|
||||
btnClass: 'btn-blue',
|
||||
keys: ['enter'],
|
||||
action: function () {}
|
||||
@@ -444,7 +447,7 @@
|
||||
quantity = max_value;
|
||||
$.alert(
|
||||
{
|
||||
title: '<?= ucfirst( \S::lang( 'uwaga' ) );?>',
|
||||
title: '<?= ucfirst( \Shared\Helpers\Helpers::lang( 'uwaga' ) );?>',
|
||||
content: 'Maksymalna ilość wybranego produktu wynosi: <b>' + max_value + '<\/b>',
|
||||
type: 'blue',
|
||||
closeIcon: true,
|
||||
@@ -457,7 +460,7 @@
|
||||
icon: 'fas fa-exclamation',
|
||||
buttons: {
|
||||
confirm: {
|
||||
text: '<?= \S::lang( 'zamknij' );?>',
|
||||
text: '<?= \Shared\Helpers\Helpers::lang( 'zamknij' );?>',
|
||||
btnClass: 'btn-blue',
|
||||
keys: ['enter'],
|
||||
action: function () {}
|
||||
@@ -495,8 +498,8 @@
|
||||
{
|
||||
var name = $( element ).attr( 'description' );
|
||||
shopAlert(
|
||||
'<?= ucfirst( \S::lang( 'uwaga' ) );?>',
|
||||
'<?= ucfirst( \S::lang( 'prosze-wybrac' ) );?>: <b>' + name + '</b>',
|
||||
'<?= ucfirst( \Shared\Helpers\Helpers::lang( 'uwaga' ) );?>',
|
||||
'<?= ucfirst( \Shared\Helpers\Helpers::lang( 'prosze-wybrac' ) );?>: <b>' + name + '</b>',
|
||||
[
|
||||
'<a href="#" onclick="shopAlertClose(); return false;" class="btn btn-success">Zamknij</a>',
|
||||
] );
|
||||
@@ -514,8 +517,8 @@
|
||||
{
|
||||
var name = $( element ).attr( 'attribute-name' );
|
||||
shopAlert(
|
||||
'<?= ucfirst( \S::lang( 'uwaga' ) );?>',
|
||||
'<?= ucfirst( \S::lang( 'prosze-wybrac' ) );?>: <b>' + name + '</b>',
|
||||
'<?= ucfirst( \Shared\Helpers\Helpers::lang( 'uwaga' ) );?>',
|
||||
'<?= ucfirst( \Shared\Helpers\Helpers::lang( 'prosze-wybrac' ) );?>: <b>' + name + '</b>',
|
||||
[
|
||||
'<a href="#" onclick="shopAlertClose(); return false;" class="btn btn-success">Zamknij</a>',
|
||||
] );
|
||||
@@ -527,7 +530,7 @@
|
||||
if ( $( '.product-message textarea' ).prop( 'required' ) && $.trim( $( '.product-message textarea' ).val() ) == '' )
|
||||
{
|
||||
shopAlert(
|
||||
'<?= ucfirst( \S::lang( 'uwaga' ) );?>',
|
||||
'<?= ucfirst( \Shared\Helpers\Helpers::lang( 'uwaga' ) );?>',
|
||||
'Proszę uzupełnić pole na dodatkową wiadomość.',
|
||||
[
|
||||
'<a href="#" onclick="shopAlertClose(); return false;" class="btn btn-success">Zamknij</a>',
|
||||
@@ -542,7 +545,7 @@
|
||||
if ( $.trim( $( element ).val() ) == '' )
|
||||
{
|
||||
shopAlert(
|
||||
'<?= ucfirst( \S::lang( 'uwaga' ) );?>',
|
||||
'<?= ucfirst( \Shared\Helpers\Helpers::lang( 'uwaga' ) );?>',
|
||||
'Proszę uzupełnić pole: <b>' + $( element ).attr( 'field_name' ) + '</b>',
|
||||
[
|
||||
'<a href="#" onclick="shopAlertClose(); return false;" class="btn btn-success">Zamknij</a>',
|
||||
@@ -555,8 +558,8 @@
|
||||
if (!check)
|
||||
return false;
|
||||
|
||||
var values = $( '#product-<?= $this -> product -> id;?>' ).serializeArray();
|
||||
var quantity = $('#product-<?= $this -> product -> id;?> #quantity').val();
|
||||
var values = $( '#product-<?= $this -> product['id'];?>' ).serializeArray();
|
||||
var quantity = $('#product-<?= $this -> product['id'];?> #quantity').val();
|
||||
|
||||
jQuery.ajax(
|
||||
{
|
||||
@@ -585,15 +588,15 @@
|
||||
for (var i = 1; i <= quantity; i++)
|
||||
{
|
||||
fbq('track', 'AddToCart', {
|
||||
content_name: '<?= str_replace( '"', '', $this -> product -> language['name'] );?>',
|
||||
content_name: '<?= str_replace( '"', '', $this -> product['language']['name'] );?>',
|
||||
content_category: 'produkt',
|
||||
content_ids: ['<?= $this -> product -> id;?>'],
|
||||
content_ids: ['<?= $this -> product['id'];?>'],
|
||||
content_type: 'product',
|
||||
value: '<?
|
||||
if ( $this -> product -> price_brutto_promo ):
|
||||
echo \S::normalize_decimal( $this -> product -> price_brutto_promo );
|
||||
if ( $this -> product['price_brutto_promo'] ):
|
||||
echo \Shared\Helpers\Helpers::normalize_decimal( $this -> product['price_brutto_promo'] );
|
||||
else:
|
||||
echo \S::normalize_decimal( $this -> product -> price_brutto );
|
||||
echo \Shared\Helpers\Helpers::normalize_decimal( $this -> product['price_brutto'] );
|
||||
endif;
|
||||
?>',
|
||||
currency: 'PLN'
|
||||
@@ -602,7 +605,7 @@
|
||||
<? endif;?>
|
||||
|
||||
<? if ( $this -> settings['google_tag_manager_id'] ):?>
|
||||
var add_to_cart_value = <? if ( $this -> product -> price_brutto_promo ): echo \S::normalize_decimal( $this -> product -> price_brutto_promo ); else: echo \S::normalize_decimal( $this -> product -> price_brutto ); endif;?> * quantity;
|
||||
var add_to_cart_value = <? if ( $this -> product['price_brutto_promo'] ): echo \Shared\Helpers\Helpers::normalize_decimal( $this -> product['price_brutto_promo'] ); else: echo \Shared\Helpers\Helpers::normalize_decimal( $this -> product['price_brutto'] ); endif;?> * quantity;
|
||||
dataLayer.push({ ecommerce: null });
|
||||
dataLayer.push({
|
||||
event: "add_to_cart",
|
||||
@@ -611,9 +614,9 @@
|
||||
value: add_to_cart_value,
|
||||
items: [
|
||||
{
|
||||
item_id: "<?= $this -> product -> id;?>",
|
||||
item_name: "<?= str_replace( '"', '', $this -> product -> language['name'] );?>",
|
||||
price: <? if ( $this -> product -> price_brutto_promo ): echo \S::normalize_decimal( $this -> product -> price_brutto_promo ); else: echo \S::normalize_decimal( $this -> product -> price_brutto ); endif;?>,
|
||||
item_id: "<?= $this -> product['id'];?>",
|
||||
item_name: "<?= str_replace( '"', '', $this -> product['language']['name'] );?>",
|
||||
price: <? if ( $this -> product['price_brutto_promo'] ): echo \Shared\Helpers\Helpers::normalize_decimal( $this -> product['price_brutto_promo'] ); else: echo \Shared\Helpers\Helpers::normalize_decimal( $this -> product['price_brutto'] ); endif;?>,
|
||||
quantity: quantity
|
||||
}
|
||||
]
|
||||
|
||||
@@ -4,8 +4,8 @@
|
||||
<div class="swiper-wrapper">
|
||||
<?
|
||||
foreach ( $this -> products as $product ):
|
||||
if ( $product -> status ):
|
||||
echo \Tpl::view( 'shop-product/product-mini', [
|
||||
if ( $product['status'] ):
|
||||
echo \Shared\Tpl\Tpl::view( 'shop-product/product-mini', [
|
||||
'product' => $product,
|
||||
'class' => 'item',
|
||||
'product_mini_class' => 'swiper-slide'
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
<div class="swiper-wrapper">
|
||||
<?
|
||||
foreach ( $this -> products as $product ):
|
||||
if ( $product -> status ):
|
||||
echo \Tpl::view( 'shop-product/product-mini', [
|
||||
if ( $product['status'] ):
|
||||
echo \Shared\Tpl\Tpl::view( 'shop-product/product-mini', [
|
||||
'product' => $product,
|
||||
'class' => 'item',
|
||||
'product_mini_class' => 'swiper-slide'
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
<div class="swiper-wrapper">
|
||||
<?
|
||||
foreach ( $this -> products as $product ):
|
||||
if ( $product -> status ):
|
||||
echo \Tpl::view( 'shop-product/product-mini', [
|
||||
if ( $product['status'] ):
|
||||
echo \Shared\Tpl\Tpl::view( 'shop-product/product-mini', [
|
||||
'product' => $product,
|
||||
'class' => 'item',
|
||||
'product_mini_class' => 'swiper-slide'
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
<? global $lang_id;?>
|
||||
<div class="box-title"><?= ucfirst( \S::lang( 'polecane-produkty' ) );?></div>
|
||||
<div class="box-title"><?= ucfirst( \Shared\Helpers\Helpers::lang( 'polecane-produkty' ) );?></div>
|
||||
<div class="content">
|
||||
<? if ( is_array( $this -> products ) ): foreach ( $this -> products as $product_id ):?>
|
||||
<?
|
||||
$product = \shop\Product::getFromCache( $product_id, $lang_id );
|
||||
$product = (new \Domain\Product\ProductRepository($GLOBALS['mdb']))->findCached( $product_id, $lang_id );
|
||||
|
||||
$product -> languages[$lang_id]['seo_link'] ? $url = '/' . $product -> languages[$lang_id]['seo_link'] : $url = '/p-' . $product['id'] . '-' . \S::seo( $product -> languages[$lang_id]['name'] );
|
||||
$product['languages'][$lang_id]['seo_link'] ? $url = '/' . $product['languages'][$lang_id]['seo_link'] : $url = '/p-' . $product['id'] . '-' . \Shared\Helpers\Helpers::seo( $product['languages'][$lang_id]['name'] );
|
||||
|
||||
if ( \S::get_session( 'current-lang' ) != \front\factory\Languages::default_language() and $url != '#' )
|
||||
$url = '/' . \S::get_session( 'current-lang' ) . $url;
|
||||
if ( \Shared\Helpers\Helpers::get_session( 'current-lang' ) != ( new \Domain\Languages\LanguagesRepository( $GLOBALS['mdb'] ) )->defaultLanguage() and $url != '#' )
|
||||
$url = '/' . \Shared\Helpers\Helpers::get_session( 'current-lang' ) . $url;
|
||||
?>
|
||||
<?= \Tpl::view( 'shop-product/product-mini', [
|
||||
<?= \Shared\Tpl\Tpl::view( 'shop-product/product-mini', [
|
||||
'product' => $product,
|
||||
'class' => 'col-12 col-sm-4 col-md-4 col-lg-3'
|
||||
] );?>
|
||||
|
||||
@@ -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,39 +30,39 @@
|
||||
<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">
|
||||
<?
|
||||
$prices = $this -> product -> getDefaultCombinationPrices();
|
||||
$prices = ( new \Domain\Product\ProductRepository( $GLOBALS['mdb'] ) )->getDefaultCombinationPrices( $this -> product );
|
||||
if ( $prices )
|
||||
{
|
||||
if ( $prices['price_brutto_promo'] ):?>
|
||||
<div class="price-old">
|
||||
<?= \shop\Shop::shortPrice( $prices['price_brutto'] );?> <span class="small">zł</span>
|
||||
<?= \Shared\Helpers\Helpers::shortPrice( $prices['price_brutto'] );?> <span class="small">zł</span>
|
||||
</div>
|
||||
<div class="price">
|
||||
<?= \shop\Shop::shortPrice( $prices['price_brutto_promo'] );?> <span class="small">zł</span>
|
||||
<?= \Shared\Helpers\Helpers::shortPrice( $prices['price_brutto_promo'] );?> <span class="small">zł</span>
|
||||
</div>
|
||||
<? else:?>
|
||||
<div class="price">
|
||||
<?= \shop\Shop::shortPrice( $prices['price_brutto'] );?> <span class="small">zł</span>
|
||||
<?= \Shared\Helpers\Helpers::shortPrice( $prices['price_brutto'] );?> <span class="small">zł</span>
|
||||
</div>
|
||||
<? endif;
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( $this -> product -> price_brutto_promo ):?>
|
||||
if ( $this -> product['price_brutto_promo'] ):?>
|
||||
<div class="price-old">
|
||||
<?= \shop\Shop::shortPrice( $this -> product -> price_brutto );?> <span class="small">zł</span>
|
||||
<?= \Shared\Helpers\Helpers::shortPrice( $this -> product['price_brutto'] );?> <span class="small">zł</span>
|
||||
</div>
|
||||
<div class="price">
|
||||
<?= \shop\Shop::shortPrice( $this -> product -> price_brutto_promo );?> <span class="small">zł</span>
|
||||
<?= \Shared\Helpers\Helpers::shortPrice( $this -> product['price_brutto_promo'] );?> <span class="small">zł</span>
|
||||
</div>
|
||||
<? else:?>
|
||||
<div class="price">
|
||||
<?= \shop\Shop::shortPrice( $this -> product -> price_brutto );?> <span class="small">zł</span>
|
||||
<?= \Shared\Helpers\Helpers::shortPrice( $this -> product['price_brutto'] );?> <span class="small">zł</span>
|
||||
</div>
|
||||
<? endif;
|
||||
};?>
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
<? 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;?>
|
||||
<div class="search-content">
|
||||
<? if ( is_array( $this -> products ) ): foreach ( $this -> products as $product_id ):
|
||||
echo \Tpl::view( 'shop-product/product-mini', [
|
||||
'product' => \shop\Product::getFromCache( $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>
|
||||
@@ -8,11 +8,11 @@
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="small-title">
|
||||
<?= \S::lang( 'czego-szukasz' );?>?
|
||||
<?= \Shared\Helpers\Helpers::lang( 'czego-szukasz' );?>?
|
||||
<a href="#" class="search-form-big-close"><i class="fa fa-times"></i></a>
|
||||
</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' );?>">
|
||||
</div>
|
||||
<div class="search-big-results"></div>
|
||||
<div class="search-more-button"></div>
|
||||
@@ -68,7 +68,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
|
||||
@@ -87,7 +87,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 );
|
||||
}
|
||||
});
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<ul>
|
||||
<? foreach ( $this -> languages as $lg ):?>
|
||||
<li <? if ( $lang_id == $lg['id'] ) echo 'class="active"';?>>
|
||||
<a href="<?= \front\factory\Pages::lang_url( $page['id'], $lg['id'] );?>" title="Język: <?= $lg['name'];?>">
|
||||
<a href="<?= ( new \Domain\Pages\PagesRepository( $GLOBALS['mdb'] ) )->frontLangUrl( $page['id'], $lg['id'] );?>" title="Język: <?= $lg['name'];?>">
|
||||
<img src="/admin/css/lang-<?= $lg['id'];?>.jpg" alt="Język: <?= $lg['name'];?>">
|
||||
</a>
|
||||
</li>
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
$link = $this -> link;
|
||||
else
|
||||
{
|
||||
$this -> page['language']['seo_link'] ? $link = $this -> page['language']['seo_link'] : $link = 's-' . $this -> page['id'] . '-' . \S::seo( $this -> page['language']['title'] );
|
||||
$this -> page['language']['seo_link'] ? $link = $this -> page['language']['seo_link'] : $link = 's-' . $this -> page['id'] . '-' . \Shared\Helpers\Helpers::seo( $this -> page['language']['title'] );
|
||||
}
|
||||
?>
|
||||
<ul class="pager">
|
||||
|
||||
Reference in New Issue
Block a user