first commit

This commit is contained in:
2024-10-23 12:55:46 +02:00
commit 85c92aa932
8453 changed files with 1186172 additions and 0 deletions

BIN
templates_user/.DS_Store vendored Normal file

Binary file not shown.

View File

@@ -0,0 +1,39 @@
<? global $lang;?>
<div class="col-12 col-sm-6 ">
<div class="article-entry">
<? $this -> article['language']['seo_link'] ? $url = $this -> article['language']['seo_link'] : $url = 'a-' . $this -> article['id'] . '-' . \S::seo( $this -> article['language']['title'] );?>
<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>
</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>
</h3>
<div class="entry">
<?
if ( $this -> article['language']['entry'] )
{
$content = $this -> article['language']['entry'];
$content = preg_replace( "/<img[^>]+\>/i", "", $content );
$content = preg_replace( "/<p[^>]*?>/", "", $content );
$content = preg_replace( "/[\n\r]/", " ", $content );
$content = mb_substr( $content, 0, 350, 'UTF-8' ) . '...';
echo $content;
if ( $this -> article['language']['text'] )
$more = true;
}
else
{
echo $this -> article['language']['text'];
$more = false;
}
?>
</div>
<div class="article-entry__bottom">
<div class="date-add"><i class="fa fa-calendar-o "></i><?= date('d.m.y', strtotime( $this -> article['date_add'])); ?></div>
<div class="author"></div>
</div>
</div>
</div>

View File

@@ -0,0 +1,150 @@
<? global $lang;?>
<?
$text = $this -> article['language']['text'];
$text = \front\factory\Articles::generateHeadersIds( $text );
?>
<div class="article">
<div class="row">
<div class="col-lg-4 col-xl-3">
<div class="article__sideBar">
<? if ( $this -> article['show_table_of_contents'] ):?>
<? if ( $this -> article['language']['table_of_contents'] ):?>
<div class="table-of-contents">
<div class="title">Spis treści</div>
<?= $this -> article['language']['table_of_contents'];?>
</div>
<? else:?>
<div class="table-of-contents">
<div class="title">Spis treści</div>
<?= \front\factory\Articles::generateTableOfContents( $text );?>
</div>
<? endif;?>
<? endif;?>
<div class="box-articles">
<div class="title">Najpopularniejsze artykuły</div>
[NAJPOULARNIEJSZE_ARTYKULY:173:5]
</div>
</div>
</div>
<div class="col-lg-8 col-xl-9">
<div class="article__content">
<?
if ( $main_img = $this -> article['language']['main_image'] ):
?>
<div class="article__main-image">
<img src="<?= $main_img;?>" alt="<?= $this -> article['language']['title'];?>" />
</div>
<?
endif;
?>
<?
$this -> article['language']['seo_link'] ? $url = $this -> article['language']['seo_link'] : $url = 'a-' . $this -> article['id'] . '-' . \S::seo( $this -> article['language']['title'] );
if ( $this -> article['show_title'] )
echo '<h2 class="article-title">' . $this -> article['language']['title'] . '</h2>';
if ( $this -> article['show_date_add'] )
echo '<div class="date-add"><i class="fa fa-calendar-o "></i>' . date( 'd.m.Y', strtotime( $this -> article['date_add'] ) ) . '</div>';
?>
<? if ( $this -> article['repeat_entry'] ):?>
<div class="entry">
<?= $this -> article['language']['entry'];?>
</div>
<? endif;?>
<div class="text">
<?= $text;?>
</div>
<?
if ( is_array( $this -> article['images'] ) ):
?>
<div class="gallery">
<?
foreach ( $this -> article['images'] as $img ):
?>
<a rel="article-<?= $this -> article['id'];?>" href="<?= $img['src'];?>" title="">
<div style="background: url( '/libraries/thumb.php?img=<?= $img['src'];?>&w=250&h=250' ) no-repeat center;"></div>
</a>
<?
endforeach;
?>
</div>
<?
endif;
if ( is_array( $this -> article['files'] ) ):
?>
<ul class="files">
<?
foreach ( $this -> article['files'] as $file ):
?>
<li>
<a href="/download.php?file=<?= $file['id'];?>&hash=<?= md5( $file['src'] );?>" title="<?= $file['name'];?>" target="_blank">
<?
if ( $file['name'] )
echo $file['name'];
else
{
$name = explode( '/', $file['src'] );
echo $name[ count( $name ) - 1 ];
}
?>
</a>
</li>
<?
endforeach;
?>
</ul>
<?
endif;
if ( $this -> article['social_icons'] ):
?>
<div class="social-icons">
<span></span>
<span></span>
<span></span>
<span></span>
<div class="title"><?= ucfirst( \S::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" />
</a>
<a class="pinterest" href="http://pinterest.com/pin/create/button/?url=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="pinterest" target="_blank" rel="nofollow">
<img src="/images/system/logo-pinterest.jpg" alt="pinterest" />
</a>
<a class="twitter" href="http://twitter.com/share?url=http://www.<?= $_SERVER['SERVER_NAME'];?>/<?= $url;?>" onclick="javascript:window.open(this.href, '', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=450,width=600');return false;" title="twitter" target="_blank" rel="nofollow">
<img src="/images/system/logo-twitter.jpg" alt="twitter" />
</a>
<a class="linkedin" href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http://www.<?= $_SERVER['SERVER_NAME'];?>/<?= $url;?>" onclick="javascript:window.open(this.href, '', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=500,width=850');return false;" title="linked in" target="_blank" rel="nofollow">
<img src="/images/system/logo-linkedin.jpg" alt="linkedin" />
</a>
<a class="gp" href="https://plus.google.com/share?url=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="google+" target="_blank" rel="nofollow">
<img src="/images/system/logo-google.jpg" alt="google+" />
</a>
</div>
</div>
<?
endif;
?>
<a href="javascript:history.go(-1);" class="btn btn-success btn-back"><img src="layout/images/left-arrow.svg" alt=""></i><span class="text"><?= $lang['wstecz'];?></span></a>
</div>
</div>
</div>
</div>
<link class="footer" href="/libraries/fancyBox/jquery.fancybox.css" rel="stylesheet" type="text/css">
<link class="footer" href="/libraries/fancyBox/helpers/jquery.fancybox-buttons.css" rel="stylesheet" type="text/css">
<script class="footer" type="text/javascript" src="/libraries/fancyBox/jquery.fancybox.js"></script>
<script class="footer" type="text/javascript" src="/libraries/fancyBox/helpers/jquery.fancybox-buttons.js"></script>
<script class="footer" type="text/javascript">
$( document ).ready(function()
{
$( ".gallery a" ).fancybox({
closeBtn : false,
helpers : {
buttons : {}
}
});
});
</script>

View File

@@ -0,0 +1,89 @@
<? global $lang, $config, $settings; ?>
<? if ($this->page_id == 9) : ?>
<section id="splide-2" class="splide container" aria-label="Splide Basic HTML Example">
<div class="splide__track">
<ul class="splide__list">
<? foreach ($this->articles as $article) : ?>
<li class="splide__slide">
<div class="article-list">
<? $article['language']['seo_link'] ? $url = $article['language']['seo_link'] : $url = 'a-' . $article['id'] . '-' . \S::seo($article['language']['title']); ?>
<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']; ?>">
</div>
<div class="article-list-text-container">
<h3 class="article-title"><?= $article['language']['title']; ?></h3>
<div class="article-entry">
<?
if ($article['language']['entry'])
{
$content = $article['language']['entry'];
$content = preg_replace("/<img[^>]+\>/i", "", $content);
$content = preg_replace("/<p[^>]*?>/", "", $content);
$content = preg_replace("/[\n\r]/", " ", $content);
$content = mb_substr($content, 0, 150, 'UTF-8') . '...';
echo $content;
if ($article['language']['text'])
$more = true;
}
else
{
echo $article['language']['text'];
$more = false;
}
?>
</div>
<div class="date-add"><i class="fa fa-calendar-o "></i><?= date('d.m.y', strtotime($article['date_add'])); ?></div>
<button class="slider-btn">Czytaj więcej</button>
</div>
</a>
</div>
</li>
<? endforeach; ?>
</ul>
</div>
</section>
<?else :?>
<? 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']); ?>
<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']; ?>">
<div class="date-add"><?= date('d.m.y', strtotime($article['date_add'])); ?></div>
</div>
<h3 class="article-title"><?= $article['language']['title']; ?></h3>
<div class="article-entry">
<?
if ($article['language']['entry'])
{
$content = $article['language']['entry'];
$content = preg_replace("/<img[^>]+\>/i", "", $content);
$content = preg_replace("/<p[^>]*?>/", "", $content);
$content = preg_replace("/[\n\r]/", " ", $content);
$content = mb_substr($content, 0, 150, 'UTF-8') . '...';
echo $content;
if ($article['language']['text'])
$more = true;
}
else
{
echo $article['language']['text'];
$more = false;
}
?>
</div>
</a>
</div>
</div>
<? endforeach; ?>
<? endif; ?>

View File

BIN
templates_user/components/.DS_Store vendored Normal file

Binary file not shown.

View File

@@ -0,0 +1,79 @@
<div class="footer box">
<div class="container">
<div class="row">
<!-- <div class="col-12 col-xl-3">
<div class="footer-left">
<img
src="/upload/filemanager/white_270x.png"
alt=""
class="footer-logo"
/>
<div class="footer-description">
<p>
Lorem Ipsum is simply dummy text of the printin and is the
typesetting industry. Lorem Ipsum has been the industry's
standard dummy text ever since th 1500s, when an unknown.
</p>
</div>
<div class="footer-socials">
<div class="favebook social-item">
<p><i class="fa fa-facebook"></i></p>
</div>
<div class="instagram social-item">
<p><i class="fa fa-instagram"></i></p>
</div>
</div>
</div>
</div> -->
<div class="col-md-12 col-lg-3 col-xl-3 mb-5 mb-lg-0">
<div class="box-title">Moje konto</div>
<nav>
<ul>
<li>
<a href="/logowanie" title="Zaloguj się"> Zaloguj się</a>
</li>
<li>
<a href="/rejestracja" title="Załóż konto">Załóż konto</a>
</li>
</ul>
</nav>
</div>
<div class="col-md-12 col-lg-3 col-xl-3 mb-5 mb-lg-0">
<div class="box-title">O firmie</div>
<?= \front\view\Menu::menu( \front\factory\Menu::menu_details( 2 ), $page['id'] ); ?>
</div>
<div class="col-md-12 col-lg-3 col-xl-3 mb-5 mb-lg-0">
<?= \front\view\Scontainers::scontainer( 11 ); ?>
</div>
<div class="col-md-12 col-lg-3 col-xl-3 mb-5 mb-lg-0">
<div class="box-title">Dołącz do nas</div>
<nav class="footer-social-list">
<ul class="contact-list">
<li class="contact-item">
<a href="https://www.facebook.com/sklep.pomyslowe.prezenty" target="_blank">
<i class="fa fa-facebook" aria-hidden="true"></i>
</a>
</li>
<li>
<a href="https://www.instagram.com/sklep.pomyslowe.prezenty" target="_blank">
<i class="fa fa-instagram" aria-hidden="true"></i>
</a>
</li>
</ul>
</nav>
<!-- <?= \front\view\Scontainers::scontainer( 16 ); ?> -->
</div>
</div>
</div>
</div>
<div class="footer-bottom box">
<div class="container">
<div class="row">
<div class="col-12 col-lg-8">
<?= \front\view\Site::copyright(); ?>
</div>
<div class="col-12 col-lg-4"></div>
</div>
</div>
</div>

View File

@@ -0,0 +1,58 @@
<?php
require_once "vendor/Yizack/Config.php";
require_once "vendor/Yizack/InstagramFeed.php";
use Yizack\InstagramFeed;
$instagramToken = 'IGQWRPTU9mbHRVUDdBUWVuNE5UWDE2OElwVlp2QVJpWTdWSXNXUzF6X3l4T2FvMV9yNm9nVUcxZA3JLdk5jRllFNmI3c292S00tRldmQ1IwQkZAmM3FYQkFoaFJ0TkxVWDY3QUExWjQxRGI4eGxqMUY1SVl6VWZAzZAXMZD';
$feed = new InstagramFeed($instagramToken);
$postsData = json_decode(file_get_contents('https://graph.instagram.com/me/media?limit=25&fields=thumbnail_url,permalink,media_url,media_type,caption&access_token=' . $instagramToken));
?>
<?
function post($username, $permalink, $caption, $timestamp) {
$html = '<blockquote class="instagram-media" data-instgrm-permalink="' . $permalink . '" data-instgrm-captioned data-instgrm-version="13">';
$html .= '<a href="' . $permalink . '"></a>';
$html .= '</blockquote>';
$html .= '<script async src="//www.instagram.com/embed.js"></script>';
return $html;
}
?>
<!-- Get only image -->
<ul>
<? foreach($postsData->data as $post): ?>
<?
$postId = $post->id;
$permalink = $post->permalink;
$mediaUrl = $post->media_url;
$mediaType = $post->media_type;
$description = $post->caption;
?>
<li>
<a href="<?= $permalink; ?>">
<img src="<?=$mediaUrl; ?>" style="width: 100%; max-width: 200px;">
</a>
</li>
<? endforeach ?>
</ul>
<!-- Get instagram card (iframe) -->
<ul>
<? foreach($feed->getFeed() as $value) : ?>
<?
$username = $value["username"];
$permalink = $value["permalink"];
$timestamp = $value["timestamp"];
$caption = "";
if(isset($value["caption"])) {
$caption = $value["caption"];
}
?>
<li class="glide__slide">
<div class="instagram-wrapper"><?= post($username, $permalink, $caption, $timestamp); ?></div>
</li>
<? endforeach; ?>
</ul>

View File

@@ -0,0 +1,54 @@
<?php
$instagramToken = 'IGQWROR1p4UFRFS1ZAoQm5BWTZAmYnQ2TXpHVVJoTHdRdVVycEVhRWdzRTJhTHVGa0hmS3VYVjR5MG9URWRETllpbnFOcXBuLU1PQVRYUXdPTjZAMYVFBTEVYQTBuV0twSjI0N2pzZA0JWWVg0SlJuTU5Oa3loTXJNUUkZD';
$postsData = json_decode(file_get_contents('https://graph.instagram.com/me/media?limit=25&fields=thumbnail_url,permalink,media_url,media_type,caption&access_token=' . $instagramToken));
?>
<div class="box-title">Sprawdź nas na Instagramie</div>
<section class="splide" id="instagram-feed-box" aria-label="Splide Basic HTML Example">
<div class="splide__track">
<ul class="splide__list">
<? foreach($postsData->data as $post): ?>
<?
$postId = $post->id;
$permalink = $post->permalink;
$mediaUrl = $post->media_url;
$mediaType = $post->media_type;
$description = $post->caption;
?>
<li class="splide__slide">
<a href="<?= $permalink; ?>">
<img src="<?=$mediaUrl; ?>" style="width: 100%; max-width: fit-content;">
</a>
</li>
<? endforeach ?>
</ul>
</div>
</section>
<script class="footer" type="text/javascript">
let instagramFeedBox = new Splide("#instagram-feed-box", {
type: "loop",
perPage: 6,
perMove: 1,
gap: 20,
pagination: false,
arrows:true,
breakpoints: {
1400: {
perPage: 5,
},
991: {
perPage: 4,
},
600: {
perPage: 3,
},
500: {
perPage: 2,
},
},
});
instagramFeedBox.mount();
</script>

View File

@@ -0,0 +1,45 @@
<script type="text/javascript" src="/libraries/jquery/jquery-2.1.3.min.js"></script>
<script src="/libraries/CookieNoticePro/cookienoticepro.script.js"></script>
<link rel="stylesheet" href="/libraries/CookieNoticePro/cookienoticepro.style.css">
<script type="text/javascript">
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag( 'consent', 'default', {
'ad_storage': 'granted',
'ad_user_data': 'granted',
'ad_personalization': 'granted',
'analytics_storage': 'granted',
'personalization_storage': 'granted',
'security_storage': 'granted',
'functionality_storage': 'granted',
} );
$( document ).ready(function() {
cookieNoticePro.init();
});
var injectScripts = function injectScripts(){
// Example: Google Analytics
if (cookieNoticePro.isPreferenceAccepted("analytics") === true) {
console.log("Analytics Scripts Running....");
}
// Example: Google Adwords cookie, DoubleClick, Remarketing pixels, Social Media cookies
if (cookieNoticePro.isPreferenceAccepted("marketing") === true) {
gtag( 'consent', 'update', {
'ad_storage': 'granted',
'ad_user_data': 'granted',
'ad_personalization': 'granted',
'analytics_storage': 'granted',
'personalization_storage': 'granted',
'security_storage': 'granted',
'functionality_storage': 'granted',
} );
}
// Example: Remember password, language, etc
if (cookieNoticePro.isPreferenceAccepted("preferences") === true) {
console.log("Preferences Scripts Running....");
}
}
</script>

View File

@@ -0,0 +1,7 @@
<script type="text/javascript">
(function(c,l,a,r,i,t,y){
c[a]=c[a]||function(){(c[a].q=c[a].q||[]).push(arguments)};
t=l.createElement(r);t.async=1;t.src="https://www.clarity.ms/tag/"+i;
y=l.getElementsByTagName(r)[0];y.parentNode.insertBefore(t,y);
})(window, document, "clarity", "script", "gcrc384ggz");
</script>

View File

@@ -0,0 +1,45 @@
<div id="mobile-menu-close" class="hidden">
<img src="/layout/images/icon-close.svg">
</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 );?>
</nav>
</div>
<script class="footer" type="text/javascript" src="/libraries/multilevelpushmenu.js"></script>
<script class="footer" type="text/javascript">
$( function()
{
if ( windowsize <= 992 )
{
$( '#menu-container-<?= $this -> menu['id'];?>' ).show();
$( '#menu-container-<?= $this -> menu['id'];?>' ).multilevelpushmenu(
{
direction: 'ltr',
fullCollapse: true,
mode : 'overlap',
collapsed: true,
wrapperClass: 'mmm',
backText: 'Wstecz',
menuHeight: "100%",
menuWidth: "100vw",
preventItemClick: false,
swipe: 'none'
});
$( 'body' ).on( click_event, '#mobile-menu-close', function()
{
$( '#menu-container-<?= $this -> menu['id'];?>' ).multilevelpushmenu( 'collapse' );
$( this ).addClass( 'hidden' );
$( '#mobile-menu-open' ).removeClass( 'hidden' );
});
$( 'body' ).on( click_event, '#mobile-menu-open', function()
{
$( '#menu-container-<?= $this -> menu['id'];?>' ).css( 'visibility', 'visible' ).multilevelpushmenu( 'expand' );
$( this ).addClass( 'hidden' );
$( '#mobile-menu-close' ).removeClass( 'hidden' );
});
}
});
</script>

