first commit

This commit is contained in:
2024-10-25 23:02:37 +02:00
commit faeb2e52e8
7653 changed files with 1095335 additions and 0 deletions

View File

@@ -0,0 +1,154 @@
<? 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">
<?= \S::lang( 'spis-tresci' );?>
</div>
<?= $this -> article['language']['table_of_contents'];?>
</div>
<? else:?>
<div class="table-of-contents">
<div class="title">
<?= \S::lang( 'spis-tresci' );?>
</div>
<?= \front\factory\Articles::generateTableOfContents( $text );?>
</div>
<? endif;?>
<? endif;?>
<div class="box-articles">
<div class="title">Najpopularniejsze artykuły</div>
[NAJPOULARNIEJSZE_ARTYKULY:9: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">Data publikacji: <b>' . date( 'd.m.Y', strtotime( $this -> article['date_add'] ) ) . '</b></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"><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,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,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,5 @@
<div id="menu-container-<?= $this -> menu['id'];?>" class="menu-container-<?= $this -> menu['id'];?>">
<nav>
<?= \front\view\Menu::pages( $this -> menu['pages'], 0, $this -> current_page );?>
</nav>
</div>

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'];
echo '</a>';
if ( is_array( $page['pages'] ) )
echo '<i class="fa fa-chevron-down menu-toggle" menu-id="link-' . $page['id'] . '"></i>';
echo \front\view\Menu::pages( $page['pages'], $this -> level + 1, $this -> current_page );
echo '</li>';
}
echo '</ul>';
}
?>

View File

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

View File

@@ -0,0 +1,15 @@
<? if ( $this -> custom_fields ): foreach ( $this -> custom_fields as $key => $val ):?>
<? if ( $key ):?>
<div class="custom-field">
<div class="_name">
<?
$custom_field = \shop\ProductCustomField::getFromCache( $key );
echo $custom_field['name'] . ':';
?>
</div>
<div class="_text">
<?= $val;?>
</div>
</div>
<? endif;?>
<? endforeach; endif;?>

View File

@@ -0,0 +1,114 @@
<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 '<div>' . $attribute['language']['name'] . ':</div>';
$value = \front\factory\ShopAttribute::value_details($row[1], $this->lang_id);
echo '<div>' . $value['language']['name'] . '</div>';
}
?>
</div>
<? endforeach; ?>
<hr>
<? 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,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: 'fa fa-times',
typeAnimated: true,
animation: 'opacity',
useBootstrap: false,
theme: 'modern',
autoClose: 'confirm|5000',
icon: 'fa 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,175 @@
<? 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;?>
]
}
});
<? endif;?>
</script>