View File

@@ -0,0 +1,55 @@
<?
if ( is_array( $this -> pages ) ) {
$settings = \front\factory\Settings::settings_details();
echo '<ul class="level-' . $this -> level . ' clear" level="' . $this -> level . '">';
foreach ( $this -> pages as $page ) {
$url = "";
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 = '#';
} else {
$page['language']['seo_link'] ? $url = '/' . $page['language']['seo_link'] : $url = '/s-' . $page['id'] . '-' . \S::seo( $page['language']['title'] );
}
unset( $children );
if ( is_array( $page['pages'] ) ): foreach ( $page['pages'] as $page_tmp ):
$children[] = $page_tmp['id'];
endforeach;
endif;
echo '<li id="link-' . $page['id'] . '" class="';
if ( $page['id'] == $this -> current_page )
echo ' active';
if ( is_array( $page['pages'] ) and in_array( $this -> current_page, $children ) )
echo ' open';
if ( is_array( $page['pages'] ) )
echo ' parent';
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' );
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'] ) )
echo '<i class="fa fa-chevron-down menu-toggle" menu-id="link-' . $page['id'] . '"></i>';
echo '</a>';
echo \front\view\Menu::pages( $page['pages'], $this -> level + 1, $this -> current_page );
echo '</li>';
}
echo '</ul>';
}
?>

View File