View File

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

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,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 = 12;
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,213 @@
<? 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@marianek.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>
<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 = '9e2d3181-b56e-4d3d-a532-f96b09dc215f';
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>
<? 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/318/0/<?= substr( $this -> product -> images[0]['src'], 1, strlen( $this -> product -> images[0]['src'] ) );?>" alt="<?= $this -> product -> images[0]['alt'];?>">
<? if ( file_exists( substr( $this -> product -> images[1]['src'], 1 ) ) ):?>
<img class="second" src="/thumb/318/0/<?= substr( $this -> product -> images[1]['src'], 1, strlen( $this -> product -> images[1]['src'] ) );?>" alt="<?= $this -> product -> images[1]['alt'];?>">
<? else:?>
<img class="second" src="/thumb/318/0/<?= substr( $this -> product -> images[0]['src'], 1, strlen( $this -> product -> images[0]['src'] ) );?>" alt="<?= $this -> product -> images[0]['alt'];?>">
<? 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,866 @@
<? 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="product_info_box">
<!-- //* Left top box -->
<div class="product_info__image">
<div class="gallery">
<div thumbsSlider="" class="swiper mySwiper">
<div class="swiper-wrapper">
<? for ( $i = 0; $i < count( $this -> product -> images ); $i++ ): if ( file_exists( substr( $this -> product -> images[$i]['src'], 1 ) ) ):?>
<div class="swiper-slide">
<img class="nolazy" src="/thumb/180/0<?= $this -> product -> images[$i]['src'];?>" src="" alt="<?= $this -> product -> images[$i]['alt'];?>">
</div>
<? endif; endfor;?>
</div>
</div>
</div>
<div id="image-big">
<? if ( $this -> product -> new_to_date and $this -> product -> new_to_date >= date( 'Y-m-d' ) ):?>
<div class="new"><?= \S::lang( 'nowosc' );?></div>
<? endif;?>
<div class="swiper mySwiper2">
<div class="swiper-wrapper">
<? for ( $i = 0; $i < count( $this -> product -> images ); $i++ ): if ( file_exists( substr( $this -> product -> images[$i]['src'], 1 ) ) ):?>
<div class="swiper-slide">
<a href="<?= $this -> product -> images[$i]['src'];?>" class="item" data-fancybox="product" id="image-<?= $i;?>" i="<?= $i;?>">
<img class="nolazy" src="/thumb/520/0<?= $this -> product -> images[$i]['src'];?>" src="" alt="<?= $this -> product -> images[$i]['alt'];?>">
</a>
</div>
<? endif; endfor;?>
</div>
<div class="swiper-button-next"></div>
<div class="swiper-button-prev"></div>
</div>
</div>
</div>
<!-- //* right box -->
<div class="product_info__info">
<div class="product-options" id="product-options">
<?= \Tpl::view( 'shop-product/_partial/product-warehouse-message', [
'product' => $this -> product,
'lang_id' => $this -> lang_id,
'settings' => $this -> settings
] );?>
<h1><?= $this -> product -> language['name'];?></h1>
<div id="66bb9a83-faae-47e5-a954-13929becb059"></div>
<script defer src="https://trustmate.io/widget/api/66bb9a83-faae-47e5-a954-13929becb059/script?product=<?= $this -> product -> id;?>"></script>
<div class="prices">
<? if ( $this -> product -> price_brutto_promo ):?>
<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;?>
<? if ( $this -> product['additional_message'] ):?>
<div class="product-message">
<textarea class="form-control" name="product-message" <? if ( $this -> product['additional_message_required'] ):?>required="required"<? endif;?> placeholder="<?= $this -> product['additional_message_text'] ? $this -> product['additional_message_text'] : 'Miejsce na dodatkową wiadomość';?>"></textarea>
</div>
<? endif;?>
<?= \Tpl::view( 'shop-product/_partial/product-custom-fields', [
'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><p class="free-delivery">Darmowa wysyłka już od <strong>99 zł</strong>
<? 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>
<!-- //* bottom left -->
<? if ($this -> product -> language['description'] or $this -> product -> language['tab_description_1'] or $this -> product -> language['tab_description_2'] ) : ?>
<div id="description" class="product_info__desc">
<div class="description_accordion">
<!-- accordion 1 -->
<? if ($this -> product -> language['description']) : ?>
<div class="accordion_tile accordion_active">
<div class="accordion_title"><p><?= ucfirst( \S::lang( 'opis' ) );?></p></div>
<div class="accordion_data"><?= $this -> product -> language['description'];?></div>
</div>
<? endif; ?>
<? if ( $this -> product -> language['tab_name_1'] ):?>
<!-- accordion 2 -->
<div class="accordion_tile">
<div class="accordion_title"><p><?= $this -> product -> language['tab_name_1'];?></p></div>
<div class="accordion_data"><?= $this -> product -> language['tab_description_1'];?></div>
</div>
<? endif;?>
<? if ( $this -> product -> language['tab_name_2'] ):?>
<!-- accordion 3 -->
<div class="accordion_tile">
<div class="accordion_title"><p><?= $this -> product -> language['tab_name_2'];?></p></div>
<div class="accordion_data"><?= $this -> product -> language['tab_description_2'];?></div>
</div>
<? endif;?>
</div>
</div>
<? endif; ?>
</div>
<div class="product-reviews box">
<div class="container">
<div class="row">
<div class="col-12">
<div class="box-title">Opinie o produkcie</div>
<div id="2bf0c481-66d6-447c-83e5-76b6bf312513"></div>
<script defer src="https://trustmate.io/widget/api/2bf0c481-66d6-447c-83e5-76b6bf312513/script?product=<?= $this -> product -> id;?>"></script>
</div>
</div>
</div>
</div>
<? 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">
<div class="swiper otherProductsSwiper">
<div class="swiper-wrapper">
<?
foreach ( $this -> product['products_sets'] as $product_sets_id ):
$product = new \shop\Product( $product_sets_id );
if ( $product and $product -> status ):
echo \Tpl::view( 'shop-product/product-mini', [
'product' => $product,
'class' => 'item',
'product_mini_class' => 'swiper-slide'
] );
endif;
endforeach;
?>
</div>
</div>
<div class="swiper-button-next otherProductsSwiper-next"></div>
<div class="swiper-button-prev otherProductsSwiper-prev"></div>
</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">Często wybierane z tym produktem</div>
<div class="owl-carousel owl-theme">
<div class="swiper otherColorsSwiper">
<div class="swiper-wrapper">
<?
foreach ( $this -> product['products_related'] as $product_related_id ):
$product = new \shop\Product( $product_related_id );
if ( $product and $product -> status ):
echo \Tpl::view( 'shop-product/product-mini', [
'product' => $product,
'class' => 'item',
'product_mini_class' => 'swiper-slide'
] );
endif;
endforeach;
?>
</div>
</div>
<div class="swiper-button-next otherColorsSwiper-next"></div>
<div class="swiper-button-prev otherColorsSwiper-prev"></div>
</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">
<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="//cdnjs.cloudflare.com/ajax/libs/ScrollMagic/2.0.8/ScrollMagic.min.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"
}
]
}
});
<? 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()
{
$( 'html, body' ).animate({
scrollTop: $( "#tab-" + $( this ).attr( 'tab' ) ).offset().top - 120
}, 333 );
});
// 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( click_event, '.btn-review-form', function(e)
{
e.preventDefault();
$.alert({
title: '<?= ucfirst( \S::lang( 'dodaj-opinie' ) );?>',
content: '<form method="POST">'
+ '<div class="row form-group">'
+ '<div class="col-12 text-left">'
+ '<?= ucfirst( \S::lang( 'ocena' ) );?>: <i class="fa fa-star"><\/i> <i class="fa fa-star"><\/i> <i class="fa fa-star"><\/i> <i class="fa fa-star"><\/i> <i class="fa fa-star"><\/i> <i class="fa fa-star"><\/i>'
+ '<\/div>'
+ '<\/div>'
+ '<div class="row form-group">'
+ '<div class="col-12">'
+ '<input type="text" class="form-control" name="name" placeholder="<?= ucfirst( \S::lang( 'imie' ) );?>">'
+ '<\/div>'
+ '<\/div>'
+ '<div class="row form-group">'
+ '<div class="col-12">'
+ '<textarea name="review" class="form-control" placeholder="<?= ucfirst( \S::lang( 'opinia' ) );?>"><\/textarea>'
+ '<\/div>'
+ '<\/div>'
+ '<\/form>',
type: 'blue',
closeIcon: true,
closeIconClass: 'fas fa-times',
typeAnimated: true,
animation: 'opacity',
useBootstrap: false,
theme: 'modern',
buttons:
{
cancel:
{
text: '<?= \S::lang( 'anuluj' );?>',
btnClass: 'btn-danger',
action: function () {}
}
}
});
});
$('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 );
console.log( data );
$( '#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;
}
/* Fixed box when you scroll */
const postDetails = document.querySelector("#product .product_info_box") //* Blok statyczny.
const postSidebar = document.querySelector("#product .product_info__info") //* Blok jaki powinien być zafiksowany
const headerHeight = document.querySelector("#main-menu") //* Header
const controller = new ScrollMagic.Controller()
const scene = new ScrollMagic.Scene({
triggerElement: postSidebar,
triggerHook: 0,
offset: -headerHeight.offsetHeight - 40,
duration: getDuration,
}).addTo(controller)
if (window.matchMedia("(min-width: 991px)").matches) {
scene.setPin(postSidebar, {
pushFollowers: false
})
}
window.addEventListener("resize", () => {
if (window.matchMedia("(min-width: 991px)").matches) {
scene.setPin(postSidebar, {
pushFollowers: false
})
} else {
scene.removePin(postSidebar, true)
}
})
function getDuration() {
return (
postDetails.offsetHeight - postSidebar.offsetHeight
)
}
//* Accordion
$( function () {
$("#description .description_accordion .accordion_tile .accordion_data");
})
$("#description .description_accordion .accordion_tile .accordion_title").on("click", function () {
let accTitle = $(this).parent()
$("#description .description_accordion .accordion_tile").not(accTitle).removeClass('accordion_active')
$(accTitle).toggleClass("accordion_active")
$(".accordion_data").not($(".accordion_data", accTitle)).slideUp("slow")
$(".accordion_data", accTitle).slideToggle("slow")
})
if ( windowsize <= 767 )
{
var direcion = 'horizontal';
var slidesPerView = 4;
}
else
{
var direcion = 'vertical';
var slidesPerView = 3;
}
console.log(direcion);
//* Galleria
$( function () {
var swiper = new Swiper(".mySwiper", {
loop: false,
spaceBetween: 4,
slidesPerView: slidesPerView,
watchOverflow: true,
watchSlidesVisibility: true,
watchSlidesProgress: true,
direction: direcion
});
var swiper2 = new Swiper(".mySwiper2", {
loop: true,
spaceBetween: 10,
navigation: {
nextEl: ".swiper-button-next",
prevEl: ".swiper-button-prev",
},
thumbs: {
swiper: swiper,
},
});
})
//* grid row
$( function ()
{
if ( $( ".otherProductsSwiper" ).length )
{
var swiper3 = new Swiper(".otherProductsSwiper", {
slidesPerView: 6,
spaceBetween: 30,
centeredSlides: true,
pagination: {
el: ".swiper-pagination",
clickable: true,
},
navigation: {
nextEl: ".otherProductsSwiper-next",
prevEl: ".otherProductsSwiper-prev",
},
breakpoints: {
1400: {
slidesPerView: 6,
},
1200: {
slidesPerView: 5,
},
991: {
slidesPerView: 4,
},
576: {
slidesPerView: 3,
},
300: {
slidesPerView: 2,
},
200: {
slidesPerView: 1,
}
}
}).slideTo(2, 0, false);
}
if($(".otherColorsSwiper").length){
var swiper4 = new Swiper(".otherColorsSwiper", {
slidesPerView: 6,
// initialSlide : 2,
spaceBetween: 30,
centeredSlides: true,
pagination: {
el: ".swiper-pagination",
clickable: true,
},
navigation: {
nextEl: ".otherColorsSwiper-next",
prevEl: ".otherColorsSwiper-prev",
},
breakpoints: {
1400: {
slidesPerView: 6,
},
1200: {
slidesPerView: 5,
},
991: {
slidesPerView: 4,
},
576: {
slidesPerView: 3,
},
300: {
slidesPerView: 2,
},
200: {
slidesPerView: 1,
}
}
}).slideTo(2, 0, false);
}
})
</script>

View File

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