@@ -0,0 +1,171 @@
<? global $lang;?>
<div id="newsletter">
<div class="title"><?= ucfirst( $lang['newsletter'] );?></div>
<div id="text"><?= $lang['newsletter-text'];?></div>
<form method="POST" data-toggle="validator" role="form" id="newsletter-form">
<div class="form-group input">
<input type='email' id="email" name="email" class="form-control" required placeholder="<?= ucfirst( $lang['email'] );?>">
<a href="#" class="btn btn-danger" id="newsletter-signin"><span class="text">Zapisz się</span></a>
</div>
<div class="form-group agreement">
<input type="checkbox" id="agreement" /> <span id="first" class="bold"><?= $lang['newsletter-zgoda-1'];?></span> <span id="second" class="hidden"><?= $lang['newsletter-zgoda-2'];?></span><a href="#" id="toggle-data"><?= $lang['rozwin'];?></a>
</div>
</form>
</div>
<script class="footer" type="text/javascript">
$( function()
{
$( 'body' ).on( click_event, '#newsletter-form #toggle-data', function()
{
var second = $( this ).parents( '.form-group' ).children( '#second' );
if ( second.hasClass( 'hidden' ) )
{
second.removeClass( 'hidden' );
$( this ).html( '<?= $lang['zwin'];?>' );
}
else
{
second.addClass( 'hidden' );
$( this ).html( '<?= $lang['rozwin'];?>' );
}
return false;
});
$( 'body' ).on( click_event, '#newsletter-form #newsletter-signin', function(e)
{
e.preventDefault();
if ( !$( '#newsletter-form #agreement' ).is( ':checked' ) )
{
$.alert(
{
title: '<?= ucfirst( $lang['blad'] );?>',
content: '<?= $lang['newsletter-zgoda-komunikat'];?>',
type: 'blue',
closeIcon: true,
closeIconClass: 'fas fa-times',
typeAnimated: true,
animation: 'opacity',
useBootstrap: false,
theme: 'modern',
autoClose: 'confirm|10000',
buttons:
{
confirm:
{
text: '<?= $lang['zamknij'];?>',
btnClass: 'btn-blue',
keys: ['enter'],
action: function() {}
}
}
});
return false;
}
var email = $.trim( $( '#newsletter-form #email' ).val() );
var token = $.trim( $( '#newsletter-form #token' ).val() );
if ( email === '' )
{
$.alert(
{
title: '<?= ucfirst( $lang['blad'] );?>',
content: '<?= $lang['newsletter-prosze-uzupelnic-email'];?>',
type: 'orange',
closeIcon: true,
closeIconClass: 'fas fa-times',
typeAnimated: true,
animation: 'opacity',
useBootstrap: false,
theme: 'modern',
autoClose: 'confirm|10000',
buttons:
{
confirm:
{
text: '<?= $lang['zamknij'];?>',
btnClass: 'btn-blue',
keys: ['enter'],
action: function() {}
}
}
});
return false;
}
$.ajax(
{
type: 'POST',
cache: false,
url: '/newsletter/signin',
data:
{
email: email
},
beforeSend: function()
{
alert1 = $.alert(
{
title: '<?= $lang['informacja'];?>',
content: '<?= $lang['prosze-czekac'];?>',
type: 'orange',
closeIcon: true,
closeIconClass: 'fas fa-times',
typeAnimated: true,
animation: 'opacity',
useBootstrap: false,
theme: 'modern',
buttons:
{
confirm:
{
text: '<?= $lang['zamknij'];?>',
btnClass: 'btn-blue',
keys: ['enter'],
action: function() {}
}
}
});
},
success: function( data )
{
response = jQuery.parseJSON( data );
$( '.jqibox' ).remove();
if ( response.status === 'ok' )
var msg = '<?= $lang['newsletter-potwierdzenie-dodania'];?>';
else
var msg = '<?= $lang['newsletter-potwierdzenie-dodania-blad'];?>';
alert1.close();
$.alert(
{
title: '<?= $lang['informacja'];?>',
content: msg,
type: 'orange',
closeIcon: true,
closeIconClass: 'fas fa-times',
typeAnimated: true,
animation: 'opacity',
useBootstrap: false,
theme: 'modern',
autoClose: 'confirm|10000',
buttons:
{
confirm:
{
text: '<?= $lang['zamknij'];?>',
btnClass: 'btn-blue',
keys: ['enter'],
action: function() {}
}
}
});
}
});
});
});
</script>

View File

@@ -0,0 +1,113 @@
<div class="mini-box">
<h1 class="box-title"><?= ucfirst( \S::lang( 'zawartosc-koszyka' ) ); ?>:</h1>
<div id="basket" class="content">
<? if ( is_array( $this -> basket ) and count($this->basket)) : ?>
<? foreach ($this->basket as $position_hash => $position) : ?>
<?
unset( $price );
unset( $price_new );
$product = new \shop\Product( (int)$position['product-id'], $this -> lang_id );
?>
<div class="basket-product">
<div class="image">
<? if ( file_exists( substr( $product['images'][0]['src'], 1 ) ) ) : ?>
<img class="main-img" src="<?= $product['images'][0]['src']; ?>" alt="">
<? else : ?>
<? endif; ?>
</div>
<div class="details">
<?php
$url = \front\factory\ShopProduct::product_url( $product );
if ( \S::get_session( 'current-lang' ) != \front\factory\Languages::default_language() and $url != '#')
$url = '/' . \S::get_session('current-lang') . $url;
?>
<div class="name">
<a href="<?= $url; ?>"><?= $product['language']['name']; ?></a>
</div>
<? if (is_array($position['attributes']) and count($position['attributes'])) : ?>
<? foreach ($position['attributes'] as $row) : ?>
<div class="description">
<?
if ($row)
{
$row = explode('-', $row);
$attribute = \front\factory\ShopAttribute::attribute_details($row[0], $this->lang_id);
echo '<span>' . $attribute['language']['name'] . ':</span> ';
$value = \front\factory\ShopAttribute::value_details($row[1], $this->lang_id);
echo $value['language']['name'];
}
?>
</div>
<? endforeach; ?>
<? endif; ?>
<?= \Tpl::view( 'shop-basket/_partials/product-custom-fields', [
'custom_fields' => $position['custom_fields']
] ); ?>
<? 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>
<? endif;?>
</div>
<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 );
if ( $price_product['price_new'] )
echo \S::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>';
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']);
?>
</div>
</div>
<div class="buttons">
<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; ?>">
<a href="#" class="btn btn-default btn-plus" product-hash="<?= $position_hash; ?>">
<i class="fa fa-plus"></i>
</a>
<a href="#" class="btn btn-danger btn-delete" product-hash="<?= $position_hash; ?>">
<i class="fa fa-trash"></i>
</a>
</div>
</div>
<? $summary += $price_product['price'] * $position['quantity'];?>
<? endforeach; ?>
<div class="basket-summary">
Wartość koszyka: <span class="price"><?= \S::decimal($summary); ?> zł</span>
</div>
<? if ($discount) : ?>
<div class="basket-summary">
Rabat:
<span class="text-danger">-<?= \S::decimal($discount); ?> zł</span>
</div>
<div class="basket-summary">
Wartość koszyka po rabacie:
<span class="text-danger"><?= \S::decimal($summary - $discount); ?> zł</span>
</div>
<? endif; ?>
<div class="basket-bottom">
<div class="basket-message">
<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')
] );
?>
</div>
</div>
<? else : ?>
<div class="alert alert-danger">Brak produktów w koszyku</div>
<? endif; ?>
</div>
</div>

View File

@@ -0,0 +1,24 @@
<? global $lang;?>
<div id="basket-mini">
<a href="/koszyk" title="Przejdź do koszyka">
<div class="icon">
<img src="/layout/images/basket.svg">
</div>
<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 );?>
<?
switch ( true )
{
case ( $count == 0 ): echo 'produktów'; break;
case ( $count == 1 ): echo 'produkt'; break;
case ( $count == 2 or $count == 3 or $count == 4 ): echo 'produkty'; break;
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ł
</div>
</div>
</a>
</div>

View File

@@ -0,0 +1,430 @@
<div id="basket-container">
<div id="content">
<?= $this -> basket_details;?>
</div>
<? if ( is_array( $this -> basket ) and count( $this -> basket ) ):?>
<div class="basket-options">
<div class="content">
<div class="left">
<div class="box-title"><?= ucfirst( \S::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>
<div id="inpost-map"></div>
</div>
</div>
<div class="right">
<div class="box-title"><?= ucfirst( \S::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>
</div>
</div>
<? endif;?>
</div>
<link class="footer" rel="stylesheet" type="text/css" href="/libraries/grid/plugins/icheck/skins/square/_all.css">
<link class="footer" rel="stylesheet" type="text/css" href="https://geowidget.easypack24.net/css/easypack.css">
<script class="footer" type="text/javascript" src="/libraries/grid/plugins/icheck/icheck.min.js"></script>
<script class="footer" type="text/javascript" src="https://geowidget.easypack24.net/js/sdk-for-javascript.js"></script>
<script class="footer" type="text/javascript">
var inpost_transport_method_id = '';
function inpost_check() {
$.ajax({
type: 'POST',
cache: false,
url: '/shopBasket/inpost_check',
beforeSend: function() {
},
success: function( response ) {
data = jQuery.parseJSON( response );
if ( data.result == 'bad' ) {
$( '.inpost-info-' + inpost_transport_method_id ).html( '<a href="#" onclick="inpost_map( ' + inpost_transport_method_id + ' ); return false;">wybierz</a>' );
}
$( '.inpost-map-container' ).hide();
}
});
return false;
}
function payment_checked( payment_method_id )
{
$.ajax(
{
type: 'POST',
cache: false,
url: '/shopBasket/basket_payment_method_set',
data:
{
payment_method_id: payment_method_id
},
beforeSend: function()
{
$( '#basket-container *' ).addClass( 'disabled' );
$( '#payment-methods .icheck, #transport-methods .icheck' ).iCheck( 'disable' );
},
success: function( response )
{
response = jQuery.parseJSON( response );
$( '#basket-container *' ).removeClass( 'disabled' );
$( '#payment-methods .icheck, #transport-methods .icheck' ).iCheck( 'enable' );
$( '#btn-basket-summary' ).removeClass( 'disabled' );
}
});
return false;
}
function inpost_map( transport_method_id )
{
inpost_transport_method_id = transport_method_id;
window.easyPackAsyncInit = function () {
easyPack.init({
mapType: 'osm',
searchType: 'osm',
});
var map = easyPack.mapWidget( 'inpost-map', function(point)
{
$.ajax(
{
type: 'POST',
cache: false,
url: '/shopBasket/inpost_save',
data: {
paczkomat: point.name + ' | ' + point.address.line1 + ', ' + point.address.line2
},
beforeSend: function() {},
success: function( response ) {
$( '.inpost-info-' + transport_method_id ).html( point.name + ' | ' + point.address.line1 + ', ' + point.address.line2 + '<a href="#" onclick="inpost_map( ' + transport_method_id + ' ); return false;">zmień</a>' );
$( '.inpost-map-container' ).hide();
}
});
});
};
$( '.inpost-map-container' ).show();
}
function transport_checked( transport_method_id, payment_method_id, event_click )
{
$.ajax({
type: 'POST',
cache: false,
url: '/shopBasket/basket_payments_methods',
data:
{
payment_method_id: payment_method_id,
transport_method_id: transport_method_id
},
beforeSend: function()
{
$( '#basket-container *' ).addClass( 'disabled' );
$( '#transport-methods .icheck, #transport-methods .icheck' ).iCheck( 'disable' );
},
success: function( response )
{
response = jQuery.parseJSON( response );
$( '#basket-container *' ).removeClass( 'disabled' );
$( '#transport-methods .icheck, #transport-methods .icheck' ).iCheck( 'enable' );
$( '#payment-methods' ).html( response.payment_methods );
$( '#payment-methods .icheck' ).iCheck({
checkboxClass: 'icheckbox_square-blue',
radioClass: 'iradio_square-blue'
});
if ( payment_method_id )
$( '#btn-basket-summary' ).removeClass( 'disabled' );
$( '#payment-methods .icheck' ).on( 'ifChecked', function( event )
{
var payment_method_id = $( this ).val();
payment_checked( payment_method_id );
});
if ( event_click && ( transport_method_id == '1' || transport_method_id == '2' ) )
inpost_map( transport_method_id )
}
});
return false;
}
$( function()
{
$( 'body' ).on( 'change', '#basket .basket-product-message textarea', function()
{
var _this = $( this);
$.ajax({
type: 'POST',
cache: false,
url: '/shopBasket/product_message_change',
data: {
product_message: _this.val(),
position_code: _this.attr( 'position' )
},
beforeSend: function() {},
success: function() {}
});
});
$( 'body' ).on( click_event, '#btn-basket-summary', function(e) {
e.preventDefault();
$.ajax({
type: 'POST',
cache: false,
url: '/shopBasket/transport_method_inpost_check',
data: {},
beforeSend: function() {
$( '#basket-container *' ).addClass( 'disabled' );
},
success: function( response ) {
data = jQuery.parseJSON( response );
$( '#basket-container *' ).removeClass( 'disabled' );
if ( data.result === 'bad' ) {
$.alert({
title: '<?= ucfirst( \S::lang( 'uwaga' ) );?>',
content: 'Proszę wybrać paczkomat.',
type: 'blue',
closeIcon: true,
closeIconClass: 'fas fa-times',
typeAnimated: true,
animation: 'opacity',
useBootstrap: false,
theme: 'modern',
autoClose: 'confirm|5000',
icon: 'fas fa-exclamation',
buttons: {
confirm: {
text: '<?= \S::lang( 'zamknij' );?>',
btnClass: 'btn-blue',
keys: ['enter'],
action: function () {}
}
}
});
} else {
document.location.href = '/koszyk-podsumowanie';
}
}
});
});
$( 'body' ).on( 'change', '#basket-message', function()
{
var _this = $( this);
$.ajax({
type: 'POST',
cache: false,
url: '/shopBasket/basket_message_save',
data: {
basket_message: _this.val()
},
beforeSend: function() {
$( '#basket-container *' ).addClass( 'disabled' );
},
success: function( response ) {
data = jQuery.parseJSON( response );
$( '#basket-container *' ).removeClass( 'disabled' );
}
});
});
$( 'body' ).on( 'change', '.basket-product .int-format', function()
{
var product_hash = $( this ).attr( 'product-hash' );
var quantity = $( this ).val();
$.ajax(
{
type: 'POST',
cache: false,
url: '/shopBasket/basket_change_quantity_product',
data:
{
product_hash: product_hash,
quantity: quantity
},
beforeSend: function()
{
$( '#basket-container *' ).addClass( 'disabled' );
$( '#payment-methods .icheck, #transport-methods .icheck' ).iCheck( 'disable' );
},
success: function( response )
{
data = jQuery.parseJSON( response );
if ( data.products_count === 0 )
{
document.location.href = '/koszyk';
$( '.mini-box' ).hide();
return false;
}
$( '#basket-container *' ).removeClass( 'disabled' );
$( '#payment-methods .icheck, #transport-methods .icheck' ).iCheck( 'enable' );
$( '#basket-container #content' ).html( data.basket );
$( '#basket-mini #products-count' ).html( data.basket_mini_count );
$( '#basket-mini #basket-value').html( data.basket_mini_value );
$( '#basket-container #transport-methods' ).html( data.transport_methods );
}
});
return false;
});
$( 'body' ).on( click_event, '.basket-product .btn-minus', function() {
var product_hash = $( this ).attr( 'product-hash' );
$.ajax({
type: 'POST',
cache: false,
url: '/shopBasket/basket_decrease_quantity_product',
data: {
product_hash: product_hash
},
beforeSend: function() {
$( '#basket-container *' ).addClass( 'disabled' );
$( '#payment-methods .icheck, #transport-methods .icheck' ).iCheck( 'disable' );
},
success: function( response ) {
data = jQuery.parseJSON( response );
if ( data.products_count === 0 ) {
document.location.href = '/koszyk';
$( '.mini-box' ).hide();
return false;
}
$( '#basket-container *' ).removeClass( 'disabled' );
$( '#payment-methods .icheck, #transport-methods .icheck' ).iCheck( 'enable' );
$( '#basket-container #content' ).html( data.basket );
$( '#basket-mini #products-count' ).html( data.basket_mini_count );
$( '#basket-mini #basket-value').html( data.basket_mini_value );
$( '#basket-container #transport-methods' ).html( data.transport_methods );
}
});
return false;
});
$( 'body' ).on( click_event, '.basket-product .btn-plus', function()
{
var product_hash = $( this ).attr( 'product-hash' );
$.ajax(
{
type: 'POST',
cache: false,
url: '/shopBasket/basket_increase_quantity_product',
data: {
product_hash: product_hash
},
beforeSend: function() {
$( '#basket-container *' ).addClass( 'disabled' );
$( '#payment-methods .icheck, #transport-methods .icheck' ).iCheck( 'disable' );
},
success: function( response ) {
data = jQuery.parseJSON( response );
if ( data.products_count === 0 )
{
document.location.href = '/koszyk';
$( '.mini-box' ).hide();
return false;
}
$( '#basket-container *' ).removeClass( 'disabled' );
$( '#payment-methods .icheck, #transport-methods .icheck' ).iCheck( 'enable' );
$( '#basket-container #content' ).html( data.basket );
$( '#basket-mini #products-count' ).html( data.basket_mini_count );
$( '#basket-mini #basket-value').html( data.basket_mini_value );
$( '#basket-container #transport-methods' ).html( data.transport_methods );
}
});
return false;
});
$( 'body' ).on( click_event, '.basket-product .btn-delete', function()
{
var product_hash = $( this ).attr( 'product-hash' );
$.alert({
title: '<?= ucfirst( \S::lang( 'potwierdz' ) );?>',
content: '<?= \S::lang( 'potwierdz-usuniecie-produktu-z-koszyka' );?>',
closeIcon: true,
closeIconClass: 'fas fa-close',
typeAnimated: true,
animation: 'opacity',
useBootstrap: false,
theme: 'modern',
autoClose: 'cancel|10000',
buttons: {
confirm: {
text: '<?= \S::lang( 'usun' );?>',
btnClass: 'btn-orange',
keys: ['enter'],
action: function() {
$.ajax({
type: 'POST',
cache: false,
url: '/shopBasket/basket_remove_product',
data: {
product_hash: product_hash
},
beforeSend: function() {
$( '#basket-container *' ).addClass( 'disabled' );
$( '#payment-methods .icheck, #transport-methods .icheck' ).iCheck( 'disable' );
},
success: function( response )
{
data = jQuery.parseJSON( response );
if ( data.products_count === 0 )
{
document.location.href = '/koszyk';
$( '.mini-box' ).hide();
return false;
}
$( '#basket-container *' ).removeClass( 'disabled' );
$( '#payment-methods .icheck, #transport-methods .icheck' ).iCheck( 'enable' );
$( '#basket-container #content' ).html( data.basket );
$( '#basket-mini #products-count' ).html( data.basket_mini_count );
$( '#basket-mini #basket-value').html( data.basket_mini_value );
$( '#basket-container #transport-methods' ).html( data.transport_methods );
}
});
}
},
cancel: {
text: '<?= \S::lang( 'zamknij' );?>',
btnClass: 'btn-blue',
action: function() {}
}
}
});
return false;
});
});
</script>

View File

@@ -0,0 +1,181 @@
<? global $client, $lang_id;?>
<div class="basket-summary-container box">
<h1 class="box-title"><?= ucfirst( \S::lang( 'podsumowanie-zamowienia' ) );?>:</h1>
<div id="basket-summary" class="content">
<? if ( is_array( $this -> basket ) and count( $this -> basket ) ):?>
<? foreach ( $this -> basket as $position_hash => $position ):?>
<? $product = new \shop\Product( $position[ 'product-id' ], $this -> lang_id );?>
<div class="basket-product">
<div class="image">
<? if ( file_exists( substr( $product[ 'images' ][ 0 ][ 'src' ], 1 ) ) ):?>
<img class="main-img" src="<?= $product[ 'images' ][ 0 ][ 'src' ];?>" alt="">
<? else:?>
<? endif;?>
</div>
<div class="details">
<?
$product[ 'language' ][ 'seo_link' ] ? $url = '/' . $product[ 'language' ][ 'seo_link' ] : $url = '/p-' . $product[ 'id' ] . '-' . \S::seo( $product[ 'language' ][ 'name' ] );
if ( \S::get_session( 'current-lang' ) != \front\factory\Languages::default_language() and $url != '#' )
$url = '/' . \S::get_session( 'current-lang' ) . $url;
?>
<div class="name">
<a href="<?= $url;?>"><?= $product[ 'language' ][ 'name' ];?></a>
</div>
<? if ( is_array( $position[ 'attributes' ] ) and count( $position[ 'attributes' ] ) ):?>
<? foreach ($position['attributes'] as $row) : ?>
<div class="description">
<?
if ($row)
{
$row = explode('-', $row);
$attribute = \front\factory\ShopAttribute::attribute_details($row[0], $this->lang_id);
echo '<span>' . $attribute['language']['name'] . ':</span> ';
$value = \front\factory\ShopAttribute::value_details($row[1], $this->lang_id);
echo $value['language']['name'];
}
?>
</div>
<? endforeach; ?>
<hr>
<? endif;?>
<?= \Tpl::view( 'shop-basket/_partials/product-custom-fields', [
'custom_fields' => $position['custom_fields']
] ); ?>
<div class="product-message">
<?= $position['message'] != '' ? '<strong>Wiadomość:</strong> ' . $position['message'] : '';?>
</div>
</div>
<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);
if ($price_product['price_new'])
echo \S::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>';
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']);
?>
<span>x <?= $position[ 'quantity' ];?> <?= \S::lang( 'szt' );?>.</span>
<?= \S::decimal( \S::normalize_decimal( $price_product['price_new'] * $position[ 'quantity' ] ) );?> zł
</div>
</div>
</div>
<? $summary += \S::normalize_decimal( $price_product['price'] * $position[ 'quantity' ] );?>
<?
if ( $begin_checkout_items )
$begin_checkout_items .= ',';
$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 .= '"quantity": ' . $position['quantity'];
$begin_checkout_items .= '}';
?>
<? endforeach;?>
<div class="hr"></div>
<div class="basket-summary">
Wartość koszyka:
<span>
<?= \S::decimal( $summary );?> zł
</span>
</div>
<? if ( $discount ):?>
<div class="basket-summary">
Rabat:
<span class="text-danger">-<?= \S::decimal( $discount ); ?> zł</span>
</div>
<? endif;?>
<div class="basket-summary">
<?= $this -> transport[ 'name_visible' ];?>:
<span>
<?= $summary >= $this -> settings[ 'free_delivery' ] ? '0,00' : \S::decimal( $this -> transport[ 'cost' ] );?> zł
</span>
</div>
<div class="basket-summary big">
Razem:
<?
if ( $discount )
$summary -= $discount;
?>
<span id="order-summary"><?= $summary >= $this -> settings[ 'free_delivery' ] ? \S::decimal( $summary ) : \S::decimal( $summary + $this -> transport[ 'cost' ] );?> zł</span>
</div>
<div class="basket-summary">
<?= $this -> payment_method[ 'name' ];?>
</div>
<? if ( $this -> basket_message ):?>
<div class="basket-summary">
Wiadomość:
<span><?= $this -> basket_message;?></span>
</div>
<? endif;?>
<div class="hr"></div>
<? else:?>
<div class="alert alert-danger">Brak produktów w koszyku</div>
<? endif;?>
</div>
<? if ( is_array( $this -> basket ) and count( $this -> basket ) ):?>
<div class="basket-options">
<div class="content">
<? if ( !$this -> client ):?>
<div class="left">
<?=
\front\view\ShopClient::login_form( [
'long' => true
] );
?>
</div>
<div class="right">
<?= \Tpl::view( 'shop-basket/address-form', [
'transport_method' => $this -> transport
] );?>
</div>
<? else:?>
<?= \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>
</div>
<? endif;?>
</div>
<script class="footer" type="text/javascript">
document.getElementById('order-send').addEventListener('click', function() {
var form = document.getElementById('form-order'); // Zastąp 'form-id' rzeczywistym ID Twojego formularza
if (form.checkValidity()) {
this.classList.add('loading-button');
this.disabled = true;
form.submit();
} else {
// Opcjonalnie: wywołaj funkcję reportValidity(), aby wyświetlić komunikaty o błędach formularza
form.reportValidity();
}
});
<? if ( $this -> settings['google_tag_manager_id'] ):?>
dataLayer.push({
event: "begin_checkout",
ecommerce: {
currency: "PLN",
value: <?= \S::normalize_decimal( \front\factory\ShopBasket::summary_price( $this -> basket, $this -> coupon ) );?>,
items: [
<?= $begin_checkout_items;?>
]
}
});
gtag('event', 'conversion', {
'send_to': 'AW-11122553653/O1ImCNnJ9ecYELXm0rcp',
'value': <?= \S::normalize_decimal( \front\factory\ShopBasket::summary_price( $this -> basket, $this -> coupon ) );?>,
'currency': 'PLN'
});
console.log( 'Fired up event GADS purchase conversion marianek.pl' );
<? endif;?>
</script>

View File

@@ -0,0 +1,76 @@
<? global $lang_id; ?>
<? if ($this->query) : ?>
<div class="box-title">
<?= \S::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', [
'category' => $this->category
]);
endif;
?>
<div class="category-content">
<? if (is_array($this->products)) : foreach ($this->products as $product_id) :
$product = new \shop\Product($product_id);
echo \Tpl::view('shop-product/product-mini', [
'product' => new \shop\Product($product_id, $lang_id)
]);
endforeach;
endif; ?>
</div>
<?
if ($this->category_description) :
echo \Tpl::view('shop-category/category-description', [
'category' => $this->category
]);
endif;
?>
<script type="text/javascript" class="footer">
$(document).ready(function() {
let offset = 0;
const limit = 8;
let isLoading = false;
const $categoryContent = $('.category-content');
function loadProducts() {
if (isLoading) {
return;
}
isLoading = true;
$.ajax({
type: 'POST',
cache: false,
url: '/shopProduct/lazy_loading_products',
data: {
offset: offset,
category_id: <?= $this -> category['id'] ?>
},
beforeSend: function() {
},
success: function( response ) {
response = jQuery.parseJSON( response );
if ( response.html.length > 0 ) {
$categoryContent.append( response.html );
offset += limit;
isLoading = false;
} else {
$( document) .off( 'scroll', checkScroll );
}
}
});
}
function checkScroll() {
if( $(window).scrollTop() >= $('.category-content').offset().top + $('.category-content').outerHeight() - window.innerHeight - 250 ) {
loadProducts();
}
}
$( document ).on( 'scroll', checkScroll );
loadProducts();
});
</script>

View File

@@ -0,0 +1,36 @@
<? global $lang_id;?>
<? if ( $this -> query ):?>
<div class="box-title">
<?= \S::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', [
'category' => $this -> category
] );
endif;
?>
<?php
if ( $this -> category['view_subcategories'] ):
echo \Tpl::view( 'shop-category/_partials/category-subcategory-tiles', [
'categories' => \shop\Category::get_subcategory_by_category( $this -> category['id'] ),
] );
endif;
?>
<div class="category-content">
<? if ( is_array( $this -> products ) ): foreach ( $this -> products as $product_id ):
$product = \shop\Product::getFromCache( $product_id, $lang_id );
echo \Tpl::view( 'shop-product/product-mini', [
'product' => $product
] );
endforeach; endif;?>
</div>
<?= $this -> pager;?>
<?
if ( $this -> category_description ):
echo \Tpl::view( 'shop-category/category-description', [
'category' => $this -> category
] );
endif;
?>

View File

@@ -0,0 +1,218 @@
<? global $config; $this -> settings['ssl'] ? $base = 'https' : $base = 'http';?>
<div class="order-summary">
<div class="box-title">
<?= ucfirst( \S::lang( 'szczegoly-zamowienia' ) );?>: <?= $this -> order['number'];?>
</div>
<?= \Tpl::view( 'shop-order/order-simple', [
'order' => $this -> order,
'statuses' => \shop\Order::order_statuses()
] );?>
<? 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>
</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>
<? 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 ) ):?>
<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">
<input required name="NAZWA_USLUGI" value="Zamówienie nr <?= $this -> order['number'];?>" type="hidden">
<input required name="ADRES_WWW" value="<?= $base . "://" . $_SERVER['SERVER_NAME'];?>/zamowienie/<?= $this -> order['hash'];?>" type="hidden">
<input required name="ID_ZAMOWIENIA" value="<?= $this -> order['id'];?>" type="hidden">
<input name="EMAIL" value="<?= $this -> order['client_email'];?>" type="hidden">
<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' );?>
</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>
</div>
</div>
</form>
<? endif;?>
<? if ( $this -> order['payment_method_id'] == 6 and \front\factory\ShopPaymentMethod::is_payment_active( 6 ) ):?>
<?
global $mdb;
$przelewy24_hash = md5( time() );
$mdb -> update( 'pp_shop_orders', [ 'przelewy24_hash' => $przelewy24_hash ], [ 'id' => $this -> order['id'] ] );
?>
<form action="<?= $this -> settings['przelewy24_sandbox'] ? 'https://sandbox.przelewy24.pl/trnDirect' : 'https://secure.przelewy24.pl/trnDirect';?>" method="post" class="form" accept-charset="ISO-8859-2">
<input type="hidden" name="p24_session_id" value="<?= $przelewy24_hash;?>" />
<input type="hidden" name="p24_merchant_id" value="<?= $this -> settings['przelewy24_merchant_id'];?>" />
<input type="hidden" name="p24_pos_id" value="<?= $this -> settings['przelewy24_merchant_id'];?>" />
<input type="hidden" name="p24_amount" value="<?= $this -> order['summary'] * 100;?>" />
<input type="hidden" name="p24_currency" value="PLN" />
<input type="hidden" name="p24_description" value="Zamówienie nr <?= $this -> order['number'];?>" />
<input type="hidden" name="p24_client" value="<?= $this -> order['client_name'] . ' ' . $this -> order['client_surname'];?>" />
<input type="hidden" name="p24_address" value="<?= $this -> order['client_street'];?>" />
<input type="hidden" name="p24_zip" value="<?= $this -> order['client_postal_code'];?>" />
<input type="hidden" name="p24_city" value="<?= $this -> order['client_city'];?>" />
<input type="hidden" name="p24_country" value="PL" />
<input type="hidden" name="p24_email" value="<?= $this -> order['client_email'];?>" />
<input type="hidden" name="p24_language" value="pl" />
<input type="hidden" name="p24_url_return" value="<?= $base . "://" . $_SERVER['SERVER_NAME'];?>/potwierdzenie-platnosci/<?= $this -> order['hash'];?>" />
<input type="hidden" name="p24_url_status" value="<?= $base . "://" . $_SERVER['SERVER_NAME'];?>/przelewy24-status" />
<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_method" value="227">
<input type="hidden" name="p24_sign" value="<?= md5( $przelewy24_hash . '|' . $this -> settings['przelewy24_merchant_id'] . '|' . ( $this -> order['summary'] * 100 ) . '|PLN|' . $this -> settings['przelewy24_crc_key'] );?>" />
<button type="submit" name="submit_send" class="btn btn-success">Zapłać za pomocą PAYPO&nbsp;<b><?= \S::decimal( $this -> order['summary'] );?> zł</b></button>
</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 ) ):?>
<?
global $mdb;
$przelewy24_hash = md5( time() );
$mdb -> update( 'pp_shop_orders', [ 'przelewy24_hash' => $przelewy24_hash ], [ 'id' => $this -> order['id'] ] );
?>
<form action="<?= $this -> settings['przelewy24_sandbox'] ? 'https://sandbox.przelewy24.pl/trnDirect' : 'https://secure.przelewy24.pl/trnDirect';?>" method="post" class="form" accept-charset="ISO-8859-2">
<input type="hidden" name="p24_session_id" value="<?= $przelewy24_hash;?>" />
<input type="hidden" name="p24_merchant_id" value="<?= $this -> settings['przelewy24_merchant_id'];?>" />
<input type="hidden" name="p24_pos_id" value="<?= $this -> settings['przelewy24_merchant_id'];?>" />
<input type="hidden" name="p24_amount" value="<?= $this -> order['summary'] * 100;?>" />
<input type="hidden" name="p24_currency" value="PLN" />
<input type="hidden" name="p24_description" value="Zamówienie nr <?= $this -> order['number'];?>" />
<input type="hidden" name="p24_client" value="<?= $this -> order['client_name'] . ' ' . $this -> order['client_surname'];?>" />
<input type="hidden" name="p24_address" value="<?= $this -> order['client_street'];?>" />
<input type="hidden" name="p24_zip" value="<?= $this -> order['client_postal_code'];?>" />
<input type="hidden" name="p24_city" value="<?= $this -> order['client_city'];?>" />
<input type="hidden" name="p24_country" value="PL" />
<input type="hidden" name="p24_email" value="<?= $this -> order['client_email'];?>" />
<input type="hidden" name="p24_language" value="pl" />
<input type="hidden" name="p24_url_return" value="<?= $base . "://" . $_SERVER['SERVER_NAME'];?>/potwierdzenie-platnosci/<?= $this -> order['hash'];?>" />
<input type="hidden" name="p24_url_status" value="<?= $base . "://" . $_SERVER['SERVER_NAME'];?>/przelewy24-status" />
<input type="hidden" name="p24_api_version" value="3.2" />
<input type="hidden" name="p24_wait_for_result" value="1">
<input type="hidden" name="p24_sign" value="<?= md5( $przelewy24_hash . '|' . $this -> settings['przelewy24_merchant_id'] . '|' . ( $this -> order['summary'] * 100 ) . '|PLN|' . $this -> settings['przelewy24_crc_key'] );?>" />
<button type="submit" name="submit_send" class="btn btn-success"><?= \S::lang( 'zaplac-online' );?>&nbsp;<b><?= \S::decimal( $this -> order['summary'] );?> zł</b></button>
</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 ) ):
$url = 'https://secure.tpay.com';
$this -> settings['tpay_sandbox'] ? $id = '1010' : $id = $this -> settings['tpay_id'];
$this -> settings['tpay_sandbox'] ? $code = 'demo' : $code = $this -> settings['tpay_security_code'];
$this -> settings['tpay_sandbox'] ? $email = 'biuro@project-pro.pl' : $email = 'sklep@pomysloweprezenty.pl';
$url .= '?id=' . $id;
$url .= '&kwota=' . str_replace( ',', '.', round( $this -> order['summary'], 2 ) );
$url .= '&opis=' . urlencode( 'Zamówienie nr ' . $this -> order['number'] );
$url .= '&wyn_email=' . urlencode( $email );
$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 .= '&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>
<? 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 ) ):?>
<? unset( $_SESSION['ekomi-purchase'] );?>
<?= $this -> settings['ekomi_survey'];?>
<? endif;?>
<link class="footer" rel="stylesheet" type="text/css" href="/libraries/grid/plugins/icheck/skins/minimal/minimal.css">
<script class="footer" type="text/javascript" src="/libraries/grid/plugins/icheck/icheck.min.js"></script>
<script class="footer" type="text/javascript">
$( function()
{
jQuery( '#order-payment input[type="checkbox"]' ).iCheck({
checkboxClass: 'icheckbox_minimal-blue',
radioClass: 'iradio_minimal-blue'
});
<? if ( \S::get_session( 'piksel_purchase' ) and $this -> settings[ 'piksel' ] ):?>
<? unset( $_SESSION['piksel_purchase'] );?>
fbq(
'track',
'Purchase', {
currency: 'PLN',
value: <?= str_replace( ',', '.', round( $this -> order['summary'], 2 ) ) - str_replace( ',', '.', round( $this -> order['transport_cost'], 2 ) );?>,
content_type: 'product',
contents: [
<? foreach ( $this -> order['products'] as $product ):?>
{ id: <?= (int)$product['product_id'];?>, quantity: <?= $product['quantity'];?> }<? if ( $product != end( $this -> order['products'] ) ) echo ',';?>
<? endforeach;?>
]
} );
<? endif;?>
<? if ( \S::get_session('google-analytics-purchase') ):?>
<? if ( $this -> settings['google_tag_manager_id'] ):?>
dataLayer.push({
event: "purchase",
ecommerce: {
transaction_id: "<?= $this -> order['id'];?>",
currency: "PLN",
value: <?= \S::normalize_decimal( round( $this -> order['summary'], 2 ) ) - str_replace( ',', '.', round( $this -> order['transport_cost'], 2 ) );?>,
shipping: <?= \S::normalize_decimal( $this -> order['transport_cost'] );?>,
user_email: "<?= $this -> order['client_email'] ?>",
user_phone: "<?= $this -> order['client_phone'] ?>",
user_name: "<?= $this -> order['client_name'] ?>",
user_surname: "<?= $this -> order['client_surname'] ?>",
user_street: "<?= $this -> order['client_street'] ?>",
user_city: "<?= $this -> order['client_city'] ?>",
user_country: "Polska",
user_postal_code: "<?= $this -> order['client_postal_code'] ?>",
items: [
<? foreach ( $this -> order['products'] as $product ):?>
{
id: <?= (int)$product['product_id'];?>,
name: '<?= $product['name'];?>',
quantity: <?= $product['quantity'];?>,
price: <?= $product['price_brutto_promo'];?>,
google_business_vertical: 'retail'
}<? if ( $product != end( $this -> order['products'] ) ) echo ',';?>
<? endforeach;?>
]
}
});
<? endif;?>
<? unset( $_SESSION['google-adwords-purchase'] );?>
<? endif;?>
});
</script>
<? if ( \S::get_session('google-analytics-purchase') ):?>
<script>
TRUST_MATE_USER_NAME = '<?= $this -> order['client_name'];?>';
TRUST_MATE_USER_EMAIL = '<?= $this -> order['client_email'];?>';
TRUST_MATE_ORDER_NUMBER = '<?= $this -> order['id'];?>';
TRUST_MATE_COMPANY_UUID = '34eb36ba-c715-4cdc-8707-22376c9f14c7';
TRUSTMATE_PRODUCTS = [
<? foreach ( $this -> order['products'] as $product ):?>
{
'local_id': <?= (int)$product['product_id'];?>,
'name': '<?= $product['name'];?>',
'product_url': 'https://pomysloweprezenty.pl<?= \front\factory\ShopProduct::product_url( new \shop\Product( $product['product_id'] ) );?>',
"image_url": "https://pomysloweprezenty.pl<?= \front\factory\ShopProduct::product_image( $product['product_id'] );?>"
}<? if ( $product != end( $this -> order['products'] ) ) echo ',';?>
<? endforeach;?>
];
</script>
<script type="text/javascript" src='https://trustmate.io/api/invitation/script'></script>
<script type="text/javascript">var getCookie=function(e){for(var t=e+"=",r=document.cookie.split(";"),n=0;n<r.length;n++){for(var s=r[n];" "==s.charAt(0);)s=s.substring(1);if(0==s.indexOf(t))return s.substring(t.length,s.length)}return""},getUserId=function(){var e=getCookie("twd_u");return""===e?"":e},userId=getUserId(),xhr=new XMLHttpRequest;xhr.open("GET","https://trafficscanner.pl/ws2/index.php/?action=noscript&dt=77&cid=3655&user_id="+userId),xhr.send(); </script><script type="text/javascript" src="https://trafficscanner.pl/ws2/script/setSaleCookie.js"></script>
<? unset( $_SESSION['google-analytics-purchase'] );?>
<? endif;?>

View File

@@ -0,0 +1,12 @@
<? if ( is_array( $this -> custom_fields ) ): foreach ( $this -> custom_fields as $custom_field ):?>
<div class="custom-field">
<div class="_name">
<?= $custom_field['name'];?>:
</div>
<div class="_input">
<div class="grow-wrap">
<textarea name="custom_field[<?= $custom_field['id_additional_field'];?>]" field_name="<?= $custom_field['name'];?>" onInput="this.parentNode.dataset.replicatedValue = this.value"></textarea>
</div>
</div>
</div>
<? endforeach; endif;?>

View File

@@ -0,0 +1,69 @@
<? 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'] );
if ( \S::get_session( 'current-lang' ) != \front\factory\Languages::default_language() and $url != '#' )
$url = '/' . \S::get_session( 'current-lang' ) . $url;
?>
<div class="product-mini <?= $this -> product_mini_class;?>" data-product-id="<?= $this -> product -> id;?>">
<? if ( $this -> product -> new_to_date and $this -> product -> new_to_date >= date( 'Y-m-d' ) ):?>
<div class="new"><?= \S::lang( 'nowosc' );?></div>
<? endif;?>
<a href="<?= $url;?>">
<div class="img">
<? 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'];?>">
<? 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'];?>">
<? 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'];?>">
<? endif;?>
<? endif;?>
<? else:?>
<? endif;?>
</div>
<div class="product-details">
<h2 class="name">
<?= $this -> product -> language['name'];?>
</h2>
<div class="prices">
<?
$prices = $this -> product -> getDefaultCombinationPrices();
if ( $prices )
{
if ( $prices['price_brutto_promo'] ):?>
<div class="price-old">
<?= \shop\Shop::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>
</div>
<? else:?>
<div class="price">
<?= \shop\Shop::shortPrice( $prices['price_brutto'] );?> <span class="small">zł</span>
</div>
<? endif;
}
else
{
if ( $this -> product -> price_brutto_promo ):?>
<div class="price-old">
<?= \shop\Shop::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>
</div>
<? else:?>
<div class="price">
<?= \shop\Shop::shortPrice( $this -> product -> price_brutto );?> <span class="small">zł</span>
</div>
<? endif;
};?>
</div>
</div>
</a>
</div>

View File

@@ -0,0 +1,666 @@
<? global $lang_id;?>
<?
$attributes = \shop\Product::get_product_attributes( $this -> product['product_combinations'] );
?>
<script class="footer" type="text/javascript">
function fradio_label_click( element, refresh )
{
element.parents( '.fradio' ).siblings().children( 'label' ).removeClass( 'active' );
element.parents( '.fradio' ).siblings().children( 'input' ).removeAttr( 'checked' );
element.parents( '.fradio' ).children( 'label' ).addClass( 'active' );
element.parents( '.fradio' ).children( 'input' ).prop( "checked", true );
if ( refresh )
refresh_product_attributes( element.attr( 'for' ), element.attr( 'order' ) );
}
</script>
<div id="product">
<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>
<? endif;?>
<? 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="">
</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'];?>">
</a>
<? endif; endfor;?>
</div>
</div>
<div class="col-12 col-md-6">
<div class="product-options" id="product-options">
<h1><?= $this -> product -> language['name'];?></h1>
<div id="3f362dba-b3a2-4f6e-a950-ce0d10696fba"></div>
<script defer src="https://trustmate.io/widget/api/3f362dba-b3a2-4f6e-a950-ce0d10696fba/script?product=<?= $this -> product -> id;?>"></script>
<div class="prices">
<? if ( $this -> product -> price_brutto_promo ):?>
<? if ( \shop\Shop::shortPrice( $this -> product -> price_brutto_promo )) : ?>
<div class="flag flag-promotion" title="Produkt w promocji">Promocja</div>
<? endif; ?>
<div class="price">
<?= \shop\Shop::shortPrice( $this -> product -> price_brutto_promo );?> <span class="small">zł</span>
</div>
<div class="price-old">
<?= \shop\Shop::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>
</div>
<? if ( $this -> product -> weight && $this -> product -> product_unit_id ):?>
<div class="price_weight">
<?= \shop\Shop::shortPrice( $this -> product -> price_brutto_promo / $this -> product -> wegiht * 1 );?> <?= $this -> product -> product_unit;?>
</div>
<? endif;?>
<? else:?>
<div class="price">
<?= \shop\Shop::shortPrice( $this -> product -> price_brutto );?> <span class="small">zł</span>
</div>
<? if ( $this -> product -> weight && $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 );?>
</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 ) ):?>
<div id="attributes">
<div class="title">Opcje produktu</div>
<? foreach ( $attributes as $key => $val )
echo \Tpl::view( 'shop-product/_partial/product-attribute', [
'attribute' => $val,
'order' => $key,
'level' => ++$level,
'max_level' => count( $attributes )
] );?>
</div>
<? endif;?>
<div class="warehouse-message-box">
<img src="/upload/filemanager/icons/wysylka.svg" alt="">
<?= \Tpl::view( 'shop-product/_partial/product-warehouse-message', [
'product' => $this -> product,
'lang_id' => $this -> lang_id,
'settings' => $this -> settings
] );?>
</div>
<div class="free-delivery-box">
<img src="/upload/filemanager/icons/darmowa-dostawa.svg" alt="">
<p class="free-delivery"><strong>Darmowa dostawa</strong> już od <strong>99 zł</strong></p>
</div>
<? if ( $this -> product['additional_message'] ):?>
<div class="product-message">
<label for="product-message">Podaj dane do personalizacji</label>
<textarea class="form-control" id="product-message" name="product-message" rows="1" <? if ( $this -> product['additional_message_required'] ):?>required="required"<? endif;?> placeholder="<?= $this -> product['additional_message_text'] ? $this -> product['additional_message_text'] : '';?>"></textarea>
</div>
<? endif;?>
<?= \Tpl::view( 'shop-product/_partial/product-custom-fields', [
'custom_fields' => $this -> product['custom_fields']
] );?>
<div class="add-to-basket">
<div class="quantity-container">
<a href="#" class="btn-minus">
<i class="fa fa-minus"></i>
</a>
<input type="text" name="quantity" id="quantity" value="1" class="int-format" min="1" max="<?= ( !$this -> product['quantity'] and $this -> product['stock_0_buy'] ) ? 999 : $this -> product['quantity'];?>">
<a href="#" class="btn-plus">
<i class="fa fa-plus"></i>
</a>
</div>
<button id="add-to-basket" class="btn btn-success"><?= \S::lang( 'do-koszyka' );?></span>
</button>
<div class="alert hidden">Produkt chwilowo niedostępny.</div>
<?
if ( !$this -> product['product_combinations'] and !( $this -> product['quantity'] > 0 or $this -> product['stock_0_buy'] ) ):
?>
<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');
});
</script>
<? endif;?>
</div>
</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>
</div>
<? endif;?>
<div class="short-description">
<?= $this -> product -> language['short_description'];?>
</div>
</div>
</div>
</div>
<? if (($this -> product -> language['tab_name_1']) or $this -> product -> language['description'] or $this -> product -> language['tab_description_1'] or $this -> product -> language['tab_name_2']): ?>
<div id="description">
<div class="row">
<div class="col-12">
<ul class="tabs" id="tabs-menu">
<li class="tab-link" id="tab-link-0" tab="0"><?= ucfirst( \S::lang( 'opis' ) );?></li>
<? if ( $this -> product -> language['tab_name_1'] ):?>
<li class="tab-link" id="tab-link-1" tab="1"><?= $this -> product -> language['tab_name_1'];?></li>
<? endif;?>
<li class="tab-link current" id="tab-link-2" tab="2"><?= ucfirst( \S::lang( 'opinie' ) );?></li>
</ul>
<? if ($this -> product -> language['description']): ?>
<div id="tab-0" class="tab-content hidden">
<?= $this -> product -> language['description'];?>
</div>
<? endif; ?>
<? if ( $this -> product -> language['tab_description_1'] ):?>
<div id="tab-1" class="tab-content hidden">
<div class="tab-title"><?= $this -> product -> language['tab_name_1'];?></div>
<?= $this -> product -> language['tab_description_1'];?>
</div>
<? endif;?>
<div id="tab-2" class="tab-content reviews">
<div id="394f178c-745e-4515-ac11-72e5ba551978"></div>
<script defer src="https://trustmate.io/widget/api/394f178c-745e-4515-ac11-72e5ba551978/script?product=<?= $this -> product -> id;?>"></script>
</div>
</div>
<div class="col-12">
<? if ( $this -> product -> language['tab_name_2'] ):?>
<div class="description-right">
<div class="title"><?= $this -> product -> language['tab_name_2'];?></div>
<div class="content">
<?= $this -> product -> language['tab_description_2'];?>
</div>
</div>
<? endif;?>
</div>
</div>
</div>
<? endif; ?>
<? if ( \S::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="owl-carousel owl-theme">
<?
foreach ( $this -> product['products_sets'] as $product_sets_id ):
$product = new \shop\Product( $product_sets_id );
if ( $product and $product -> status ):
echo \Tpl::view( 'shop-product/product-mini', [
'product' => $product,
'class' => 'item'
] );
endif;
endforeach;
?>
</div>
</div>
</div>
</div>
<? endif;?>
<? if ( \S::is_array_fix( $this -> product['products_related'] ) ):?>
<div class="products-related box">
<div class="row">
<div class="col-12">
<div class="box-title">Inne wzory i kolory</div>
<div class="owl-carousel owl-theme">
<?
foreach ( $this -> product['products_related'] as $product_related_id ):
$product = new \shop\Product( $product_related_id );
if ( $product and $product -> status ):
echo \Tpl::view( 'shop-product/product-mini', [
'product' => $product,
'class' => 'item'
] );
endif;
endforeach;
?>
</div>
</div>
</div>
</div>
<? endif;?>
<a href="javascript:history.go(-1)" class="btn btn-success history-back"><?= \S::lang( 'wstecz' );?></a>
</div>
<link class="footer" rel="stylesheet" type="text/css" href="/libraries/fancybox3/css/core.css">
<link class="footer" rel="stylesheet" type="text/css" href="/plugins/OwlCarousel/owl.carousel.css">
<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="/plugins/OwlCarousel/owl.carousel.js"></script>
<script type="text/javascript">
<? if ( $this -> settings['google_tag_manager_id'] ):?>
dataLayer.push({
event: "view_item",
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;?>',
quantity: 1,
google_business_vertical: "retail"
}
],
value: <? if ( $this -> product -> price_brutto_promo ): echo \S::normalize_decimal( $this -> product -> price_brutto_promo ); else: echo \S::normalize_decimal( $this -> product -> price_brutto ); endif;?>
}
});
<? endif;?>
</script>
<script class="footer" type="text/javascript">
$( function ()
{
var fullUrl = window.location.href;
var hash = fullUrl.split('/')[4];
if ( hash ) {
// Podziel fragment na tablicę za pomocą znaku /
var array = hash.split('/');
// Sprawdź, czy tablica nie jest pusta
if (array.length > 0) {
// Przechodź przez tablicę elementów
array.forEach(function(element, index) {
// Ustaw opóźnienie na podstawie indeksu, aby kliknięcia były w odstępach półsekundowych
setTimeout(function() {
// Znajdź label z atrybutem for odpowiadającym aktualnemu elementowi tablicy i kliknij go
$("label[for='" + element + "']").click();
}, 100 * index); // 500 ms * indeks elementu
});
}
}
if ( $( '#product #tab-0' ).visible() )
$( '#product #tabs-menu #tab-link-0' ).addClass( 'current' );
else
$( '#product #tabs-menu #tab-link-0' ).removeClass( 'current' );
if ( $( '#product #tab-1' ).visible() )
$( '#product #tabs-menu #tab-link-1' ).addClass( 'current' );
else
$( '#product #tabs-menu #tab-link-1' ).removeClass( 'current' );
if ( $( '#product #tab-2' ).visible() )
$( '#product #tabs-menu #tab-link-2' ).addClass( 'current' );
else
$( '#product #tabs-menu #tab-link-2' ).removeClass( 'current' );
$( 'body' ).on( click_event, '.fradio label', function()
{
fradio_label_click( $( this ), true );
});
$( 'body' ).on( click_event, '.tab-link', function()
{
var tab = $( this ).attr( 'tab' );
$( '#product #tabs-menu .tab-link' ).removeClass( 'current' );
$( '#product #tabs-menu #tab-link-' + tab ).addClass( 'current' );
$( '#product .tab-content' ).addClass( 'hidden' );
$( '#product #tab-' + tab ).removeClass( 'hidden' );
});
$('.products-sets .owl-carousel, .products-related .owl-carousel').owlCarousel({
loop: false,
responsiveClass: true,
dots: false,
lazyLoad: true,
responsive: {
0: {
items: 1,
nav: true
},
576: {
items: 2,
nav: true
},
768: {
items: 3,
nav: true
},
1280: {
items: 4,
nav: true
}
}
});
// powiększenie zdjęcia
$('body').on( click_event, '#image-big a', function ()
{
var image_id = $(this).attr('image-id');
$('#image-' + image_id).trigger('click');
});
$('body').on('mouseover', '#gallery a', function()
{
var i = $(this).attr('i');
var src = $(this).attr('href');
if (i != $('#image-big a').attr('image-id'))
{
$('#image-big a').attr('image-id', i);
$('#image-big img').attr('src', src);
}
});
$('body').on('change', '#quantity', function(e)
{
e.preventDefault();
var quantity = parseInt($('#quantity').val());
var max_value = parseInt($('input#quantity').attr('max'));
quantity = quantity + 1;
if (quantity > max_value)
{
quantity = max_value;
$.alert(
{
title: '<?= ucfirst( \S::lang( 'uwaga' ) );?>',
content: 'Maksymalna ilość wybranego produktu wynosi: <b>' + max_value + '<\/b>',
type: 'blue',
closeIcon: true,
closeIconClass: 'fas fa-times',
typeAnimated: true,
animation: 'opacity',
useBootstrap: false,
theme: 'modern',
autoClose: 'confirm|5000',
icon: 'fas fa-exclamation',
buttons: {
confirm: {
text: '<?= \S::lang( 'zamknij' );?>',
btnClass: 'btn-blue',
keys: ['enter'],
action: function () {}
}
}
});
}
$('input#quantity').val(quantity);
return false;
});
$('body').on(click_event, '.btn-plus', function (e)
{
e.preventDefault();
var quantity = parseInt($('#quantity').val());
var max_value = parseInt($('input#quantity').attr('max'));
quantity = quantity + 1;
if (quantity > max_value)
{
quantity = max_value;
$.alert(
{
title: '<?= ucfirst( \S::lang( 'uwaga' ) );?>',
content: 'Maksymalna ilość wybranego produktu wynosi: <b>' + max_value + '<\/b>',
type: 'blue',
closeIcon: true,
closeIconClass: 'fas fa-times',
typeAnimated: true,
animation: 'opacity',
useBootstrap: false,
theme: 'modern',
autoClose: 'confirm|5000',
icon: 'fas fa-exclamation',
buttons: {
confirm: {
text: '<?= \S::lang( 'zamknij' );?>',
btnClass: 'btn-blue',
keys: ['enter'],
action: function () {}
}
}
});
}
$('input#quantity').val(quantity);
return false;
});
$('body').on(click_event, '.btn-minus', function (e)
{
e.preventDefault();
var quantity = parseInt($('input#quantity').val());
var min_value = parseInt($('input#quantity').attr('min'));
quantity = quantity - 1;
if (quantity < min_value)
quantity = min_value;
$('input#quantity').val(quantity);
return false;
});
$('body').on(click_event, '#add-to-basket', function ()
{
var check = true;
$( '#attributes input[type="hidden"], #attributes select' ).each( function( index, element )
{
if ( $( element ).val() == '' )
{
var name = $( element ).attr( 'description' );
shopAlert(
'<?= ucfirst( \S::lang( 'uwaga' ) );?>',
'<?= ucfirst( \S::lang( 'prosze-wybrac' ) );?>: <b>' + name + '</b>',
[
'<a href="#" onclick="shopAlertClose(); return false;" class="btn btn-success">Zamknij</a>',
] );
check = false;
return false;
}
});
$( '#attributes .fradio-group' ).each( function( index, element )
{
var atrribute = $( element ).attr( 'attribute' );
var value = $( element ).find( 'input[type="radio"]:checked' ).val();
if ( typeof value === "undefined" )
{
var name = $( element ).attr( 'attribute-name' );
shopAlert(
'<?= ucfirst( \S::lang( 'uwaga' ) );?>',
'<?= ucfirst( \S::lang( 'prosze-wybrac' ) );?>: <b>' + name + '</b>',
[
'<a href="#" onclick="shopAlertClose(); return false;" class="btn btn-success">Zamknij</a>',
] );
check = false;
return false;
}
});
if ( $( '.product-message textarea' ).prop( 'required' ) && $.trim( $( '.product-message textarea' ).val() ) == '' )
{
shopAlert(
'<?= ucfirst( \S::lang( 'uwaga' ) );?>',
'Proszę uzupełnić pole na dodatkową wiadomość.',
[
'<a href="#" onclick="shopAlertClose(); return false;" class="btn btn-success">Zamknij</a>',
] );
check = false;
return false;
}
// dodatkowe pola muszą być uzupełnione
$( '.custom-field textarea' ).each( function( index, element )
{
if ( $.trim( $( element ).val() ) == '' )
{
shopAlert(
'<?= ucfirst( \S::lang( 'uwaga' ) );?>',
'Proszę uzupełnić pole: <b>' + $( element ).attr( 'field_name' ) + '</b>',
[
'<a href="#" onclick="shopAlertClose(); return false;" class="btn btn-success">Zamknij</a>',
] );
check = false;
return false;
}
});
if (!check)
return false;
var values = $( '#product-<?= $this -> product -> id;?>' ).serializeArray();
var quantity = $('#product-<?= $this -> product -> id;?> #quantity').val();
jQuery.ajax(
{
type: 'POST',
cache: false,
url: '/shopBasket/basket_add_product',
data:
{
values: JSON.stringify(values)
},
beforeSend: function()
{
$('#add-to-basket').addClass('disabled');
},
success: function( response )
{
data = jQuery.parseJSON(response);
$('#add-to-basket').removeClass('disabled');
$('#basket-mini #products-count').html(data.basket_mini_count);
$('#basket-mini #basket-value').html(data.basket_mini_value);
$('#product #quantity').val(1);
if (data.result == 'ok')
{
<? if ( $this -> settings['piksel'] ):?>
for (var i = 1; i <= quantity; i++)
{
fbq('track', 'AddToCart', {
content_name: '<?= str_replace( '"', '', $this -> product -> language['name'] );?>',
content_category: 'produkt',
content_ids: ['<?= $this -> product -> id;?>'],
content_type: 'product',
value: '<? if ( $this -> product -> price_brutto_promo ): echo \S::normalize_decimal( $this -> product -> price_brutto_promo ); else: echo \S::normalize_decimal( $this -> product -> price_brutto ); endif;?>',
currency: 'PLN'
});
}
<? endif;?>
<? if ( $this -> settings['google_tag_manager_id'] ):?>
var add_to_cart_value = <? if ( $this -> product -> price_brutto_promo ): echo \S::normalize_decimal( $this -> product -> price_brutto_promo ); else: echo \S::normalize_decimal( $this -> product -> price_brutto ); endif;?> * quantity;
dataLayer.push({
event: "add_to_cart",
ecommerce: {
currency: "PLN",
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;?>,
quantity: quantity,
google_business_vertical: "retail"
}
]
}
});
<? endif;?>
shopAlert(
'Produkt dodany do koszyka',
data.product_sets,
[
'<a href="#" onclick="shopAlertClose(); return false;" class="btn btn-default">Wróć do zakupów</a>',
'<a href="/koszyk" class="btn btn-success">Przejdź do koszyka</a>'
] );
observer.observe();
}
}
});
return false;
});
});
// odświeżenie listy atrybutów produktu
function refresh_product_attributes( attribute_with_value, attribute_order )
{
// Wybierz wszystkie etykiety z klasą "active" wewnątrz elementu o ID "attributes"
const activeLabels = document.querySelectorAll('#attributes label.active');
// Utwórz tablicę z wartościami atrybutu "for" tych etykiet
const forValues = Array.from(activeLabels).map(label => label.getAttribute('for'));
$.ajax({
type: 'POST',
cache: false,
url: '/shopProduct/draw_product_attributes',
data: {
selected_values: forValues,
product_id: <?= $this -> product['id'];?>
},
beforeSend: function() {
$( '#add-to-basket' ).addClass('disabled');
},
success: function( response ) {
data = jQuery.parseJSON( response );
$( '#add-to-basket' ).removeClass( 'disabled' );
if ( data.product_data )
{
if ( data.product_data.price_brutto_promo )
{
$( '#product-options .prices .price-old' ).html( data.product_data.price_brutto + ' <span class="small">zł</span>' );
$( '#product-options .prices .price' ).html( data.product_data.price_brutto_promo + ' <span class="small">zł</span>' );
}
else
{
$( '#product-options .prices .price' ).html( data.product_data.price_brutto + ' <span class="small">zł</span>' );
}
// jeżeli stan magazynowy jest większy niż 0
if ( data.product_data.quantity > 0 )
{
$( '.warehouse-message' ).html( data.product_data.messages.warehouse_message_nonzero );
$( '#quantity' ).attr( 'max', data.product_data.quantity );
$( '.add-to-basket #add-to-basket, .add-to-basket .quantity-container' ).show();
$( '.add-to-basket .alert' ).addClass( 'hidden' );
}
// jeżeli stan magazynowy jest równy 0
else
{
// jeżeli można kupić produkt ze stanem magazynowym równym 0
if ( data.product_data.stock_0_buy == 1 )
{
$( '.warehouse-message' ).html( data.product_data.messages.warehouse_message_zero );
$( '#quantity' ).attr( 'max', 99 );
$( '.add-to-basket #add-to-basket, .add-to-basket .quantity-container' ).show();
$( '.add-to-basket .alert' ).addClass( 'hidden' );
}
// jeżeli nie można kupić produktu ze stanem magazynowym równym 0
else
{
$( '.warehouse-message' ).html( '' );
$( '#quantity' ).attr( 'max', 0 );
$( '.add-to-basket #add-to-basket, .add-to-basket .quantity-container' ).hide();
$( '.add-to-basket .alert' ).removeClass( 'hidden' );
}
}
}
}
});
return false;
}
</script>

View File

@@ -0,0 +1,14 @@
<? global $lang_id;?>
<? if ( is_array( $this -> products ) ): foreach ( $this -> products as $product ):?>
<?
$product -> languages[$lang_id]['seo_link'] ? $url = '/' . $product -> languages[$lang_id]['seo_link'] : $url = '/p-' . $product['id'] . '-' . \S::seo( $product -> languages[$lang_id]['name'] );
if ( \S::get_session( 'current-lang' ) != \front\factory\Languages::default_language() and $url != '#' )
$url = '/' . \S::get_session( 'current-lang' ) . $url;
?>
<?= \Tpl::view( 'shop-product/product-mini', [
'product' => $product,
'class' => 'col-12 col-sm-4 col-md-4 col-lg-3'
] );?>
<? endforeach; endif;?>

View File

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

View File

@@ -0,0 +1,51 @@
<? 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'] );
if ( \S::get_session( 'current-lang' ) != \front\factory\Languages::default_language() and $url != '#' )
$url = '/' . \S::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>
<? endif;?>
<a href="<?= $url;?>" class="a-img">
<div class="img">
<? 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'];?>">
<? 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'];?>">
<? 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'];?>">
<? endif;?>
<? endif;?>
<? else:?>
<? endif;?>
</div>
</a>
<div class="product-details">
<h2 class="name">
<a href="<?= $url;?>" class="a-name">
<?= $this -> product -> language['name'];?>
</a>
</h2>
<div class="prices">
<? if ( $this -> product -> price_brutto_promo ):?>
<div class="price-old">
<?= \shop\Shop::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>
</div>
<? else:?>
<div class="price">
<?= \shop\Shop::shortPrice( $this -> product -> price_brutto );?> <span class="small">zł</span>
</div>
<? endif;?>
</div>
</div>
</div>

View File

@@ -0,0 +1,103 @@
<div id="search-button">
<button class="btn" type="button">
<img src="/layout/images/search.svg">
</button>
</div>
<div id="search-form-big">
<div class="container">
<div class="row">
<div class="col-12">
<div class="small-title">
<?= \S::lang( 'czego-szukasz' );?>?
</div>
<div class="input">
<input type="text" name="q" class="form-control" placeholder="<?= \S::lang( 'wpisz-szukany-produkt' );?>">
<button type="submit" class="button--search" value=""><img class="search" src="/layout/images/white-search.svg"></button>
<a href="#" class="search-form-big-close"><img src="/layout/images/exit.svg" alt="exit"></a>
</div>
<div class="search-big-results"></div>
<div class="search-more-button"></div>
</div>
</div>
</div>
</div>
<script type="text/javascript" class="footer">
$( function()
{
$( 'body' ).on( click_event, '.search-form-big-close', function()
{
$( '#search-form-big' ).removeClass( 'visible' );
$( '.menu-overlay' ).removeClass( 'visible' );
$( 'body' ).removeClass( 'no-scroll' );
});
$( 'body' ).on( click_event, '#search-button .btn', function()
{
$( '#search-form-big' ).addClass( 'visible' );
$( '#search-form-big input' ).val( "" ).focus();
$( '.menu-overlay' ).addClass( 'visible' );
$( 'body' ).addClass( 'no-scroll' );
});
var timer = '';
$( '#search-form-big input[type="text"]' ).keyup( function()
{
var _this = $( this);
clearTimeout( timer );
timer = setTimeout( function()
{
if ( _this.val().length < 2 )
return false;
$.ajax(
{
type: 'POST',
cache: false,
url: '/search/search_products',
data:
{
query: _this.val()
},
beforeSend: function()
{
},
success: function( response )
{
data = jQuery.parseJSON( response );
$( '.search-big-results' ).html( '' );
var time = 0;
if ( data == null )
{
$( '.search-big-results' ).html( '<div class="no-found"><?= \S::lang( 'nie-znaleziono-produktow' );?><\/div>' );
$( '.search-more-button' ).html('');
}
else
{
$.each( data, function( index, item )
{
setTimeout( function()
{
$( '.search-big-results' ).append( item ).children(':last').hide().fadeIn( 500 );
observer.observe();
}, time );
time += 200;
var is_last_item = (index == (data.length - 1));
if ( is_last_item )
{
setTimeout( function()
{
$( '.search-more-button' ).html( '<a href="/wyszukiwarka/' + _this.val() + '" class="btn btn-success"><?= \S::lang( 'zobacz-wiecej' );?><\/a>' );
}, time );
}
});
}
}
});
}, 1000 );
});
});
</script>

View File

@@ -0,0 +1,4 @@
<div id="copyright">
Copyright © 2019 - <?= date('Y');?> by pomysloweprezenty.pl
Realizacja: Project-Pro <a href="https://www.project-pro.pl">sklepy internetowe</a>
</div>