first commit
This commit is contained in:
BIN
templates/.DS_Store
vendored
Normal file
BIN
templates/.DS_Store
vendored
Normal file
Binary file not shown.
37
templates/articles/article-entry.php
Normal file
37
templates/articles/article-entry.php
Normal file
@@ -0,0 +1,37 @@
|
||||
<? 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="date-add"><?= date( 'd.m.Y', strtotime( $this -> article['date_add'] ) );?></div>
|
||||
<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>
|
||||
<a href="/<?= $url;?>" class="btn btn-success" title="<?= $this -> article['language']['title'];?>" <? if ( $this -> article['language']['noindex'] ):?>rel="nofollow"<? endif;?>><span class="text"><?= $lang['wiecej'];?></span></a>
|
||||
</div>
|
||||
</div>
|
||||
19
templates/articles/article-files.php
Normal file
19
templates/articles/article-files.php
Normal file
@@ -0,0 +1,19 @@
|
||||
<? if ( is_array( $this -> files ) ):?>
|
||||
<ul class="files">
|
||||
<? foreach ( $this -> 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;?>
|
||||
188
templates/articles/article-full.php
Normal file
188
templates/articles/article-full.php
Normal file
@@ -0,0 +1,188 @@
|
||||
<? global $lang;?>
|
||||
<?
|
||||
$text = $this -> article['language']['text'];
|
||||
$text = \front\factory\Articles::generateHeadersIds( $text );
|
||||
?>
|
||||
<div class="article">
|
||||
<?
|
||||
$this -> article['language']['seo_link'] ? $url = $this -> article['language']['seo_link'] : $url = 'a-' . $this -> article['id'] . '-' . \S::seo( $this -> article['language']['title'] );
|
||||
|
||||
if ( $this -> article['show_title'] )
|
||||
echo '<h3 class="article-title">' . $this -> article['language']['title'] . '</h3>';
|
||||
|
||||
if ( $this -> article['social_icons'] ):
|
||||
?>
|
||||
<div class="social-icons">
|
||||
<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&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>
|
||||
<?
|
||||
endif;
|
||||
|
||||
if ( $this -> article['show_date_add'] )
|
||||
echo '<div class="date-add">' . $lang['data-dodania'] . ': ' . $this -> article['date_add'] . '</div>';
|
||||
|
||||
if ( $this -> article['show_date_modify'] )
|
||||
echo '<div class="date-add">' . $lang['data-modyfikacji'] . ': ' . $this -> article['date_modify'] . '</div>';
|
||||
|
||||
?>
|
||||
<div class="entry">
|
||||
<?= $this -> article['language']['entry'];?>
|
||||
</div>
|
||||
<? 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="text">
|
||||
<?
|
||||
/* artykuł wewnątrz innego artykułu */
|
||||
preg_match_all( '/ARTYKUL:[0-9]*/', $this -> article['language']['text'], $articles_list );
|
||||
if ( is_array( $articles_list[0] ) ) foreach( $articles_list[0] as $article_tmp )
|
||||
{
|
||||
$article_tmp = explode( ':', $article_tmp );
|
||||
if ( $article_tmp[1] != $this -> article['id'] )
|
||||
$text = str_replace( '[ARTYKUL:' . $article_tmp[1] . ']', \front\view\Articles::article_full( $article_tmp[1], $lang_id ), $text );
|
||||
else
|
||||
$text = str_replace( '[ARTYKUL:' . $article_tmp[1] . ']', '', $text );
|
||||
}
|
||||
|
||||
/* galeria w innym miejscu niż na końcu */
|
||||
if ( strpos( $this -> article['language']['text'], '[GALERIA]' ) !== false )
|
||||
{
|
||||
if ( is_array( $this -> article['images'] ) ):
|
||||
$tpl = new \Tpl;
|
||||
$tpl -> article = $this -> article;
|
||||
$tpl -> images = $this -> article['images'];
|
||||
$gallery = $tpl -> render( 'articles/article-gallery' );
|
||||
endif;
|
||||
$text = preg_replace('/(<p(.*)>\[GALERIA\]<\/p>|<div(.*)>\[GALERIA\]<\/div>)/', $gallery, $text );
|
||||
}
|
||||
|
||||
/* załączniki w innym miejscu niż na końcu */
|
||||
if ( strpos( $this -> article['language']['text'], '[ZALACZNIKI]' ) !== false )
|
||||
{
|
||||
if ( is_array( $this -> article['files'] ) ):
|
||||
$tpl = new \Tpl;
|
||||
$tpl -> article = $this -> article;
|
||||
$tpl -> files = $this -> article['files'];
|
||||
$files = $tpl -> render( 'articles/article-files' );
|
||||
endif;
|
||||
$text = preg_replace('/(<p(.*)>\[ZALACZNIKI\]<\/p>|<div(.*)>\[ZALACZNIKI\]<\/div>)/', $files, $text );
|
||||
}
|
||||
|
||||
/* slider */
|
||||
if ( strpos( $text, '[SLIDER]' ) !== false )
|
||||
{
|
||||
while ( strpos( $text, '[SLIDER]' ) !== false )
|
||||
{
|
||||
$text_tmp = explode( '[SLIDER]', $text );
|
||||
$before = $text_tmp[0];
|
||||
for ( $i = 1; $i < count( $text_tmp ); $i++ )
|
||||
{
|
||||
$temp = explode( '[/SLIDER]' , $text_tmp[$i] );
|
||||
$code = $temp[0];
|
||||
|
||||
ob_start();
|
||||
|
||||
$images_tmp = explode( '|', $code );
|
||||
if ( is_array( $images_tmp ) and !empty( $images_tmp ) ) foreach ( $images_tmp as $image_tmp )
|
||||
{
|
||||
$image = explode( ';', $image_tmp );
|
||||
$images[] = $image;
|
||||
}
|
||||
|
||||
$tpl = new \Tpl;
|
||||
$tpl -> images = $images;
|
||||
$tpl -> article_id = $this -> article['id'];
|
||||
$tpl -> i = $i;
|
||||
echo $tpl -> render( 'articles/slider' );
|
||||
|
||||
$out .= ob_get_contents();
|
||||
ob_end_clean();
|
||||
|
||||
$out .= $temp[1];
|
||||
}
|
||||
$text = $before . $out;
|
||||
}
|
||||
}
|
||||
|
||||
$dom = new DomDocument('1.0', 'UTF-8');
|
||||
$dom -> loadHTML( '<?xml version="1.0" encoding="UTF-8"?>' . "\n" . $text );
|
||||
$elements = $dom -> getElementsByTagName( 'img' );
|
||||
foreach ( $elements as $element )
|
||||
{
|
||||
if ( strpos( $element -> getAttribute( 'class' ), 'zoom' ) !== false )
|
||||
{
|
||||
$element_tmp = $dom -> createElement( 'a', '' );
|
||||
$element_tmp -> setAttribute( 'href', $element -> getAttribute( 'src' ) );
|
||||
$element_tmp -> setAttribute( 'rel', 'article-' . $this -> article['id'] );
|
||||
$element_tmp -> setAttribute( 'class', 'fancybox' );
|
||||
|
||||
$element_tmp_2 = $element -> cloneNode( false );
|
||||
|
||||
$element_tmp -> appendChild( $element_tmp_2 );
|
||||
|
||||
$element -> parentNode -> replaceChild( $element_tmp, $element );
|
||||
}
|
||||
}
|
||||
|
||||
echo $dom -> saveHTML();
|
||||
?>
|
||||
</div>
|
||||
<?
|
||||
if ( is_array( $this -> article['images'] ) and strpos( $this -> article['language']['text'], '[GALERIA]' ) === false ):
|
||||
$tpl = new \Tpl;
|
||||
$tpl -> article = $this -> article;
|
||||
$tpl -> images = $this -> article['images'];
|
||||
echo $tpl -> render( 'articles/article-gallery' );
|
||||
endif;
|
||||
|
||||
if ( is_array( $this -> article['files'] ) and strpos( $this -> article['language']['text'], '[ZALACZNIKI]' ) === false ):
|
||||
$tpl = new \Tpl;
|
||||
$tpl -> article = $this -> article;
|
||||
$tpl -> files = $this -> article['files'];
|
||||
echo $tpl -> render( 'articles/article-files' );
|
||||
endif;
|
||||
?>
|
||||
</div>
|
||||
<link href="/libraries/fancyBox/jquery.fancybox.css" rel="stylesheet" type="text/css">
|
||||
<link href="/libraries/fancyBox/helpers/jquery.fancybox-buttons.css" rel="stylesheet" type="text/css">
|
||||
<script type="text/javascript" src="/libraries/fancyBox/jquery.fancybox.js"></script>
|
||||
<script type="text/javascript" src="/libraries/fancyBox/helpers/jquery.fancybox-buttons.js"></script>
|
||||
<script type="text/javascript">
|
||||
$( document ).ready(function()
|
||||
{
|
||||
$( ".gallery a.image" ).fancybox({
|
||||
closeBtn : false,
|
||||
helpers : {
|
||||
buttons : {}
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
341
templates/articles/article-gallery.php
Normal file
341
templates/articles/article-gallery.php
Normal file
@@ -0,0 +1,341 @@
|
||||
<? if ( is_array( $this -> images ) ):?>
|
||||
<div class="gallery <? if ( $this -> article['pixieset'] ):?>pixieset<? endif;?>">
|
||||
<? if ( $this -> article['pixieset'] ):?>
|
||||
<div class="buttons">
|
||||
<a id="gallery-download-<?= $this -> article['id'];?>" class="btn btn-success"><?= \S::lang( 'pobierz-wszystkie' );?></a>
|
||||
<? if ( $this -> article['pixieset'] == 2 ):?>
|
||||
<a id="gallery-favorite-submit-<?= $this -> article['id'];?>" class="btn btn-info"><?= \S::lang( 'zatwierdz-wybrane-fotografie' );?></a>
|
||||
<? endif;?>
|
||||
</div>
|
||||
<? endif;?>
|
||||
<div class="row">
|
||||
<? foreach ( $this -> images as $img ):?>
|
||||
<div class="col-xs-12 col-sm-4 col-md-3">
|
||||
<? if ( $this -> article['pixieset'] ):?>
|
||||
<div class="image" download-link="/pixieset/<?= md5( $img['id'] . $img['src'] );?>" image-id="<?= $img['id'];?>" counter="<?= (int)++$i;?>" favorite="<?= !$img['favorite'] ? '0' : '1';?>">
|
||||
<img src="<?= $img['src'];?>" alt="<?= $img['alt'];?>">
|
||||
<div class="image-options">
|
||||
<a href="/pixieset/<?= md5( $img['id'] . $img['src'] );?>" target="_blank" class="download">
|
||||
<i class="fa fa-download"></i>
|
||||
</a>
|
||||
<? if ( $this -> article['pixieset'] == 2 ):?>
|
||||
<a href="#" image-id="<?= $img['id'];?>" class="image-favorite" id="image-favorite-<?= $img['id'];?>"><i class="fa <?= !$img['favorite'] ? 'fa-heart-o' : 'fa-heart';?>"></i></a>
|
||||
<? endif;?>
|
||||
</div>
|
||||
</div>
|
||||
<? else:?>
|
||||
<a class="image" rel="article-<?= $this -> article['id'];?>" href="<?= $img['src'];?>" title="">
|
||||
<img src="<?= $img['src'];?>" alt="<?= $img['alt'];?>">
|
||||
</a>
|
||||
<? endif;?>
|
||||
</div>
|
||||
<? endforeach;?>
|
||||
</div>
|
||||
</div>
|
||||
<? endif;?>
|
||||
<? if ( $this -> article['pixieset'] ):?>
|
||||
<div class="pixieset-image-big">
|
||||
<a href="#" class="close" title="<?= \S::lang( 'zamknij' );?>">
|
||||
<i class="fa fa-times"></i>
|
||||
</a>
|
||||
<div class="buttons">
|
||||
<a href="#" class="download">
|
||||
<i class="fa fa-download"></i>
|
||||
</a>
|
||||
<? if ( $this -> article['pixieset'] == 2 ):?>
|
||||
<a href="#" class="favorite" image-id="">
|
||||
<i class="fa fa-heart-o"></i>
|
||||
</a>
|
||||
<? endif;?>
|
||||
</div>
|
||||
<img src="#">
|
||||
<a href="#" class="next">
|
||||
<i class="fa fa-angle-right"></i>
|
||||
</a>
|
||||
<a href="#" class="prev">
|
||||
<i class="fa fa-angle-left"></i>
|
||||
</a>
|
||||
</div>
|
||||
<? endif;?>
|
||||
<script class="footer" type="text/javascript">
|
||||
var pixieset_image = $( '.pixieset-image-big' );
|
||||
$( function()
|
||||
{
|
||||
<? if ( $this -> article['pixieset'] ):?>
|
||||
$( 'body' ).on( click_event, '.gallery .image img', function()
|
||||
{
|
||||
var image_container = $( this ).parent( '.image' );
|
||||
|
||||
var src = $( this ).attr( 'data-src' );
|
||||
var download_link = image_container.attr( 'download-link' );
|
||||
|
||||
<? if ( $this -> article['pixieset'] == 2 ):?>
|
||||
var image_id = image_container.attr( 'image-id' );
|
||||
var favorite_status = image_container.attr( 'favorite' );
|
||||
<? endif;?>
|
||||
|
||||
pixieset_image.find( 'img' ).attr( 'src', src );
|
||||
pixieset_image.find( '.download' ).attr( 'href', download_link );
|
||||
|
||||
<? if ( $this -> article['pixieset'] == 2 ):?>
|
||||
pixieset_image.find( '.favorite' ).attr( 'image-id', image_id );
|
||||
if ( favorite_status === '1' )
|
||||
pixieset_image.find( '.favorite' ).children( 'i' ).removeClass( 'fa-heart-o' ).addClass( 'fa-heart' );
|
||||
else
|
||||
pixieset_image.find( '.favorite' ).children( 'i' ).removeClass( 'fa-heart' ).addClass( 'fa-heart-o' );
|
||||
<? endif;?>
|
||||
|
||||
pixieset_image.show();
|
||||
|
||||
return false;
|
||||
});
|
||||
|
||||
$( 'body' ).on( click_event, '.pixieset-image-big .close', function()
|
||||
{
|
||||
pixieset_image.hide();
|
||||
return false;
|
||||
});
|
||||
|
||||
$( 'body' ).on( click_event, '.pixieset-image-big .prev', function()
|
||||
{
|
||||
var src = pixieset_image.find( 'img' ).attr( 'src' );
|
||||
var index = $( 'img[data-src="' + src+ '"]' ).parent( '.image' ).attr( 'counter' );
|
||||
index = parseInt( index );
|
||||
|
||||
if ( index <= 1 )
|
||||
var image_index = $( '.image[counter="<?= $i;?>"]' );
|
||||
else
|
||||
var image_index = $( '.image[counter="' + ( index - 1 ) + '"]' );
|
||||
|
||||
var image_current = image_index.children( 'img' );
|
||||
|
||||
var src = image_current.attr( 'data-src' );
|
||||
var download_link = image_index.attr( 'download-link' );
|
||||
|
||||
pixieset_image.find( '.download' ).attr( 'href', download_link );
|
||||
|
||||
<? if ( $this -> article['pixieset'] == 2 ):?>
|
||||
var image_id = image_index.attr( 'image-id' );
|
||||
var favorite_status = image_index.attr( 'favorite' );
|
||||
|
||||
pixieset_image.find( '.favorite' ).attr( 'image-id', image_id );
|
||||
|
||||
if ( favorite_status === '1' )
|
||||
pixieset_image.find( '.favorite' ).children( 'i' ).removeClass( 'fa-heart-o' ).addClass( 'fa-heart' );
|
||||
else
|
||||
pixieset_image.find( '.favorite' ).children( 'i' ).removeClass( 'fa-heart' ).addClass( 'fa-heart-o' );
|
||||
<? endif;?>
|
||||
|
||||
var image = $( ".pixieset-image-big img" );
|
||||
image.hide();
|
||||
image.attr( 'src', src );
|
||||
image.show();
|
||||
|
||||
return false;
|
||||
});
|
||||
|
||||
$( 'body' ).on( click_event, '.pixieset-image-big .next', function()
|
||||
{
|
||||
var src = pixieset_image.find( 'img' ).attr( 'src' );
|
||||
var index = $( 'img[data-src="' + src+ '"]' ).parent( '.image' ).attr( 'counter' );
|
||||
index = parseInt( index );
|
||||
|
||||
if ( index >= <?= $i;?> )
|
||||
var image_index = $( '.image[counter="1"]' );
|
||||
else
|
||||
var image_index = $( '.image[counter="' + ( index + 1 ) + '"]' );
|
||||
|
||||
var image_current = image_index.children( 'img' );
|
||||
|
||||
var src = image_current.attr( 'data-src' );
|
||||
var download_link = image_index.attr( 'download-link' );
|
||||
|
||||
pixieset_image.find( '.download' ).attr( 'href', download_link );
|
||||
|
||||
<? if ( $this -> article['pixieset'] == 2 ):?>
|
||||
var image_id = image_index.attr( 'image-id' );
|
||||
var favorite_status = image_index.attr( 'favorite' );
|
||||
|
||||
pixieset_image.find( '.favorite' ).attr( 'image-id', image_id );
|
||||
|
||||
if ( favorite_status === '1' )
|
||||
pixieset_image.find( '.favorite' ).children( 'i' ).removeClass( 'fa-heart-o' ).addClass( 'fa-heart' );
|
||||
else
|
||||
pixieset_image.find( '.favorite' ).children( 'i' ).removeClass( 'fa-heart' ).addClass( 'fa-heart-o' );
|
||||
<? endif;?>
|
||||
|
||||
var image = $( ".pixieset-image-big img" );
|
||||
image.hide();
|
||||
image.attr( 'src', src );
|
||||
image.show();
|
||||
|
||||
return false;
|
||||
});
|
||||
|
||||
$( 'body' ).on( click_event, '#gallery-download-<?= $this -> article['id'];?>', function()
|
||||
{
|
||||
var button = $( this );
|
||||
$.ajax(
|
||||
{
|
||||
type: 'POST',
|
||||
cache: false,
|
||||
url: '/ajax.php',
|
||||
data:
|
||||
{
|
||||
a: 'pixieset_gallery_download',
|
||||
hash: '<?= md5( $this -> article['id'] . $this -> article['date_add'] );?>'
|
||||
},
|
||||
beforeSend: function()
|
||||
{
|
||||
button.addClass( 'disabled' ).html( '<?= \S::lang( 'zaczekaj-trwa-tworzenie-pliku' );?>' );
|
||||
},
|
||||
success: function( response )
|
||||
{
|
||||
data = jQuery.parseJSON( response );
|
||||
window.location = '/' + data.url;
|
||||
button.removeClass( 'disabled' ).html( '<?= \S::lang( 'pobierz-wszystkie' );?>' );
|
||||
}
|
||||
});
|
||||
});
|
||||
<? endif;?>
|
||||
|
||||
<? if ( $this -> article['pixieset'] == 2 ):?>
|
||||
$( 'body' ).on( click_event, '#gallery-favorite-submit-<?= $this -> article['id'];?>', function()
|
||||
{
|
||||
var button = $( this );
|
||||
|
||||
$.ajax(
|
||||
{
|
||||
type: 'POST',
|
||||
cache: false,
|
||||
url: '/ajax.php',
|
||||
data:
|
||||
{
|
||||
a: 'pixieset_save_favorite_images',
|
||||
hash: '<?= md5( $this -> article['id'] . $this -> article['date_add'] );?>'
|
||||
},
|
||||
beforeSend: function()
|
||||
{
|
||||
button.addClass( 'disabled' );
|
||||
},
|
||||
success: function( response )
|
||||
{
|
||||
data = jQuery.parseJSON( response );
|
||||
|
||||
if ( data.status === true )
|
||||
{
|
||||
$.alert(
|
||||
{
|
||||
title: '<?= ucfirst( \S::lang( 'informacja' ) );?>',
|
||||
content: '<?= \S::lang( 'lista-wybranych-zdjec-zostala-zatwierdzona' );?>',
|
||||
type: 'orange',
|
||||
closeIcon: true,
|
||||
closeIconClass: 'fa fa-close',
|
||||
typeAnimated: true,
|
||||
animation: 'opacity',
|
||||
autoClose: 'confirm|10000',
|
||||
useBootstrap: false,
|
||||
theme: 'modern',
|
||||
buttons:
|
||||
{
|
||||
confirm:
|
||||
{
|
||||
text: '<?= \S::lang( 'zamknij' );?>',
|
||||
btnClass: 'btn-blue',
|
||||
keys: ['enter'],
|
||||
action: function() {}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
button.removeClass( 'disabled' );
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$( 'body' ).on( click_event, '.image-favorite', function()
|
||||
{
|
||||
var button = $( this );
|
||||
|
||||
$.ajax(
|
||||
{
|
||||
type: 'POST',
|
||||
cache: false,
|
||||
url: '/ajax.php',
|
||||
data:
|
||||
{
|
||||
a: 'pixieset_image_favorite',
|
||||
hash: '<?= md5( $this -> article['id'] . $this -> article['date_add'] );?>',
|
||||
image_id: button.attr( 'image-id' )
|
||||
},
|
||||
beforeSend: function()
|
||||
{
|
||||
button.addClass( 'disabled' );
|
||||
},
|
||||
success: function( response )
|
||||
{
|
||||
data = jQuery.parseJSON( response );
|
||||
|
||||
if ( data.status === false )
|
||||
{
|
||||
button.children( 'i' ).removeClass( 'fa-heart' ).addClass( 'fa-heart-o' );
|
||||
button.parents( '.image' ).attr( 'favorite', '0' );
|
||||
}
|
||||
else
|
||||
{
|
||||
button.children( 'i' ).removeClass( 'fa-heart-o' ).addClass( 'fa-heart' );
|
||||
button.parents( '.image' ).attr( 'favorite', '1' );
|
||||
}
|
||||
|
||||
button.removeClass( 'disabled' );
|
||||
}
|
||||
});
|
||||
return false;
|
||||
});
|
||||
|
||||
$( 'body' ).on( click_event, '.pixieset-image-big .favorite', function()
|
||||
{
|
||||
var button = $( this );
|
||||
var image_id = button.attr( 'image-id' );
|
||||
|
||||
$.ajax(
|
||||
{
|
||||
type: 'POST',
|
||||
cache: false,
|
||||
url: '/ajax.php',
|
||||
data:
|
||||
{
|
||||
a: 'pixieset_image_favorite',
|
||||
hash: '<?= md5( $this -> article['id'] . $this -> article['date_add'] );?>',
|
||||
image_id: image_id
|
||||
},
|
||||
beforeSend: function()
|
||||
{
|
||||
button.addClass( 'disabled' );
|
||||
},
|
||||
success: function( response )
|
||||
{
|
||||
data = jQuery.parseJSON( response );
|
||||
|
||||
if ( data.status === false )
|
||||
{
|
||||
button.children( 'i' ).removeClass( 'fa-heart' ).addClass( 'fa-heart-o' );
|
||||
$( '.image[image-id="' + image_id + '"]' ).attr( 'favorite', 0 );
|
||||
$( '.image[image-id="' + image_id + '"]' ).find( '.image-favorite' ).children( 'i' ).removeClass( 'fa-heart' ).addClass( 'fa-heart-o' );
|
||||
}
|
||||
else
|
||||
{
|
||||
button.children( 'i' ).removeClass( 'fa-heart-o' ).addClass( 'fa-heart' );
|
||||
$( '.image[image-id="' + image_id + '"]' ).attr( 'favorite', 1 );
|
||||
$( '.image[image-id="' + image_id + '"]' ).find( '.image-favorite' ).children( 'i' ).removeClass( 'fa-heart-o' ).addClass( 'fa-heart' );
|
||||
}
|
||||
|
||||
button.removeClass( 'disabled' );
|
||||
}
|
||||
});
|
||||
return false;
|
||||
});
|
||||
<? endif;?>
|
||||
});
|
||||
</script>
|
||||
26
templates/articles/article-miniature.php
Normal file
26
templates/articles/article-miniature.php
Normal file
@@ -0,0 +1,26 @@
|
||||
<? global $lang;?>
|
||||
<div class="article-miniature">
|
||||
<?
|
||||
$this -> article['language']['seo_link'] ? $url = $this -> article['language']['seo_link'] : $url = 'a-' . $this -> article['id'] . '-' . \S::seo( $this -> article['language']['title'] );
|
||||
|
||||
?>
|
||||
<h3 class="article-title">
|
||||
<a href="./<?= $url;?>" title="<?= $this -> article['language']['title'];?>" <? if ( $this -> article['language']['noindex'] ):?>rel="nofollow"<? endif;?>><?= $this -> article['language']['title'];?></a>
|
||||
</h3>
|
||||
<?
|
||||
|
||||
if ( $this -> article['show_date_add'] )
|
||||
echo '<div class="date-add">' . $lang['data-dodania'] . ': ' . $this -> article['date_add'] . '</div>';
|
||||
|
||||
if ( $this -> article['show_date_modify'] )
|
||||
echo '<div class="date-add">' . $lang['data-modyfikacji'] . ': ' . $this -> article['date_modify'] . '</div>';
|
||||
|
||||
if ( $img = \front\factory\Articles::get_image( $this -> article ) ):
|
||||
?>
|
||||
<a href="./<?= $url;?>" title="<?= $this -> article['language']['title'];?>" <? if ( $this -> article['language']['noindex'] ):?>rel="nofollow"<? endif;?>>
|
||||
<div style="background: url( '/libraries/thumb.php?img=<?= $img;?>&w=250&h=250' ) no-repeat center;"></div>
|
||||
</a>
|
||||
<?
|
||||
endif;
|
||||
?>
|
||||
</div>
|
||||
130
templates/articles/article.php
Normal file
130
templates/articles/article.php
Normal file
@@ -0,0 +1,130 @@
|
||||
<? global $lang;?>
|
||||
<?
|
||||
$text = $this -> article['language']['text'];
|
||||
$text = \front\factory\Articles::generateHeadersIds( $text );
|
||||
?>
|
||||
<div class="article">
|
||||
<?
|
||||
$this -> article['language']['seo_link'] ? $url = $this -> article['language']['seo_link'] : $url = 'a-' . $this -> article['id'] . '-' . \S::seo( $this -> article['language']['title'] );
|
||||
|
||||
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;?>
|
||||
<? 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="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&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>
|
||||
<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>
|
||||
8
templates/articles/articles-entries.php
Normal file
8
templates/articles/articles-entries.php
Normal file
@@ -0,0 +1,8 @@
|
||||
<div class="row">
|
||||
<? if ( is_array( $this -> articles ) ): foreach ( $this -> articles as $article ):
|
||||
$tpl = new \Tpl;
|
||||
$tpl -> page_id = $this -> page_id;
|
||||
$tpl -> article = $article;
|
||||
echo $tpl -> render( 'articles/article-entry' );
|
||||
endforeach; endif;?>
|
||||
</div>
|
||||
9
templates/articles/news-list.php
Normal file
9
templates/articles/news-list.php
Normal file
@@ -0,0 +1,9 @@
|
||||
<ul class="news-list">
|
||||
<? if ( \S::is_array_fix( $this -> articles ) ): foreach ( $this -> articles as $article ):?>
|
||||
<? $article['language']['seo_link'] ? $url = $article['language']['seo_link'] : $url = 'a-' . $article['id'] . '-' . \S::seo( $article['language']['title'] );?>
|
||||
<li>
|
||||
<a href="/<? if ( \S::get_session( 'current-lang' ) != \front\factory\Languages::default_language( \S::get_domain( $_SERVER['HTTP_HOST'] ) ) ) echo \S::get_session( 'current-lang' ) . '/';?><?= $url;?>" title="<?= $article['language']['title'];?>" <? if ( $article['language']['noindex'] ):?>rel="nofollow"<? endif;?>><i class="far fa-file-alt"></i><?= $article['language']['title'];?></a>
|
||||
<div class="date-add"><?= date( 'd.m.Y', strtotime( $article['date_add'] ) );?></div>
|
||||
</li>
|
||||
<? endforeach; endif;?>
|
||||
</ul>
|
||||
38
templates/articles/news.php
Normal file
38
templates/articles/news.php
Normal file
@@ -0,0 +1,38 @@
|
||||
<? global $lang, $config, $settings;?>
|
||||
<? 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;?>
|
||||
29
templates/banner/banners.php
Normal file
29
templates/banner/banners.php
Normal file
@@ -0,0 +1,29 @@
|
||||
<div id="banners-container">
|
||||
<ul class="rslides">
|
||||
<? if ( is_array( $this -> banners ) ): foreach ( $this -> banners as $banner ):?>
|
||||
<li>
|
||||
<? if ( $banner['languages']['url'] ):?><a href="<?= $banner['languages']['url'];?>"><? endif;?>
|
||||
<img src="<?= $banner['languages']['src'];?>">
|
||||
<? if ( $banner['languages']['url'] ):?></a><? endif;?>
|
||||
</li>
|
||||
<? endforeach; endif;?>
|
||||
</ul>
|
||||
<? if ( is_array( $this -> banners ) ): foreach ( $this -> banners as $banner ):?>
|
||||
<? if ( $banner['languages']['html'] ): $banner['languages']['html']; endif;?>
|
||||
<? if ( $banner['languages']['text'] ): $banner['languages']['text']; endif;?>
|
||||
<? endforeach; endif;?>
|
||||
</div>
|
||||
<link class="footer" rel="stylesheet" href="/plugins/responsive-slides/responsiveslides.css">
|
||||
<script class="footer" type="text/javascript" src="/plugins/responsive-slides/responsiveslides.js"></script>
|
||||
<script class="footer" type="text/javascript">
|
||||
$( function ()
|
||||
{
|
||||
$( ".rslides" ).responsiveSlides({
|
||||
speed: 800,
|
||||
pager: true,
|
||||
nav: true,
|
||||
prevText: '<i class="fa fa-chevron-left"><\/i>',
|
||||
nextText: '<i class="fa fa-chevron-right"><\/i>'
|
||||
});
|
||||
});
|
||||
</script>
|
||||
38
templates/banner/main-banner.php
Normal file
38
templates/banner/main-banner.php
Normal file
@@ -0,0 +1,38 @@
|
||||
<?
|
||||
$image = getimagesize( substr( $this -> banner['languages']['src'], 1, strlen( $this -> banner['languages']['src'] ) ) );
|
||||
?>
|
||||
<div id="popup-bg" onClick="popup_close(); return false;">
|
||||
<div id="popup-content"
|
||||
<? if ( $this -> banner['languages']['url'] ):?>onClick="document.location.href='<?= $this -> banner['languages']['url'];?>'; return false;"<? endif;?>">
|
||||
<? if ( $this -> banner['languages']['src'] ):?>
|
||||
<img src="<?= $this -> banner['languages']['src'];?>" style="<? if ( $image[0] ):?> max-width: height: <?= $image[0];?>px;<? endif;?>;<? if ( $image[1] ):?>max-height: <?= $image[1];?>px;<? endif;?>">
|
||||
<? endif;?>
|
||||
<? if ( $this -> banner['languages']['html'] ): echo $this -> banner['languages']['html']; endif;?>
|
||||
<? if ( $this -> banner['languages']['text'] ): echo $this -> banner['languages']['text']; endif;?>
|
||||
</div>
|
||||
</div>
|
||||
<script class="footer" type="text/javascript">
|
||||
$( function()
|
||||
{
|
||||
$( 'body' ).addClass( 'no-scroll' );
|
||||
});
|
||||
|
||||
function popup_close()
|
||||
{
|
||||
$.ajax(
|
||||
{
|
||||
type: 'POST',
|
||||
cache: false,
|
||||
url: 'ajax.php',
|
||||
data:
|
||||
{
|
||||
a: 'banner_close'
|
||||
},
|
||||
success: function( data )
|
||||
{
|
||||
jQuery( "#popup-bg" ).remove();
|
||||
$( 'body' ).removeClass( 'no-scroll' );
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
59
templates/controls/alert-product-sets.php
Normal file
59
templates/controls/alert-product-sets.php
Normal file
@@ -0,0 +1,59 @@
|
||||
<? global $lang_id;?>
|
||||
<? if ( \S::is_array_fix( $this -> products ) ):?>
|
||||
<h2>Dobierz inne produkty do kompletu</h2>
|
||||
<? endif;?>
|
||||
<div class="product-sets">
|
||||
<? if ( is_array( $this -> products ) ): foreach ( $this -> products as $product_id ):
|
||||
$product = new \shop\Product( $product_id );
|
||||
|
||||
$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="product">
|
||||
<? if ( $product -> new_to_date and $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( $product -> images[0]['src'], 1 ) ) ):?>
|
||||
<? if ( $this -> class == 'item' ):?>
|
||||
<img class="owl-lazy" data-src="/thumb/490/0/<?= substr( $product -> images[0]['src'], 1, strlen( $product -> images[0]['src'] ) );?>" alt="<?= $product -> images[0]['alt'];?>">
|
||||
<? else:?>
|
||||
<img class="lozad first" data-src="/thumb/490/0/<?= substr( $product -> images[0]['src'], 1, strlen( $product -> images[0]['src'] ) );?>" alt="<?= $product -> images[0]['alt'];?>">
|
||||
<? if ( file_exists( substr( $product -> images[1]['src'], 1 ) ) ):?>
|
||||
<img class="lozad second" data-src="/thumb/490/0/<?= substr( $product -> images[1]['src'], 1, strlen( $product -> images[1]['src'] ) );?>" alt="<?= $product -> images[1]['alt'];?>">
|
||||
<? else:?>
|
||||
<img class="lozad second" data-src="/thumb/490/0/<?= substr( $product -> images[0]['src'], 1, strlen( $product -> images[0]['src'] ) );?>" alt="<?= $product -> images[0]['alt'];?>">
|
||||
<? endif;?>
|
||||
<? endif;?>
|
||||
<? else:?>
|
||||
|
||||
<? endif;?>
|
||||
</div>
|
||||
</a>
|
||||
<div class="product-details">
|
||||
<h2 class="name">
|
||||
<a href="<?= $url;?>" class="a-name">
|
||||
<?= $product -> language['name'];?>
|
||||
</a>
|
||||
</h2>
|
||||
<div class="prices">
|
||||
<? if ( $product -> price_brutto_promo ):?>
|
||||
<div class="price-old">
|
||||
<?= \shop\Shop::shortPrice( $product -> price_brutto );?> <span class="small">zł</span>
|
||||
</div>
|
||||
<div class="price">
|
||||
<?= \shop\Shop::shortPrice( $product -> price_brutto_promo );?> <span class="small">zł</span>
|
||||
</div>
|
||||
<? else:?>
|
||||
<div class="price">
|
||||
<?= \shop\Shop::shortPrice( $product -> price_brutto );?> <span class="small">zł</span>
|
||||
</div>
|
||||
<? endif;?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<? endforeach; endif;?>
|
||||
</div>
|
||||
45
templates/menu/main-menu.php
Normal file
45
templates/menu/main-menu.php
Normal 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 <= 767 )
|
||||
{
|
||||
$( '#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>
|
||||
5
templates/menu/menu.php
Normal file
5
templates/menu/menu.php
Normal 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>
|
||||
55
templates/menu/pages.php
Normal file
55
templates/menu/pages.php
Normal 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>';
|
||||
}
|
||||
?>
|
||||
26
templates/menu/submenu.php
Normal file
26
templates/menu/submenu.php
Normal 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>';
|
||||
}
|
||||
171
templates/newsletter/newsletter.php
Normal file
171
templates/newsletter/newsletter.php
Normal 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>
|
||||
28
templates/newsletter/preview.php
Normal file
28
templates/newsletter/preview.php
Normal file
@@ -0,0 +1,28 @@
|
||||
<div style="border-bottom: 1px solid #ccc;">
|
||||
<?= $this -> settings['newsletter_header'];?>
|
||||
</div>
|
||||
<div style="border-bottom: 1px solid #ccc; padding: 10px 0 0 0;">
|
||||
<? if ( is_array( $this -> articles ) ): foreach ( $this -> articles as $article ):?>
|
||||
<? $article['language']['seo_link'] ? $url = $article['language']['seo_link'] : $url = 'a-' . $article['id'] . '-' . \S::seo( $article['language']['title'] );?>
|
||||
<div style="padding: 10px; background: #F1F1F1; margin-bottom: 10px">
|
||||
<?
|
||||
$article['language']['seo_link'] ? $url = $article['language']['seo_link'] : $url = 'a-' . $article['id'] . '-' . \S::seo( $article['language']['title'] );
|
||||
?>
|
||||
<a href="http://www.<?= $_SERVER['SERVER_NAME'];?>/<?= $url;?>" title="<?= $article['language']['title'];?>" style="margin-bottom: 10px; display: block; font-size: 14px; color: #5b7fb1; font-weight: 600;">
|
||||
<?= $article['language']['title'];?>
|
||||
</a>
|
||||
<div>
|
||||
<?
|
||||
if ( $article['language']['entry'] )
|
||||
echo $article['language']['entry'];
|
||||
else
|
||||
echo $article['language']['text'];
|
||||
?>
|
||||
</div>
|
||||
<div style="clear: both;"></div>
|
||||
</div>
|
||||
<? endforeach; endif;?>
|
||||
</div>
|
||||
<div style="border-bottom: 1px solid #ccc; padding: 10px 0 0 0;">
|
||||
<?= $this -> settings['newsletter_footer'];?>
|
||||
</div>
|
||||
11
templates/scontainers/scontainer.php
Normal file
11
templates/scontainers/scontainer.php
Normal file
@@ -0,0 +1,11 @@
|
||||
<? global $lang;?>
|
||||
<? if ( $this -> scontainer['status'] == 1 ):?>
|
||||
<div id="scontainer-<?= $this -> scontainer['id'];?>">
|
||||
<? if ( $this -> scontainer['show_title'] == 1 ):?>
|
||||
<div class="scontainer-title">
|
||||
<?= $this -> scontainer['languages']['title'];?>
|
||||
</div>
|
||||
<? endif;?>
|
||||
<?= $this -> scontainer['languages']['text'];?>
|
||||
</div>
|
||||
<? endif;?>
|
||||
13
templates/shop-basket/_partials/product-custom-fields.php
Normal file
13
templates/shop-basket/_partials/product-custom-fields.php
Normal file
@@ -0,0 +1,13 @@
|
||||
<? if ( $this -> custom_fields ): foreach ( $this -> custom_fields as $key => $val ):?>
|
||||
<div class="custom-field">
|
||||
<div class="_name">
|
||||
<?
|
||||
$custom_field = \shop\ProductCustomField::getFromCache( $key );
|
||||
echo $custom_field['name'] . ':';
|
||||
?>
|
||||
</div>
|
||||
<div class="_text">
|
||||
<?= $val;?>
|
||||
</div>
|
||||
</div>
|
||||
<? endforeach; endif;?>
|
||||
128
templates/shop-basket/address-form.php
Normal file
128
templates/shop-basket/address-form.php
Normal file
@@ -0,0 +1,128 @@
|
||||
<div class="basket-address-form">
|
||||
<? if ( !$this -> client ):?>
|
||||
<div class="box-title"><?= \S::lang( 'zloz-zamowienie-bez-rejestraji' );?></div>
|
||||
<? else:?>
|
||||
<?
|
||||
if ( is_array( $this -> addresses ) ) for ( $i = 0; $i < count( $this -> addresses ); $i++ )
|
||||
if ( $this -> addresses[$i]['current'] == 1 )
|
||||
$address_current = $this -> addresses[$i];
|
||||
|
||||
if ( !$address and $this -> addresses[0] )
|
||||
$address_current = $this -> addresses[0];
|
||||
?>
|
||||
<? endif;?>
|
||||
<? if ( $this -> client ):?>
|
||||
<div class="left">
|
||||
<? if ( is_array( $this -> addresses ) and count( $this -> addresses ) ):?>
|
||||
<div class="addresses">
|
||||
<? foreach ( $this -> addresses as $address ):?>
|
||||
<? if ( $address['current'] ) $address_current = $address; ?>
|
||||
<div class="address<? if ( $address['current'] ):?> active<? endif;?>" id="address-<?= $address['id'];?>">
|
||||
<span field="name"><?= $address['name'] . '</span> <span field="surname">' . $address['surname'];?></span>
|
||||
<? if ( $address['firm'] ) echo '<br/><span field="firm">' . $address['firm'] . '</span>';?>
|
||||
<br/><span field="street"><?= $address['street'];?></span>
|
||||
<br/><span field="postal_code"><?= $address['postal_code'] . '</span> <span field="city">' . $address['city'] . '</span>';?>
|
||||
<br/><span field="phone"><?= $address['phone'];?></span>
|
||||
<div class="buttons">
|
||||
<a href="#" class="btn-select" address="<?= $address['id'];?>"><?= \S::lang( 'wybierz' );?></a>
|
||||
</div>
|
||||
</div>
|
||||
<? endforeach;?>
|
||||
</div>
|
||||
<? endif;?>
|
||||
</div>
|
||||
<? endif;?>
|
||||
<? if ( $this -> client ):?><div class="right"><? endif;?>
|
||||
<form class="form-horizontal" action="/zloz-zamowienie" method="POST" id="form-order">
|
||||
<? if ( !$this -> client ):?>
|
||||
<div class="form-group row">
|
||||
<div class="col-12">
|
||||
<input type="email" name="email" class="form-control" required placeholder="<?= ucfirst( \S::lang( 'email' ) );?>">
|
||||
</div>
|
||||
</div>
|
||||
<? endif;?>
|
||||
<div class="form-group row">
|
||||
<div class="col-12">
|
||||
<input type="text" id="name" name="name" class="form-control" required placeholder="<?= ucfirst( \S::lang( 'imie' ) );?>" value="<?= htmlspecialchars( $address_current['name'] );?>">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<div class="col-12">
|
||||
<input type="text" id="surname" name="surname" class="form-control" required placeholder="<?= ucfirst( \S::lang( 'nazwisko' ) );?>" value="<?= htmlspecialchars( $address_current['surname'] );?>">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<div class="col-12">
|
||||
<input type="text" id="firm" name="firm" class="form-control" placeholder="<?= ucfirst( \S::lang( 'firma' ) );?> (<?= \S::lang( 'opcjonalnie' );?>)" value="<?= htmlspecialchars( $address_current['firm'] );?>">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<input type="text" id="street" name="street" class="form-control" <? if ( !in_array( $this -> transport_method['id'], [ 1, 2, 3] ) ):?> required<? endif;?> placeholder="<?= ucfirst( \S::lang( 'ulica-i-nr-domu' ) );?> <? if ( in_array( $this -> transport_method['id'], [ 1, 2, 3] ) ):?> (<?= \S::lang( 'opcjonalnie' );?>)<? endif;?>" value="<?= htmlspecialchars( $address_current['street'] );?>">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="row">
|
||||
<div class="col-12 col-md-6">
|
||||
<input type="text" id="postal_code" name="postal_code" pattern="[0-9]{2}-[0-9]{3}" title="Format xx-xxx" class="form-control" <? if ( !in_array( $this -> transport_method['id'], [ 1, 2, 3] ) ):?> required<? endif;?> placeholder="<?= ucfirst( \S::lang( 'kod-pocztowy' ) );?><? if ( in_array( $this -> transport_method['id'], [ 1, 2, 3] ) ):?> (<?= \S::lang( 'opcjonalnie' );?>)<? endif;?>" " value="<?= htmlspecialchars( $address_current['postal_code'] );?>">
|
||||
</div>
|
||||
<div class="col-12 col-md-6">
|
||||
<input type="text" id="city" name="city" class="form-control" <? if ( !in_array( $this -> transport_method['id'], [ 1, 2, 3] ) ):?> required<? endif;?> placeholder="<?= ucfirst( \S::lang( 'miasto' ) );?><? if ( in_array( $this -> transport_method['id'], [ 1, 2, 3] ) ):?> (<?= \S::lang( 'opcjonalnie' );?>)<? endif;?>" " value="<?= htmlspecialchars( $address_current['city'] );?>">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<input type="text" id="phone" name="phone" class="form-control" required placeholder="<?= ucfirst( \S::lang( 'telefon' ) );?>" value="<?= htmlspecialchars( $address_current['phone'] );?>">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="row">
|
||||
<div class="col-12" id="agreement">
|
||||
<input type="checkbox" name="agreement" required="">
|
||||
<?= \S::lang( 'przeczytalem-i-akceptuje-polityke-prywatnosci-i-regulamin' );?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<button type="submit" class="btn btn-success" id="order-send"><span class="text"><?= ucfirst( \S::lang( 'zamawiam-z-obowiazkiem-zaplaty' ) );?></span></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<? if ( $this -> client ):?>
|
||||
</div>
|
||||
</div>
|
||||
<? endif;?>
|
||||
</form>
|
||||
<? if ( $this -> client ):?></div><? endif;?>
|
||||
</div>
|
||||
<script class="footer">
|
||||
$( function()
|
||||
{
|
||||
$( 'body' ).on( click_event, '.addresses .address .btn-select', function(e)
|
||||
{
|
||||
e.preventDefault();
|
||||
var address_id = $( this ).attr( 'address' );
|
||||
|
||||
$.ajax(
|
||||
{
|
||||
type: 'POST',
|
||||
cache: false,
|
||||
url: '/shopClient/mark_address_as_current',
|
||||
data:
|
||||
{
|
||||
address_id: address_id
|
||||
}
|
||||
});
|
||||
|
||||
$( '#address-' + address_id + ' span' ).each( function()
|
||||
{
|
||||
var field = $( this ).attr( 'field' );
|
||||
var value = $( this ).html();
|
||||
|
||||
$( '.basket-address-form form #' + field ).val( value );
|
||||
});
|
||||
|
||||
$( '.addresses .address' ).removeClass( 'active' );
|
||||
$( '#address-' + address_id ).addClass( 'active' );
|
||||
});
|
||||
});
|
||||
</script>
|
||||
79
templates/shop-basket/alert-product-sets.php
Normal file
79
templates/shop-basket/alert-product-sets.php
Normal file
@@ -0,0 +1,79 @@
|
||||
<? global $lang_id;?>
|
||||
<? if ( \S::is_array_fix( $this -> products ) ):?>
|
||||
<h2>Dobierz inne produkty do kompletu</h2>
|
||||
<? endif;?>
|
||||
<div class="product-sets">
|
||||
<? if ( is_array( $this -> products ) ): foreach ( $this -> products as $product_id ):
|
||||
$product = \shop\Product::getFromCache( $product_id, $lang_id );
|
||||
|
||||
$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="product">
|
||||
<? if ( $product -> new_to_date and $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( $product -> images[0]['src'], 1 ) ) ):?>
|
||||
<? if ( $this -> class == 'item' ):?>
|
||||
<img class="owl-lazy" data-src="/thumb/490/0/<?= substr( $product -> images[0]['src'], 1, strlen( $product -> images[0]['src'] ) );?>" alt="<?= $product -> images[0]['alt'];?>">
|
||||
<? else:?>
|
||||
<img class="first" src="/thumb/490/0/<?= substr( $product -> images[0]['src'], 1, strlen( $product -> images[0]['src'] ) );?>" alt="<?= $product -> images[0]['alt'];?>">
|
||||
<? if ( file_exists( substr( $product -> images[1]['src'], 1 ) ) ):?>
|
||||
<img class="second" src="/thumb/490/0/<?= substr( $product -> images[1]['src'], 1, strlen( $product -> images[1]['src'] ) );?>" alt="<?= $product -> images[1]['alt'];?>">
|
||||
<? else:?>
|
||||
<img class="second" src="/thumb/490/0/<?= substr( $product -> images[0]['src'], 1, strlen( $product -> images[0]['src'] ) );?>" alt="<?= $product -> images[0]['alt'];?>">
|
||||
<? endif;?>
|
||||
<? endif;?>
|
||||
<? else:?>
|
||||
|
||||
<? endif;?>
|
||||
</div>
|
||||
</a>
|
||||
<div class="product-details">
|
||||
<h2 class="name">
|
||||
<a href="<?= $url;?>" class="a-name">
|
||||
<?= $product -> language['name'];?>
|
||||
</a>
|
||||
</h2>
|
||||
<div class="prices">
|
||||
<?
|
||||
$prices = $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 ( $product -> price_brutto_promo ):?>
|
||||
<div class="price-old">
|
||||
<?= \shop\Shop::shortPrice( $product -> price_brutto );?> <span class="small">zł</span>
|
||||
</div>
|
||||
<div class="price">
|
||||
<?= \shop\Shop::shortPrice( $product -> price_brutto_promo );?> <span class="small">zł</span>
|
||||
</div>
|
||||
<? else:?>
|
||||
<div class="price">
|
||||
<?= \shop\Shop::shortPrice( $product -> price_brutto );?> <span class="small">zł</span>
|
||||
</div>
|
||||
<? endif;
|
||||
};?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<? endforeach; endif;?>
|
||||
</div>
|
||||
114
templates/shop-basket/basket-details.php
Normal file
114
templates/shop-basket/basket-details.php
Normal 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 = \shop\Product::getFromCache( (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>
|
||||
24
templates/shop-basket/basket-mini.php
Normal file
24
templates/shop-basket/basket-mini.php
Normal 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/shopping-cart.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>
|
||||
44
templates/shop-basket/basket-payments-methods.php
Normal file
44
templates/shop-basket/basket-payments-methods.php
Normal file
@@ -0,0 +1,44 @@
|
||||
<?
|
||||
$pm_found = false;
|
||||
|
||||
if ( is_array( $this -> payment_methods ) ): foreach ( $this -> payment_methods as $payment_method ):
|
||||
if ( $payment_method['id'] == \S::get_session( 'basket-payment-method-id' ) )
|
||||
$pm_found = true;
|
||||
endforeach; endif;
|
||||
|
||||
$basket = \S::get_session( 'basket' );
|
||||
$coupon = \S::get_session( 'coupon' );
|
||||
$transport_cost = \front\factory\ShopTransport::transport_cost( \S::get_session( 'basket-transport-method-id' ) );
|
||||
|
||||
$basket_summary = \front\factory\ShopBasket::summary_price( $basket, $coupon ) + $transport_cost;
|
||||
?>
|
||||
<? if ( is_array( $this -> payment_methods ) ): foreach ( $this -> payment_methods as $payment_method ):?>
|
||||
<? if ( $payment_method['id'] != 6 or $payment_method['id'] == 6 and $basket_summary >= 40 and $basket_summary <= 1000 ):?>
|
||||
<div class="options">
|
||||
<div class="check">
|
||||
<input type="radio" class="icheck" name="payment_method" value="<?= $payment_method['id'];?>"
|
||||
<?
|
||||
if (
|
||||
$payment_method['id'] == \S::get_session( 'basket-payment-method-id' )
|
||||
or
|
||||
count( $this -> payment_methods ) === 1
|
||||
or
|
||||
!\S::get_session( 'basket-payment-method-id' ) and $payment_method == end( $this -> payment_methods )
|
||||
or
|
||||
\S::get_session( 'basket-payment-method-id' ) and !$pm_found and $payment_method == end( $this -> payment_methods )
|
||||
):
|
||||
|
||||
\S::set_session( 'basket-payment-method-id', $payment_method['id'] );
|
||||
|
||||
echo 'checked="checked"';
|
||||
endif;
|
||||
?>
|
||||
>
|
||||
</div>
|
||||
<div class="description">
|
||||
<div><?= $payment_method['name'];?> <? if ( $payment_method['id'] == 6 ):?><img src="/layout/images/paypo-logo.svg"><? endif;?></div>
|
||||
<div class="small"><?= $payment_method['description'];?></div>
|
||||
</div>
|
||||
</div>
|
||||
<? endif;?>
|
||||
<? endforeach; endif;?>
|
||||
66
templates/shop-basket/basket-transport-methods.php
Normal file
66
templates/shop-basket/basket-transport-methods.php
Normal file
@@ -0,0 +1,66 @@
|
||||
<?
|
||||
if ( is_array( $this -> transports_methods ) )
|
||||
{
|
||||
$transport_found = false;
|
||||
$default_transport_id = false;
|
||||
|
||||
foreach ( $this -> transports_methods as $transport_method )
|
||||
{
|
||||
if ( $transport_method['id'] == $this -> transport_id )
|
||||
$transport_found = true;
|
||||
|
||||
if ( $transport_method['default'] )
|
||||
$default_transport_id = $transport_method['id'];
|
||||
}
|
||||
|
||||
if ( !$transport_found )
|
||||
{
|
||||
$this -> transport_id = $default_transport_id;
|
||||
\S::set_session( 'basket-transport-method-id', $default_transport_id );
|
||||
}
|
||||
}
|
||||
?>
|
||||
<? if ( is_array( $this -> transports_methods ) ): foreach ( $this -> transports_methods as $transport_method ):?>
|
||||
<div class="options">
|
||||
<div class="check">
|
||||
<input type="radio" class="icheck" name="transport_method" value="<?= $transport_method['id'];?>" <? if ( $transport_method['id'] == $this -> transport_id ):?>checked="checked"<? endif;?>>
|
||||
</div>
|
||||
<div class="description">
|
||||
<div><?= $transport_method['name_visible'] != '' ? $transport_method['name_visible'] : $transport_method['name'];?></div>
|
||||
<div class="small"><?= $transport_method['description'];?></div>
|
||||
</div>
|
||||
<div class="price">
|
||||
<?= \S::decimal( $transport_method['cost'], 2 );?> zł
|
||||
</div>
|
||||
</div>
|
||||
<? if ( $transport_method['id'] == 1 or $transport_method['id'] == 2 ):?>
|
||||
<div class="inpost-info inpost-info-<?= $transport_method['id'];?>">
|
||||
<? if ( $transport_method['id'] == $this -> transport_id ):?><?= \S::get_session( 'basket-inpost-info' );?>
|
||||
<? if ( \S::get_session( 'basket-inpost-info' ) ):?>
|
||||
<a href="#" onclick="inpost_map( <?= $transport_method['id'];?> ); return false;"><?= \S::lang( 'zmien' );?></a>
|
||||
<? else:?>
|
||||
<a href="#" onclick="inpost_map( <?= $transport_method['id'];?> ); return false;"><?= \S::lang( 'wybierz' );?></a>
|
||||
<? endif;?>
|
||||
<? endif;?>
|
||||
</div>
|
||||
<? endif;?>
|
||||
<? endforeach; endif;?>
|
||||
<script class="footer" type="text/javascript">
|
||||
$( function() {
|
||||
|
||||
<? if ( \S::get_session( 'basket-transport-method-id' ) ):?>
|
||||
transport_checked( <?= \S::get_session( 'basket-transport-method-id' );?>, <?= \S::get_session( 'basket-payment-method-id' ) != '' ? \S::get_session( 'basket-payment-method-id' ) : 0;?>, false );
|
||||
<? endif;?>
|
||||
|
||||
$( '#transport-methods .icheck' ).iCheck({
|
||||
checkboxClass: 'icheckbox_square-blue',
|
||||
radioClass: 'iradio_square-blue'
|
||||
});
|
||||
|
||||
$( '#transport-methods .icheck' ).on( 'ifChecked', function( event )
|
||||
{
|
||||
var transport_method_id = $( this ).val();
|
||||
transport_checked( transport_method_id, 0, true );
|
||||
});
|
||||
});
|
||||
</script>
|
||||
434
templates/shop-basket/basket.php
Normal file
434
templates/shop-basket/basket.php
Normal file
@@ -0,0 +1,434 @@
|
||||
<div id="basket-container">
|
||||
<div id="content">
|
||||
<?= $this -> basket_details;?>
|
||||
</div>
|
||||
<div id="paypo-promo">
|
||||
Chcesz skorzystać z odroczonych płatności <img src="/layout/images/paypo-logo.svg">? Wybierz jedną z form dostawy: <strong>odbiór osobisty, Paczkomaty InPost - przedpłata lub Kurier - przedpłata</strong>.<br/>
|
||||
Wartość zamówienia musi mieścić się w przedziale od 40 zł do 1000 zł.
|
||||
</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>
|
||||
182
templates/shop-basket/summary-view.php
Normal file
182
templates/shop-basket/summary-view.php
Normal file
@@ -0,0 +1,182 @@
|
||||
<? 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 = \shop\Product::getFromCache( $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 '<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']
|
||||
] ); ?>
|
||||
<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: 1
|
||||
<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' ];?>:
|
||||
|
||||
<? if ( $this -> transport[ 'delivery_free' ] == 1 ):?>
|
||||
<span>0,00 zł</span>
|
||||
<? else:?>
|
||||
<span>
|
||||
<?= \S::decimal( $this -> transport[ 'cost' ] );?> zł
|
||||
</span>
|
||||
<? endif;?>
|
||||
</div>
|
||||
<div class="basket-summary big">
|
||||
<?
|
||||
if ( $discount )
|
||||
$summary -= $discount;
|
||||
?>
|
||||
<span id="order-summary">
|
||||
<?= $this -> transport[ 'delivery_free' ] == 1 ? \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({ ecommerce: null });
|
||||
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>
|
||||
@@ -0,0 +1,3 @@
|
||||
<div class="category-additional-text">
|
||||
<?= $this -> category['language']['additional_text'];?>
|
||||
</div>
|
||||
@@ -0,0 +1,9 @@
|
||||
<div id="category-subcategory-tiles">
|
||||
<ul class="category-subcategory-tiles">
|
||||
<?php foreach ( $this -> categories as $category ): ?>
|
||||
<li class="category-subcategory-tile">
|
||||
<a href="/<?= $category['seo_link']; ?>"><?= $category['title']; ?></a>
|
||||
</li>
|
||||
<?php endforeach; ?>
|
||||
</ul>
|
||||
</div>
|
||||
9
templates/shop-category/blog-category-products.php
Normal file
9
templates/shop-category/blog-category-products.php
Normal file
@@ -0,0 +1,9 @@
|
||||
<? global $lang_id;?>
|
||||
<div class="row">
|
||||
<? if ( is_array( $this -> products ) ): foreach ( $this -> products as $product_id ):?>
|
||||
<?= \Tpl::view( 'shop-product/product-mini', [
|
||||
'product' => \shop\Product::getFromCache( $product_id, $lang_id ),
|
||||
'class' => 'col-12 col-sm-6 col-lg-3'
|
||||
] );?>
|
||||
<? endforeach; endif;?>
|
||||
</div>
|
||||
61
templates/shop-category/categories.php
Normal file
61
templates/shop-category/categories.php
Normal file
@@ -0,0 +1,61 @@
|
||||
<?
|
||||
if ( is_array( $this -> categories ) ):
|
||||
?>
|
||||
<ul class="<? if ( $this -> level == 0 ):?>shop-categories<? endif;?> level-<?= (int)$this -> level;?>">
|
||||
<? foreach ( $this -> categories as $category ):?>
|
||||
<? if ( $category['status'] ):?>
|
||||
<li id="category-<?= $category['id'];?>" class="<? if ( $category['id'] == $this -> current_category ) echo 'active open';?>
|
||||
<?
|
||||
if ( $this -> level == 1 and is_array( $category['categories'] ) ):
|
||||
foreach ( $category['categories'] as $category_tmp ):
|
||||
if ( $category_tmp['id'] == $this -> current_category )
|
||||
echo 'open';
|
||||
endforeach;
|
||||
endif;
|
||||
?>">
|
||||
<?
|
||||
$category['language']['seo_link'] ? $url = '/' . $category['language']['seo_link'] : $url = '/k-' . $category['id'] . '-' . \S::seo( $category['language']['title'] );
|
||||
|
||||
if ( \S::get_session( 'current-lang' ) != \front\factory\Languages::default_language() and $url != '#' )
|
||||
$url = '/' . \S::get_session( 'current-lang' ) . $url;
|
||||
?>
|
||||
<a href="<?= $url;?>" title="<?= $category['language']['title'];?>" <? if ( is_array( $category['categories'] ) ) echo "class='menu-trigger'";?>>
|
||||
<?= $category['language']['title'];?>
|
||||
</a>
|
||||
<? if ( is_array( $category['categories'] ) and $category['id'] == $this -> current_category and $this -> level != 0 ):?>
|
||||
<i class="fa fa-chevron-up toggle" category="<?= $category['id'];?>"></i>
|
||||
<? endif;?>
|
||||
<? if ( is_array( $category['categories'] ) and $category['id'] != $this -> current_category and $this -> level != 0 ):?>
|
||||
<i class="fa fa-chevron-down toggle" category="<?= $category['id'];?>"></i>
|
||||
<? endif;?>
|
||||
<? if ( is_array( $category['categories'] ) ) echo \front\view\ShopCategory::categories( $category['categories'], $this -> current_category, $this -> level + 1 );?>
|
||||
</li>
|
||||
<? endif;?>
|
||||
<? endforeach;?>
|
||||
</ul>
|
||||
<?
|
||||
endif;
|
||||
?>
|
||||
<? if ( $this -> level == 0 ):?>
|
||||
<script class="footer" type="text/javascript">
|
||||
$( function()
|
||||
{
|
||||
$( 'body' ).on( click_event, '.shop-categories .toggle', function()
|
||||
{
|
||||
var category = $( this ).attr( 'category' );
|
||||
if ( $( '#category-' + category ).hasClass( 'open' ) )
|
||||
{
|
||||
$( '#category-' + category ).children( 'ul' ).css( 'height', 0 );
|
||||
$( '#category-' + category ).children( 'i.toggle' ).removeClass( 'fa-chevron-up' ).addClass( 'fa-chevron-down' );
|
||||
$( '#category-' + category ).removeClass( 'open' );
|
||||
}
|
||||
else
|
||||
{
|
||||
$( '#category-' + category ).children( 'ul' ).css( 'height', 'auto' );
|
||||
$( '#category-' + category ).children( 'i.toggle' ).removeClass( 'fa-chevron-down' ).addClass( 'fa-chevron-up' );
|
||||
$( '#category-' + category ).addClass( 'open' );
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<? endif; ?>
|
||||
24
templates/shop-category/category-description.php
Normal file
24
templates/shop-category/category-description.php
Normal file
@@ -0,0 +1,24 @@
|
||||
<? if ( $this -> category['language']['text'] or $this -> category['language']['text_hidden']) : ?>
|
||||
<div id="category-description">
|
||||
<div id="visible"><?= $this->category['language']['text']; ?></div>
|
||||
<div id="hidden"><?= $this->category['language']['text_hidden']; ?></div>
|
||||
<? if ($this->category['language']['text_hidden']) : ?>
|
||||
<a href="#" class="btn"><?= \S::lang('wiecej'); ?></a>
|
||||
<? endif; ?>
|
||||
</div>
|
||||
<? endif; ?>
|
||||
<script class="footer" type="text/javascript">
|
||||
$( function()
|
||||
{
|
||||
$( 'body' ).on( 'click touchstart', '#category-description .btn', function(e) {
|
||||
e.preventDefault();
|
||||
if ($('#category-description #hidden').is(':visible')) {
|
||||
$('#category-description #hidden').slideToggle();
|
||||
$('#category-description .btn').html('<?= \S::lang('wiecej'); ?>');
|
||||
} else {
|
||||
$('#category-description #hidden').slideToggle();
|
||||
$('#category-description .btn').html('<?= \S::lang('mniej'); ?>');
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
75
templates/shop-category/category-infinitescroll.php
Normal file
75
templates/shop-category/category-infinitescroll.php
Normal file
@@ -0,0 +1,75 @@
|
||||
<? 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) :
|
||||
echo \Tpl::view('shop-product/product-mini', [
|
||||
'product' => \shop\Product::getFromCache( $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>
|
||||
39
templates/shop-category/category.php
Normal file
39
templates/shop-category/category.php
Normal file
@@ -0,0 +1,39 @@
|
||||
<? 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" t='2'>
|
||||
<? if ( is_array( $this -> products ) ): foreach ( $this -> products as $product_id ):
|
||||
echo \Tpl::view( 'shop-product/product-mini', [
|
||||
'product' => \shop\Product::getFromCache( $product_id, $lang_id )
|
||||
] );
|
||||
endforeach; endif;?>
|
||||
</div>
|
||||
<?= $this -> pager;?>
|
||||
<?
|
||||
if ( $this -> category_description ):
|
||||
echo \Tpl::view( 'shop-category/category-description', [
|
||||
'category' => $this -> category
|
||||
] );
|
||||
endif;
|
||||
?>
|
||||
36
templates/shop-client/address-edit.php
Normal file
36
templates/shop-client/address-edit.php
Normal file
@@ -0,0 +1,36 @@
|
||||
<div class="client-panel address-edit box">
|
||||
<?= \front\view\ShopClient::client_menu( [
|
||||
'active_page' => 'addresses'
|
||||
] );?>
|
||||
<div class="box-title">
|
||||
<?= ucfirst( \S::lang( 'adresy-do-wysylki' ) );?>
|
||||
</div>
|
||||
<form method="POST" class="box-mini" action="/shopClient/address_save" id="f-new-address">
|
||||
<? if ( $this -> address['id'] ):?>
|
||||
<input type="hidden" name="address_id" value="<?= $this -> address['id'];?>">
|
||||
<? endif;?>
|
||||
<div class="form-group">
|
||||
<input type="text" name="name" required class="form-control" placeholder="<?= ucfirst( \S::lang( 'imie' ) );?>" value="<?= htmlspecialchars( $this -> address['name'] );?>">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<input type="text" name="surname" required class="form-control" placeholder="<?= ucfirst( \S::lang( 'nazwisko' ) );?>" value="<?= htmlspecialchars( $this -> address['surname'] );?>">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<input type="text" name="firm" class="form-control" placeholder="<?= ucfirst( \S::lang( 'firma' ) );?> (<?= \S::lang( 'opcjonalnie' );?>)" value="<?= htmlspecialchars( $this -> address['firm'] );?>">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<input type="text" name="street" required class="form-control" placeholder="<?= ucfirst( \S::lang( 'ulica-i-numer' ) );?>" value="<?= htmlspecialchars( $this -> address['street'] );?>">
|
||||
</div>
|
||||
<div class="form-group row-flex">
|
||||
<input type="text" name="postal_code" required class="form-control" pattern="[0-9]{2}-[0-9]{3}" title="Format xx-xxx" placeholder="<?= ucfirst( \S::lang( 'kod-pocztowy' ) );?>" value="<?= htmlspecialchars( $this -> address['postal_code'] );?>">
|
||||
<input type="text" name="city" required class="form-control" placeholder="<?= ucfirst( \S::lang( 'miejscowosc' ) );?>" value="<?= htmlspecialchars( $this -> address['city'] );?>">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<input type="text" name="phone" required class="form-control" placeholder="<?= ucfirst( \S::lang( 'numer-telefonu' ) );?>" value="<?= htmlspecialchars( $this -> address['phone'] );?>">
|
||||
</div>
|
||||
<div class="form-group row-flex">
|
||||
<a href="/panel-klienta/adresy" class="btn btn-dark"><?= ucfirst( \S::lang( 'anuluj' ) );?></a>
|
||||
<button type="submit" class="btn btn-success"><?= ucfirst( \S::lang( 'zapisz' ) );?></button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
72
templates/shop-client/client-addresses.php
Normal file
72
templates/shop-client/client-addresses.php
Normal file
@@ -0,0 +1,72 @@
|
||||
<div class="client-panel client-addresses box">
|
||||
<?= \front\view\ShopClient::client_menu( [
|
||||
'active_page' => 'addresses'
|
||||
] );?>
|
||||
<div class="box-title">
|
||||
<?= ucfirst( \S::lang( 'adresy-do-wysylki' ) );?>
|
||||
</div>
|
||||
<a href="/panel-klienta/nowy-adres" class="btn btn-success btn-big"><?= ucfirst( \S::lang( 'dodaj-nowy-adres' ) );?></span></a>
|
||||
<? if ( is_array( $this -> addresses ) and count( $this -> addresses ) ):?>
|
||||
<div class="addresses">
|
||||
<? foreach ( $this -> addresses as $address ):?>
|
||||
<div class="address">
|
||||
<?= $address['name'] . ' ' . $address['surname'];?>
|
||||
<? if ( $address['firm'] ) echo '<br/>' . $address['firm'];?>
|
||||
<br/><?= $address['street'];?>
|
||||
<br/><?= $address['postal_code'] . ' ' . $address['city'];?>
|
||||
<br/><?= $address['phone'];?>
|
||||
<div class="buttons">
|
||||
<a href="/panel-klienta/edytuj-adres/<?= $address['id'];?>"><?= \S::lang( 'zmien' );?></a>
|
||||
<a href="/panel-klienta/usun-adres/<?= $address['id'];?>" class="btn-delete text-danger"><?= \S::lang( 'usun' );?></a>
|
||||
</div>
|
||||
</div>
|
||||
<? endforeach;?>
|
||||
</div>
|
||||
<? endif;?>
|
||||
</div>
|
||||
<script class="footer" type="text/javascript">
|
||||
$( function()
|
||||
{
|
||||
$( 'body' ).on( click_event, '.address .btn-delete', function(e)
|
||||
{
|
||||
e.preventDefault();
|
||||
|
||||
var url = $( this ).attr( 'href' );
|
||||
|
||||
$.alert(
|
||||
{
|
||||
title: '<?= ucfirst( \S::lang( 'potwierdz' ) );?>',
|
||||
content: '<?= \S::lang( 'potwierdz-usuniecie-adresu' );?>',
|
||||
type: 'orange',
|
||||
closeIcon: true,
|
||||
closeIconClass: 'fas fa-close',
|
||||
typeAnimated: true,
|
||||
animation: 'opacity',
|
||||
useBootstrap: false,
|
||||
theme: 'modern',
|
||||
autoClose: 'cancel|10000',
|
||||
icon: 'fas fa-exclamation',
|
||||
buttons:
|
||||
{
|
||||
confirm:
|
||||
{
|
||||
text: '<?= \S::lang( 'usun' );?>',
|
||||
btnClass: 'btn-orange',
|
||||
keys: ['enter'],
|
||||
action: function()
|
||||
{
|
||||
document.location.href = url;
|
||||
}
|
||||
},
|
||||
cancel:
|
||||
{
|
||||
text: '<?= \S::lang( 'zamknij' );?>',
|
||||
btnClass: 'btn-blue',
|
||||
action: function() {}
|
||||
}
|
||||
}
|
||||
});
|
||||
return false;
|
||||
});
|
||||
});
|
||||
</script>
|
||||
10
templates/shop-client/client-menu.php
Normal file
10
templates/shop-client/client-menu.php
Normal file
@@ -0,0 +1,10 @@
|
||||
<div class="client-menu">
|
||||
<ul>
|
||||
<li>
|
||||
<a href="/panel-klienta/zamowienia" title="<?= \S::lang( 'historia-zamowien' );?>" class="btn btn-success <? if ( $this -> active_page == 'orders' ):?>active<? endif;?>"><?= \S::lang( 'historia-zamowien' );?></a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="/panel-klienta/adresy" title="<?= \S::lang( 'adresy' );?>" class="btn btn-success <? if ( $this -> active_page == 'addresses' ):?>active<? endif;?>"><?= \S::lang( 'adresy' );?></a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
15
templates/shop-client/client-orders.php
Normal file
15
templates/shop-client/client-orders.php
Normal file
@@ -0,0 +1,15 @@
|
||||
<? global $lang;?>
|
||||
<div class="client-panel client-orders-history box">
|
||||
<?= \front\view\ShopClient::client_menu( [
|
||||
'active_page' => 'orders'
|
||||
] );?>
|
||||
<div class="box-title">
|
||||
<?= ucfirst( \S::lang( 'historia-zamowien' ) );?>
|
||||
</div>
|
||||
<? if ( is_array( $this -> orders ) ): foreach ( $this -> orders as $order ):?>
|
||||
<?= \Tpl::view( 'shop-order/order-simple', [
|
||||
'order' => $order,
|
||||
'statuses' => \shop\Order::order_statuses()
|
||||
] );?>
|
||||
<? endforeach; endif;?>
|
||||
</div>
|
||||
21
templates/shop-client/login-form.php
Normal file
21
templates/shop-client/login-form.php
Normal file
@@ -0,0 +1,21 @@
|
||||
<div class="user-login">
|
||||
<div class="content">
|
||||
<div class="box-title">
|
||||
<?= ucfirst( \S::lang( 'logowanie' ) );?>
|
||||
</div>
|
||||
<form method="POST" action="/shopClient/login">
|
||||
<input type="hidden" name="redirect" value="<?= $_SERVER['REQUEST_URI'];?>">
|
||||
<div class="form-group">
|
||||
<input type="email" name="email" required id="email" class="form-control" placeholder="<?= ucfirst( \S::lang( 'email' ) );?>">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<input type="password" name="password" required id="password" class="form-control" placeholder="<?= ucfirst( \S::lang( 'haslo' ) );?>">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<button type="submit" class="btn btn-success"><?= ucfirst( \S::lang( 'zaloguj-sie' ) );?></button>
|
||||
<span><?= \S::lang( 'nie-pamietasz-hasla' );?> <a href="/odzyskiwanie-hasla"><?= ucfirst( \S::lang( 'nowe-haslo' ) );?></a>.</span><br />
|
||||
<span><?= \S::lang( 'nie-masz-konta' );?> <a href="/rejestracja"><?= ucfirst( \S::lang( 'zarejestruj-sie' ) );?></a>.
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
7
templates/shop-client/mini-login.php
Normal file
7
templates/shop-client/mini-login.php
Normal file
@@ -0,0 +1,7 @@
|
||||
<? global $lang;?>
|
||||
<? if ( !$this -> client ):?>
|
||||
<?= ucfirst( $lang['witaj'] );?>! <a href="/logowanie" title="Zaloguj się"> <?= ucfirst( $lang['zaloguj-sie'] );?></a> <?= $lang['lub'];?> <a href="/rejestracja" title="Rejestracja"><?= $lang['zarejestruj-sie'];?></a>
|
||||
<? else:?>
|
||||
<a href="/panel-klienta/zamowienia" title="<?= ucfirst( \S::lang( 'moje-konto' ) );?>" id="user-account"><span class="fa fa-user"></span><?= ucfirst( \S::lang( 'moje-konto' ) );?></a>
|
||||
<a href="/wylogowanie" title="<?= ucfirst( \S::lang( 'wyloguj-sie' ) );?>" id="user-logout"><span class="fa fa-unlock"></span><?= ucfirst( \S::lang( 'wyloguj-sie' ) );?></a>
|
||||
<? endif; ?>
|
||||
15
templates/shop-client/recover-password.php
Normal file
15
templates/shop-client/recover-password.php
Normal file
@@ -0,0 +1,15 @@
|
||||
<div class="user-login box">
|
||||
<div class="content">
|
||||
<div class="box-title">
|
||||
<?= ucfirst( \S::lang( 'odzyskiwanie-hasla' ) );?>
|
||||
</div>
|
||||
<form method="POST" action="/shopClient/send_email_password_recovery" id="f-password-recovery">
|
||||
<div class="form-group">
|
||||
<input type="email" name="email" required id="email" class="form-control" placeholder="<?= ucfirst( \S::lang( 'email' ) );?>">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<button type="submit" class="btn btn-success"><?= ucfirst( \S::lang( 'resetuj-haslo' ) );?></button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
136
templates/shop-client/register-form.php
Normal file
136
templates/shop-client/register-form.php
Normal file
@@ -0,0 +1,136 @@
|
||||
<div class="user-register box">
|
||||
<div class="content">
|
||||
<div class="box-title">
|
||||
<?= \S::lang('zaloz-konto-klienta');?>
|
||||
</div>
|
||||
<form method="POST" action="/" id="f-user-register">
|
||||
<input type="hidden" id="type" name="type" value="0">
|
||||
<? if ( $this -> firm_id ):?>
|
||||
<input type="hidden" id="firm_id" name="firm_id" value="<?= $this -> firm_id;?>">
|
||||
<? endif;?>
|
||||
<div class="form-group">
|
||||
<input type="email" required id="email" class="form-control" placeholder="<?= ucfirst( \S::lang('email') );?>">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<input type="password" required id="password" pattern="^\S{6,}$" class="form-control" placeholder="<?= ucfirst( \S::lang('haslo') );?> (<?= \S::lang('min');?> 6 <?= \S::lang('znakow');?>)">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<input type="password" required id="password-repeat" pattern="^\S{6,}$" class="form-control" oninput="check_match(this)" placeholder="<?= ucfirst( \S::lang('powtorz-haslo') );?>">
|
||||
</div>
|
||||
<div class="form-group agreement">
|
||||
<input type="checkbox" required class="checkbox" name="agreement" id="agreement">
|
||||
<label for="agreement">
|
||||
<?
|
||||
$text = str_replace( '[LINK-REGULAMIN]', '<a href="/regulamin">' . \S::lang('regulamin') . '</a>', \S::lang('rejestracja-akceptacja-regulaminu') );
|
||||
echo $text = str_replace( '[LINK-POLITYKA-PRYWATNOSCI]', '<a href="/polityka-prywatnosci">' . \S::lang('polityke-prywatnosci') . '</a>', $text );
|
||||
?>
|
||||
</label>
|
||||
</div>
|
||||
<div class="form-group agreement-marketing">
|
||||
<input type="checkbox" name="agreement-marketing" class="checkbox" id="agreement-marketing"> <label for="agreement-marketing"><?= \S::lang('rejestracja-zgoda-na-marketing');?></label>
|
||||
</div>
|
||||
<div class="form-group buttons">
|
||||
<button type="submit" class="btn btn-success"><?= ucfirst( \S::lang('zarejestruj-sie') );?></button>
|
||||
<span id="login"><?= ucfirst( \S::lang('masz-juz-konto') );?>? <a href="/logowanie"><?= ucfirst( \S::lang('zaloguj-sie') );?></a></span>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<script class="footer" type='text/javascript'>
|
||||
$( function()
|
||||
{
|
||||
$( 'body' ).on( 'submit', '#f-user-register', function(e)
|
||||
{
|
||||
e.preventDefault();
|
||||
|
||||
if ( $( '#f-user-register #agremment-marketing' ).is( ':checked' ) )
|
||||
var agreement_marketing = true;
|
||||
else
|
||||
var agreement_marketing = false;
|
||||
|
||||
$.ajax(
|
||||
{
|
||||
type: 'POST',
|
||||
cache: false,
|
||||
url: '/shopClient/signup',
|
||||
data:
|
||||
{
|
||||
email: $( '#f-user-register #email' ).val(),
|
||||
password: $( '#f-user-register #password' ).val(),
|
||||
agremment_marketing: agreement_marketing
|
||||
},
|
||||
beforeSend: function()
|
||||
{
|
||||
alert1 = $.alert(
|
||||
{
|
||||
title: '<?= ucfirst( \S::lang('informacja') );?>',
|
||||
content: '<?= \S::lang('prosze-czekac');?>',
|
||||
type: 'orange',
|
||||
closeIcon: true,
|
||||
closeIconClass: 'fas fa-close',
|
||||
typeAnimated: true,
|
||||
animation: 'opacity',
|
||||
useBootstrap: false,
|
||||
theme: 'modern',
|
||||
icon: 'fas fa-info',
|
||||
buttons:
|
||||
{
|
||||
confirm:
|
||||
{
|
||||
text: '<?= \S::lang('zamknij');?>',
|
||||
btnClass: 'btn-orange',
|
||||
keys: ['enter'],
|
||||
action: function() {}
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
success: function( data )
|
||||
{
|
||||
alert1.close();
|
||||
response = jQuery.parseJSON( data );
|
||||
|
||||
$.alert(
|
||||
{
|
||||
title: '<?= ucfirst( \S::lang('informacja') );?>',
|
||||
content: response.msg,
|
||||
type: 'orange',
|
||||
closeIcon: true,
|
||||
closeIconClass: 'fas fa-close',
|
||||
typeAnimated: true,
|
||||
animation: 'opacity',
|
||||
useBootstrap: false,
|
||||
theme: 'modern',
|
||||
autoClose: 'confirm|10000',
|
||||
icon: 'fas fa-info',
|
||||
buttons:
|
||||
{
|
||||
confirm:
|
||||
{
|
||||
text: '<?= \S::lang('zamknij');?>',
|
||||
btnClass: 'btn-orange',
|
||||
keys: ['enter'],
|
||||
action: function() {}
|
||||
}
|
||||
},
|
||||
onClose: function ()
|
||||
{
|
||||
if ( response.status === 'ok' )
|
||||
document.location.href = '/logowanie';
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
return false;
|
||||
});
|
||||
});
|
||||
|
||||
function check_match(input)
|
||||
{
|
||||
if ( input.value !== document.getElementById( 'password' ).value )
|
||||
input.setCustomValidity( '<?= \S::lang('podane-hasla-sa-rozne');?>');
|
||||
else
|
||||
input.setCustomValidity('');
|
||||
}
|
||||
</script>
|
||||
24
templates/shop-coupon/form.php
Normal file
24
templates/shop-coupon/form.php
Normal file
@@ -0,0 +1,24 @@
|
||||
<form method="POST" class="form-horizontal" action="/shopCoupon/use_coupon">
|
||||
<div class="input-group">
|
||||
<?
|
||||
if ( $this -> coupon -> name )
|
||||
{
|
||||
$coupon_value = $this -> coupon -> name;
|
||||
if ( $this -> coupon -> type == 1 )
|
||||
$coupon_value .= ' (' . $this -> coupon -> amount . '%)';
|
||||
};
|
||||
?>
|
||||
<input type="text" name="coupon" class="form-control" placeholder="Kod rabatowy" value="<?= $coupon_value;?>">
|
||||
<div class="input-group-append">
|
||||
<? if ( $this -> coupon -> name ):?>
|
||||
<a href="/shopCoupon/delete_coupon" class="btn btn-danger">
|
||||
<span class="text">usuń</span>
|
||||
</a>
|
||||
<? else:?>
|
||||
<button class="btn btn-success" type="submit">
|
||||
<span class="text">użyj</span>
|
||||
</button>
|
||||
<? endif;?>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
147
templates/shop-order/mail-summary.php
Normal file
147
templates/shop-order/mail-summary.php
Normal file
@@ -0,0 +1,147 @@
|
||||
<?
|
||||
global $lang_id;
|
||||
|
||||
if ( $this -> settings['ssl'] ) $base = 'https'; else $base = 'http';
|
||||
echo $this -> settings['newsletter_header'];
|
||||
?>
|
||||
<p style="font-family: Arial; font-size: 14px; font-weight: normal; margin-bottom: 25px;"><?= ucfirst( \S::lang( 'podsumowanie-zamowienia' ) );?> <?= \S::lang( 'nr' );?> <strong><?= $this -> order['number'];?></strong> <?= \S::lang( 'z-dnia' );?> <strong><?= date( 'd.m.Y H:i', strtotime( $this -> order['date_order'] ) );?></strong></p>
|
||||
<p><a href="<?= $base . "://" . $_SERVER['SERVER_NAME'];?>/zamowienie/<?= $this -> order['hash'];?>" style="display: block; width: 200px; text-align: center; padding: 10px; background: #77cdd1; color: #FFF; text-decoration: none; text-transform: uppercase;"><?= \S::lang( 'szczegoly-zamowienia' );?></a></p>
|
||||
<? if ( is_array( $this -> order['products'] ) ): foreach ( $this -> order['products'] as $product ):?>
|
||||
<? $summary_tmp += \S::normalize_decimal( $product['price_brutto'] * $product['quantity'] );?>
|
||||
<? $quantity += $product['quantity'];?>
|
||||
<? endforeach; endif;?>
|
||||
<?
|
||||
if ( $this -> order['coupon_amount'] ) {
|
||||
if ( $this -> order['coupon_type'] === '1' ) {
|
||||
$summary_tmp = $summary_tmp - $summary_tmp * $this -> order['coupon_amount'] / 100;
|
||||
}
|
||||
}
|
||||
?>
|
||||
<? $summary_tmp += $this -> order['transport_cost'];?>
|
||||
<? if ( $this -> order['payment_method_id'] == 1 ):?>
|
||||
<div style="border-bottom: 1px solid #eee; margin-bottom: 15px;"></div>
|
||||
<p style="font-family: Arial; font-size: 14px; font-weight: 600; text-transform: uppercase;"><?= \S::lang( 'dane-do-przelewu' );?>:</p>
|
||||
<div style="font-family: Arial; font-size: 14px;">
|
||||
<?= str_replace( [ '[KWOTA]', '[NR-ZAMOWIENIA]' ], [ \S::decimal( $summary_tmp ) . ' zł', $this -> order['number'] ], $this -> settings['shop_bank_account_info'] );?>
|
||||
</div>
|
||||
<? endif;?>
|
||||
|
||||
<div style="border-bottom: 1px solid #eee; margin-bottom: 15px;"></div>
|
||||
<p style="font-family: Arial; font-size: 14px; font-weight: 600; text-transform: uppercase;"><?= \S::lang( 'dane-do-dostawy' );?>:</p>
|
||||
<p style="font-family: Arial; font-size: 14px; ">
|
||||
<?= $this -> order['client_surname'];?> <?= $this -> order['client_name'];?><br />
|
||||
<?= $this -> order['client_street'];?><br />
|
||||
<?= $this -> order['client_postal_code'];?> <?= $this -> order['client_city'];?><br />
|
||||
<?= $this -> order['client_email'];?><br />
|
||||
<?= $this -> order['client_phone'];?>
|
||||
<? if ( $this -> order['inpost_paczkomat'] ):?>
|
||||
<br /><br />Paczkomat: <b><?= $this -> order['inpost_paczkomat'];?>
|
||||
<? endif;?>
|
||||
</p>
|
||||
<div style="border-bottom: 1px solid #eee; margin-bottom: 15px;"></div>
|
||||
<p style="font-family: Arial; font-size: 14px; font-weight: 600; text-transform: uppercase;"><?= \S::lang( 'zamowione-produkty' );?>:</p>
|
||||
<table style="font-family: Arial; width: 100%; max-width: 800px; border-collapse: collapse; font-size: 14px; margin-bottom: 25px;">
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="text-align: left; border-bottom: 1px solid #ccc;"><?= ucfirst( \S::lang( 'produkt' ) );?></th>
|
||||
<th style="text-align: right; border-bottom: 1px solid #ccc; padding: 0 5px;"><?= ucfirst( \S::lang( 'cena' ) );?></th>
|
||||
<th style="text-align: right; border-bottom: 1px solid #ccc; padding: 0 5px;"><?= ucfirst( \S::lang( 'ilosc' ) );?></th>
|
||||
<th style="text-align: right; border-bottom: 1px solid #ccc; padding: 0 5px;"><?= ucfirst( \S::lang( 'razem' ) );?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<? if ( is_array( $this -> order['products'] ) ): foreach ( $this -> order['products'] as $position ):?>
|
||||
<? $product = \shop\Product::getFromCache( $position['product_id'], $lang_id );?>
|
||||
<tr style="border-bottom: 1px solid #eee;">
|
||||
<td style="padding: 10px 10px 10px 0;" colspan="4">
|
||||
<?
|
||||
$product['language']['seo_link'] ? $url = '/' . $product['language']['seo_link'] : $url = '/p-' . $product['id'] . '-' . \S::seo( $product['language']['name'] );
|
||||
|
||||
if ( \S::get_session( 'current-lang' ) != \front\factory\Languages::default_language() and $url != '#' )
|
||||
$url = '/' . \S::get_session( 'current-lang' ) . $url;
|
||||
|
||||
$regex = "-(<a[^>]+href\s*=\s*['\"])(((?!'|\"|http://).)*)(['\"][^>]*>)-i";
|
||||
echo preg_replace( $regex, "$1" . $base . "://" . $_SERVER['SERVER_NAME'] . "$2$4", '<a href="' . $url . '" target="_blank" style="text-decoration: none; color: #77cdd1; font-size: 14px; font-weight: bold;">' . $product['language']['name'] . '</a>' );
|
||||
|
||||
if ( $position['attributes'] ):?>
|
||||
<div style="font-size: 13px; margin: 10px 0 0;">
|
||||
<?= $position['attributes'];?>
|
||||
</div>
|
||||
<? endif;
|
||||
|
||||
// custom fields
|
||||
if ( $position['custom_fields'] ):?>
|
||||
<div style="font-size: 13px; margin: 10px 0 0;">
|
||||
<?= $position['custom_fields'];?>
|
||||
</div>
|
||||
<? endif;
|
||||
|
||||
if ( $position['message'] ):?>
|
||||
<div style="font-size: 13px; margin: 10px 0 0;">
|
||||
<strong>Wiadomość:</strong> <?= $position['message'];?>
|
||||
</div>
|
||||
<? endif;
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr style="border-bottom: 1px solid #eee;">
|
||||
<td style="padding: 10px 10px 10px 0; width: 135px;">
|
||||
<?
|
||||
$regex = "-(<img[^>]+src\s*=\s*['\"])(((?!'|\"|http://).)*)(['\"][^>]*>)-i";
|
||||
echo preg_replace( $regex, "$1" . $base . "://" . $_SERVER['SERVER_NAME'] . "$2$4", '<img src="' . $product['images'][0]['src'] . '" style="width: 100%; max-width: 125px;">' );
|
||||
?>
|
||||
</td>
|
||||
<td style="text-align: right; white-space: nowrap; padding: 0 5px;">
|
||||
<?
|
||||
echo \S::decimal( $position['price_brutto_promo'] ) . ' zł';
|
||||
|
||||
if ( $position['price_brutto_promo'] and $position['price_brutto_promo'] < $position['price_brutto'])
|
||||
echo '<u style="font-size: 15px; font-weight: 400; color: #c3c3c3; margin-left: 5px; text-decoration: line-through;">' . \S::decimal( $position['price_brutto'] ) . ' zł</u>';
|
||||
|
||||
if ( $position['price_brutto_promo'] and $position['price_brutto_promo'] < $position['price_brutto'] )
|
||||
$discount += \S::normalize_decimal( ( $position['price_brutto'] - $position['price_brutto_promo'] ) * $position['quantity'] );
|
||||
?>
|
||||
</td>
|
||||
<td style="text-align: right; white-space: nowrap; padding: 0 5px;">
|
||||
<?= $position['quantity'];?>
|
||||
</td>
|
||||
<td style="text-align: right; white-space: nowrap; padding: 0 5px;">
|
||||
<?= \S::decimal( \S::normalize_decimal( $position['price_brutto_promo'] * $position['quantity'] ) );?> zł
|
||||
</td>
|
||||
</tr>
|
||||
<? $summary += \S::normalize_decimal( $position['price_brutto'] * $position['quantity'] );?>
|
||||
<? $quantity += $position['quantity'];?>
|
||||
<? endforeach; endif;?>
|
||||
<tr>
|
||||
<td style="text-align: right; font-weight: 600; padding-top: 10px;" colspan="3">Wartość koszyka:</td>
|
||||
<td style="text-align: right; font-weight: 600; padding-top: 10px; white-space: nowrap;"><?= \S::decimal( $summary );?> zł</td>
|
||||
</tr>
|
||||
<? if ( $discount ):?>
|
||||
<tr>
|
||||
<td style="text-align: right; font-weight: 600; padding-top: 10px;" colspan="4">
|
||||
Rabat: <span style="color: #cc0000;">-<?= \S::decimal( $discount );?> zł</span>
|
||||
</td>
|
||||
</tr>
|
||||
<? endif;?>
|
||||
<tr>
|
||||
<td style="text-align: right; font-weight: 600; padding-top: 10px;" colspan="4"><?= $this -> order['payment_method'];?></td>
|
||||
</tr>
|
||||
<tr style="border-bottom: 1px solid #eee;">
|
||||
<td style="text-align: right; font-weight: 600; padding-top: 10px; padding-bottom: 10px;" colspan="3"><?= $this -> order['transport'];?><div style="font-weight: 500; font-size: 13px; line-height: 16px; font-style: italic; margin-top: 5px;"><?= $this -> order['transport_description'];?></div></td>
|
||||
<td style="text-align: right; font-weight: 600; padding-top: 10px; padding-bottom: 10px; white-space: nowrap;"><?= \S::decimal( $this -> order['transport_cost'] );?> zł</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="text-align: right; font-weight: 600; padding-top: 10px; padding-bottom: 10px;" colspan="3"><?= ucfirst( \S::lang( 'razem' ) );?>:</td>
|
||||
<td style="text-align: right; font-weight: 600; padding-top: 10px; padding-bottom: 10px; white-space: nowrap;"><?= \S::decimal( $summary - $discount + $this -> order['transport_cost'] );?> zł</td>
|
||||
</tr>
|
||||
<? if ( $this -> order['message'] ):?>
|
||||
<tr style="border-top: 1px solid #eee;">
|
||||
<td style="text-align: left; font-weight: 600; padding-top: 10px; padding-bottom: 10px;" colspan="4">
|
||||
Wiadomość:
|
||||
<?= $this -> order['message'];?>
|
||||
</td>
|
||||
</tr>
|
||||
<? endif;?>
|
||||
</tbody>
|
||||
</table>
|
||||
<?= $this -> settings['newsletter_footer'];?>
|
||||
191
templates/shop-order/order-details.php
Normal file
191
templates/shop-order/order-details.php
Normal file
@@ -0,0 +1,191 @@
|
||||
<? 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 <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' );?> <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>
|
||||
<? 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({ ecommerce: null });
|
||||
dataLayer.push({
|
||||
event: "purchase",
|
||||
ecommerce: {
|
||||
transaction_id: "<?= $this -> order['id'];?>",
|
||||
value: 25.42,
|
||||
currency: "PLN",
|
||||
value: <?= \S::normalize_decimal( round( $this -> order['summary'], 2 ) ) - str_replace( ',', '.', round( $this -> order['transport_cost'], 2 ) );?>,
|
||||
shipping: <?= \S::normalize_decimal( $this -> order['transport_cost'] );?>,
|
||||
items: [
|
||||
<? foreach ( $this -> order['products'] as $product ):?>
|
||||
{
|
||||
'id': <?= (int)$product['product_id'];?>,
|
||||
'name': '<?= $product['name'];?>',
|
||||
'quantity': <?= $product['quantity'];?>,
|
||||
'price': <?= $product['price_brutto_promo'];?>
|
||||
}<? if ( $product != end( $this -> order['products'] ) ) echo ',';?>
|
||||
<? endforeach;?>
|
||||
]
|
||||
}
|
||||
});
|
||||
<? endif;?>
|
||||
<? unset( $_SESSION['google-analytics-purchase'] );?>
|
||||
<? endif;?>
|
||||
});
|
||||
</script>
|
||||
76
templates/shop-order/order-simple.php
Normal file
76
templates/shop-order/order-simple.php
Normal file
@@ -0,0 +1,76 @@
|
||||
<div class="order-summary-content">
|
||||
<div class="top">
|
||||
<div class="basket-summary left">
|
||||
Data zamówienia: <span><?= \S::pretty_date( 'j f Y', strtotime( $this -> order['date_order'] ) );?></span>
|
||||
</div>
|
||||
<div class="basket-summary left">
|
||||
Status zamówienia: <span><?= $this -> statuses[ $this -> order['status'] ];?></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="products">
|
||||
<? if ( is_array( $this -> order['products'] ) and count( $this -> order['products'] ) ):?>
|
||||
<? foreach ( $this -> order['products'] as $product ):?>
|
||||
<? $product_tmp = \shop\Product::getFromCache( $product['product_id'], $lang['id'] );?>
|
||||
<div class="basket-product">
|
||||
<div class="image">
|
||||
<? if ( file_exists( substr( $product_tmp['images'][0]['src'], 1 ) ) ):?>
|
||||
<img class="main-img" src="<?= $product_tmp['images'][0]['src'];?>" alt="">
|
||||
<? else:?>
|
||||
|
||||
<? endif;?>
|
||||
</div>
|
||||
<div class="details">
|
||||
<div class="name">
|
||||
<?= $product['name'];?>
|
||||
<div class="attributes">
|
||||
<?= $product['attributes'];?>
|
||||
</div>
|
||||
<div class="custom-fields">
|
||||
<?= $product['custom_fields'];?>
|
||||
</div>
|
||||
<div class="product-message">
|
||||
<?= $product['message'] != '' ? '<strong>Wiadomość:</strong> ' . $product['message'] : '';?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="prices">
|
||||
<div class="price">
|
||||
<?
|
||||
echo \S::decimal( $product['price_brutto_promo'] ) . ' zł';
|
||||
|
||||
if ( $product['price_brutto_promo'] and $product['price_brutto_promo'] < $product['price_brutto'] )
|
||||
echo '<u>' . \S::decimal( $product['price_brutto'] ) . ' zł</u>';
|
||||
|
||||
if ( $product['price_brutto_promo'] and $product['price_brutto_promo'] < $product['price_brutto'] )
|
||||
$discount += \S::normalize_decimal( ( $product['price_brutto'] - $product['price_brutto_promo'] ) * $product['quantity'] );
|
||||
?>
|
||||
<span>x <?= $product['quantity'];?></span>
|
||||
<?= \S::decimal( \S::normalize_decimal( $product['price_brutto'] * $product['quantity'] ) );?> zł
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<? $summary += \S::normalize_decimal( $product['price_brutto'] * $product['quantity'] );?>
|
||||
<? endforeach;?>
|
||||
<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 -> order['transport'];?> <span><?= \S::decimal( $this -> order['transport_cost'] );?> zł</span>
|
||||
</div>
|
||||
<div class="basket-summary big">
|
||||
<?= ucfirst( \S::lang( 'razem-z-dostawa' ) );?>: <span><?= \S::decimal( $summary - $discount + $this -> order['transport_cost'] );?> zł</span>
|
||||
</div>
|
||||
<? endif;?>
|
||||
<? if ( $this -> order['message'] ):?>
|
||||
<div class="basket-summary">
|
||||
Wiadomość:
|
||||
<span class="comment"><?= $this -> order['message'];?></span>
|
||||
</div>
|
||||
<? endif;?>
|
||||
</div>
|
||||
</div>
|
||||
31
templates/shop-order/payment-confirmation.php
Normal file
31
templates/shop-order/payment-confirmation.php
Normal file
@@ -0,0 +1,31 @@
|
||||
<? if ( $this -> order['status'] == 1 ):?>
|
||||
<div id="payment-confirmation">
|
||||
<div class="bold blue text-center">Płatność została zatwierdzona. Dziękujemy za wybranie naszych usług.</div>
|
||||
<div class="text-center">Nasz system zweryfikuje Państwa zamówienie w ciągu kilku minut.</div>
|
||||
<p></p>
|
||||
<table class="table table-stripped table-bordered payment-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-center" colspan="2">Informacje o płatności</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="text-bold">Zamówienie nr:</td><td><?= $this -> order['number'];?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="text-bold">Data transakcji:</td><td><?= date( 'Y-m-d H:i', strtotime( $this -> order['date_order'] ) );?></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<td colspan="2" class="text-right"><a href="/zamowienie/<?= $this -> order['hash'];?>" class="btn btn-success">Powrót do zamówienia</a></td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
</div>
|
||||
<? endif;?>
|
||||
<? if ( \S::get_session( 'ekomi-purchase' ) and $this -> settings['ekomi_survey'] ):?>
|
||||
<? unset( $_SESSION['ekomi-purchase'] );?>
|
||||
<?= $this -> settings['ekomi_survey'];?>
|
||||
<? endif;?>
|
||||
3
templates/shop-producer/description.php
Normal file
3
templates/shop-producer/description.php
Normal file
@@ -0,0 +1,3 @@
|
||||
<div id="category-description">
|
||||
<div id="visible"><?= $this -> description;?></div>
|
||||
</div>
|
||||
11
templates/shop-producer/list.php
Normal file
11
templates/shop-producer/list.php
Normal file
@@ -0,0 +1,11 @@
|
||||
<div class="producer-list">
|
||||
<? foreach ( $this -> producers as $producer ):?>
|
||||
<div class="producer">
|
||||
<a href="/producent/<?= \S::seo( $producer['name'] );?>">
|
||||
<? if ( file_exists( substr( $producer['img'], 1, strlen( $producer['img'] ) ) ) ):?>
|
||||
<img src="<?= $producer['img'];?>" alt="<?= $producer['name'];?>">
|
||||
<? endif;?>
|
||||
</a>
|
||||
</div>
|
||||
<? endforeach;?>
|
||||
</div>
|
||||
16
templates/shop-producer/products.php
Normal file
16
templates/shop-producer/products.php
Normal file
@@ -0,0 +1,16 @@
|
||||
<? global $lang_id;?>
|
||||
<div class="category-content">
|
||||
<? if ( is_array( $this -> products ) ): foreach ( $this -> products as $product_id ):
|
||||
echo \Tpl::view( 'shop-product/product-mini', [
|
||||
'product' => $product = \shop\Product::getFromCache( $product_id, $lang_id )
|
||||
] );
|
||||
endforeach; endif;?>
|
||||
</div>
|
||||
<?= $this -> pager;?>
|
||||
<?
|
||||
if ( $this -> producer['languages'][$lang_id]['description'] ):
|
||||
echo \Tpl::view( 'shop-producer/description', [
|
||||
'description' => $this -> producer['languages'][$lang_id]['description']
|
||||
] );
|
||||
endif;
|
||||
?>
|
||||
30
templates/shop-product/_partial/product-attribute.php
Normal file
30
templates/shop-product/_partial/product-attribute.php
Normal file
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
global $lang_id;
|
||||
$attribute_details = \front\factory\ShopAttribute::attribute_details( $this -> attribute['id'], $lang_id );
|
||||
if ( $attribute_details['type'] == 0 )
|
||||
{
|
||||
?>
|
||||
<div class="attribute-container fradio-group attribute-<?= \S::seo( $attribute_details['language']['name'] );?>" level="<?= $this -> level;?>" order="<?= $this -> order;?>" attribute="<?= \S::seo( $attribute_details['language']['name'] );?>" attribute-name="<?= $attribute_details['language']['name'];?>">
|
||||
<p class="attribute-label"><?= $attribute_details['language']['name'];?>:</p>
|
||||
<? foreach ( $this -> attribute['values'] as $value ):?>
|
||||
<div class="fradio">
|
||||
<input type="radio" id="<?= $this -> attribute['id'];?>-<?= $value['id'];?>" <? if ( $value['is_default'] ):?>checked="checked"<? endif;?> require="true" value="<?= $this -> attribute['id'];?>-<?= $value['id'];?>" name="<?= \S::seo( $attribute_details['language']['name'] );?>">
|
||||
<label for="<?= $this -> attribute['id'];?>-<?= $value['id'];?>" order="<?= $this -> order;?>"><?= \shop\ProductAttribute::get_value_name( $value['id'], $lang_id );?></label>
|
||||
</div>
|
||||
<? if ( $value['is_default'] ):?>
|
||||
<script class="footer" type="text/javascript">
|
||||
$( function()
|
||||
{
|
||||
<? if ( $this -> level == $this -> max_level ):?>
|
||||
var refresh = true;
|
||||
<? else:?>
|
||||
var refresh = false;
|
||||
<? endif;?>
|
||||
fradio_label_click( $( "label[for='<?= $this -> attribute['id'];?>-<?= $value['id'];?>']" ), refresh );
|
||||
});
|
||||
</script>
|
||||
<? endif;?>
|
||||
<? endforeach;?>
|
||||
</div>
|
||||
<?
|
||||
}
|
||||
10
templates/shop-product/_partial/product-custom-fields.php
Normal file
10
templates/shop-product/_partial/product-custom-fields.php
Normal file
@@ -0,0 +1,10 @@
|
||||
<? 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">
|
||||
<input type="text" class="form-control" name="custom_field[<?= $custom_field['id_additional_field'];?>]" field_name="<?= $custom_field['name'];?>" value="">
|
||||
</div>
|
||||
</div>
|
||||
<? endforeach; endif;?>
|
||||
15
templates/shop-product/_partial/product-meta.php
Normal file
15
templates/shop-product/_partial/product-meta.php
Normal file
@@ -0,0 +1,15 @@
|
||||
<?php
|
||||
use shop\Product;
|
||||
$product_meta = Product::product_meta($this->product_id);
|
||||
?>
|
||||
|
||||
<?php if (is_array($product_meta) && count($product_meta)): ?>
|
||||
<? $lastKey = array_key_last($product_meta); ?>
|
||||
|
||||
<div id="product-meta">
|
||||
Kategorie:
|
||||
<? foreach ($product_meta as $key => $value) : ?>
|
||||
<a href="/<?= $value['seo_link']; ?>"><?= $value['title']; ?></a><?= $lastKey != $key ? ', ': ''; ?>
|
||||
<? endforeach; ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
@@ -0,0 +1,22 @@
|
||||
<div class="warehouse-message">
|
||||
<?
|
||||
// jeżeli produkt nie jest kombinacją
|
||||
if ( !$this -> product['product_combinations'] )
|
||||
{
|
||||
if ( $this -> product['quantity'] > 0 or $this -> product['quantity'] == 0 and $this -> product['stock_0_buy'] )
|
||||
{
|
||||
if ( $this -> product -> language['warehouse_message_nonzero'] )
|
||||
echo $this -> product -> language['warehouse_message_nonzero'];
|
||||
else if ( $this -> settings['warehouse_message_nonzero_' . $this -> lang_id] )
|
||||
echo $this -> settings['warehouse_message_nonzero_' . $this -> lang_id];
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( $this -> product -> language['warehouse_message_zero'] )
|
||||
echo $this -> product -> language['warehouse_message_zero'];
|
||||
else if ( $this -> settings['warehouse_message_zero_' . $this -> lang_id] )
|
||||
echo $this -> settings['warehouse_message_zero_' . $this -> lang_id];
|
||||
}
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
69
templates/shop-product/product-mini.php
Normal file
69
templates/shop-product/product-mini.php
Normal 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;?>">
|
||||
<? 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>
|
||||
694
templates/shop-product/product.php
Normal file
694
templates/shop-product/product.php
Normal file
@@ -0,0 +1,694 @@
|
||||
<? 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">
|
||||
<?= \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 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>
|
||||
<? 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;?>
|
||||
|
||||
<?= \Tpl::view( 'shop-product/_partial/product-meta', [
|
||||
'product_id' => $this->product['id']
|
||||
]);?>
|
||||
|
||||
<div class="short-description">
|
||||
<?= $this -> product -> language['short_description'];?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="description">
|
||||
<div class="row">
|
||||
<div class="col-12 col-lg-8">
|
||||
<ul class="tabs" id="tabs-menu">
|
||||
<li class="tab-link current" id="tab-link-0" tab="0"><?= ucfirst( \S::lang( 'opis' ) );?></li>
|
||||
<? if ( $this -> product -> language['tab_name_1'] ):?>
|
||||
<li class="tab-link" id="tab-link-1" tab="1"><?= $this -> product -> language['tab_name_1'];?></li>
|
||||
<? endif;?>
|
||||
<li class="tab-link" id="tab-link-2" tab="2"><?= ucfirst( \S::lang( 'opinie' ) );?></li>
|
||||
</ul>
|
||||
<div id="tab-0" class="tab-content">
|
||||
<div class="tab-title"><?= \S::lang( 'opis-produktu' );?></div>
|
||||
<?= $this -> product -> language['description'];?>
|
||||
</div>
|
||||
<? if ( $this -> product -> language['tab_description_1'] ):?>
|
||||
<div id="tab-1" class="tab-content">
|
||||
<div class="tab-title"><?= $this -> product -> language['tab_name_1'];?></div>
|
||||
<?= $this -> product -> language['tab_description_1'];?>
|
||||
</div>
|
||||
<? endif;?>
|
||||
<div id="tab-2" class="tab-content reviews">
|
||||
<div class="tab-title"><?= ucfirst( \S::lang( 'opinie' ) );?></div>
|
||||
<div id="widget-container" class="data-ekomi-emp ekomi-widget-container ekomi-widget-sf14835961656364de9f9" ></div>
|
||||
<div id="ekomi-product-widget-identifier" class="prod-data-emp" style="visibility: hidden"><?= $this -> product['id'];?></div>
|
||||
<a href="https://www.ekomi-pl.com/opinie-marianek.html" target="_blank"><img alt="marianek.pl Reviews with ekomi-pl.com" src="https://smart-widget-assets.ekomiapps.de/resources/ekomi_logo.png" style="display: none;"/></a>
|
||||
<script type="text/javascript">
|
||||
function registerWidget (w, token) {
|
||||
w['_ekomiWidgetsServerUrl'] = 'https://widgets.ekomi.com';
|
||||
w['_customerId'] = 148359;
|
||||
w['_language'] = new Array();
|
||||
w['_language'][token] = 'auto';
|
||||
|
||||
if(typeof(w['_ekomiWidgetTokens']) !== 'undefined'){
|
||||
w['_ekomiWidgetTokens'][w['_ekomiWidgetTokens'].length] = token;
|
||||
} else {
|
||||
w['_ekomiWidgetTokens'] = new Array(token);
|
||||
}
|
||||
if(typeof(ekomiWidgetJs) == 'undefined') {
|
||||
ekomiWidgetJs = true;
|
||||
var scr = document.createElement('script');scr.src = 'https://sw-assets.ekomiapps.de/static_resources/widget.js';
|
||||
var head = document.getElementsByTagName('head')[0];head.appendChild(scr);
|
||||
|
||||
}
|
||||
return true;
|
||||
}
|
||||
(function (w) {
|
||||
var token = 'sf14835961656364de9f9';
|
||||
var k = document.getElementsByClassName("ekomi-widget-" + token);
|
||||
for(var x=0;x<k.length;x++){ registerWidget(w,token); }
|
||||
})(window);
|
||||
</script>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-12 col-lg-4">
|
||||
<? 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>
|
||||
<? 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 = \shop\Product::getFromCache( $product_sets_id, $lang_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 = \shop\Product::getFromCache( $product_related_id, $lang_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({ ecommerce: null });
|
||||
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
|
||||
}
|
||||
]
|
||||
}
|
||||
});
|
||||
<? 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 ( windowsize > 767 )
|
||||
{
|
||||
$( "#tabs-menu" ).sticky({
|
||||
topSpacing: 56
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
$( "#tabs-menu" ).sticky({
|
||||
topSpacing: 0
|
||||
});
|
||||
};
|
||||
|
||||
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 );
|
||||
});
|
||||
|
||||
$('.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 input' ).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({ ecommerce: null });
|
||||
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
|
||||
}
|
||||
]
|
||||
}
|
||||
});
|
||||
<? 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>
|
||||
68
templates/shop-product/products-box.php
Normal file
68
templates/shop-product/products-box.php
Normal 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>
|
||||
18
templates/shop-product/promoted-products.php
Normal file
18
templates/shop-product/promoted-products.php
Normal file
@@ -0,0 +1,18 @@
|
||||
<? global $lang_id;?>
|
||||
<div class="box-title"><?= ucfirst( \S::lang( 'polecane-produkty' ) );?></div>
|
||||
<div class="content">
|
||||
<? if ( is_array( $this -> products ) ): foreach ( $this -> products as $product_id ):?>
|
||||
<?
|
||||
$product = \shop\Product::getFromCache( $product_id, $lang_id );
|
||||
|
||||
$product -> 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>
|
||||
71
templates/shop-search/product-search.php
Normal file
71
templates/shop-search/product-search.php
Normal file
@@ -0,0 +1,71 @@
|
||||
<? 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">
|
||||
<?
|
||||
$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>
|
||||
</div>
|
||||
13
templates/shop-search/products.php
Normal file
13
templates/shop-search/products.php
Normal file
@@ -0,0 +1,13 @@
|
||||
<? global $lang_id;?>
|
||||
<? if ( $this -> query ):?>
|
||||
<div class="box-title">
|
||||
<?= \S::lang( 'wyniki-wyszukiwania-dla-zapytania' ) . ': <strong>' . $this -> query . '</strong>';?>
|
||||
</div>
|
||||
<? endif;?>
|
||||
<div class="search-content">
|
||||
<? if ( is_array( $this -> products ) ): foreach ( $this -> products as $product_id ):
|
||||
echo \Tpl::view( 'shop-product/product-mini', [
|
||||
'product' => \shop\Product::getFromCache( $product_id, $lang_id )
|
||||
] );
|
||||
endforeach; endif;?>
|
||||
</div>
|
||||
102
templates/shop-search/simple-form.php
Normal file
102
templates/shop-search/simple-form.php
Normal file
@@ -0,0 +1,102 @@
|
||||
<div id="search-button">
|
||||
<button class="btn" type="button">
|
||||
<img src="/layout/images/icon-magnifier.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' );?>?
|
||||
<a href="#" class="search-form-big-close"><i class="fa fa-times"></i></a>
|
||||
</div>
|
||||
<div class="input">
|
||||
<input type="text" name="q" class="form-control" placeholder="<?= \S::lang( 'wpisz-szukany-produkt' );?>">
|
||||
</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>
|
||||
3
templates/site/alert.php
Normal file
3
templates/site/alert.php
Normal file
@@ -0,0 +1,3 @@
|
||||
<div class="alert alert-success">
|
||||
<a href="#" class="close" data-dismiss="alert" aria-label="close">×</a><?= $this -> alert;?>
|
||||
</div>
|
||||
221
templates/site/contact.php
Normal file
221
templates/site/contact.php
Normal file
@@ -0,0 +1,221 @@
|
||||
<? global $settings, $lang, $config;?>
|
||||
<? if ( $settings['google_maps'] and $settings['firm_adress'] ):?>
|
||||
<script class="footer" type="text/javascript" src="https://maps.googleapis.com/maps/api/js?sensor=false&key=<?=$settings['google_map_key']?>"></script>
|
||||
<script class="footer" type="text/javascript">
|
||||
google.maps.event.addDomListener(window, 'load', init);
|
||||
function init() {
|
||||
var mapOptions = {
|
||||
zoom: 14,
|
||||
scrollwheel: false,
|
||||
styles: [{"elementType":"geometry","stylers":[{"hue":"#ff4400"},{"saturation":-68},{"lightness":-4},{"gamma":0.72}]},{"featureType":"road","elementType":"labels.icon"},{"featureType":"landscape.man_made","elementType":"geometry","stylers":[{"hue":"#0077ff"},{"gamma":3.1}]},{"featureType":"water","stylers":[{"hue":"#00ccff"},{"gamma":0.44},{"saturation":-33}]},{"featureType":"poi.park","stylers":[{"hue":"#44ff00"},{"saturation":-23}]},{"featureType":"water","elementType":"labels.text.fill","stylers":[{"hue":"#007fff"},{"gamma":0.77},{"saturation":65},{"lightness":99}]},{"featureType":"water","elementType":"labels.text.stroke","stylers":[{"gamma":0.11},{"weight":5.6},{"saturation":99},{"hue":"#0091ff"},{"lightness":-86}]},{"featureType":"transit.line","elementType":"geometry","stylers":[{"lightness":-48},{"hue":"#ff5e00"},{"gamma":1.2},{"saturation":-23}]},{"featureType":"transit","elementType":"labels.text.stroke","stylers":[{"saturation":-64},{"hue":"#ff9100"},{"lightness":16},{"gamma":0.47},{"weight":2.7}]}]
|
||||
};
|
||||
var mapElement = document.getElementById('google-map');
|
||||
var map = new google.maps.Map(mapElement, mapOptions);
|
||||
|
||||
var geocoder = new google.maps.Geocoder();
|
||||
var address = '<?= preg_replace( '/\s+/', ' ', $settings['firm_adress'] );?>';
|
||||
geocoder.geocode({'address': address}, function(results, status) {
|
||||
if (status === google.maps.GeocoderStatus.OK) {
|
||||
map.setCenter(results[0].geometry.location);
|
||||
var marker = new google.maps.Marker({
|
||||
map: map,
|
||||
position: results[0].geometry.location
|
||||
});
|
||||
} else {
|
||||
alert('Geocode was not successful for the following reason: ' + status);
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
<div id='google-map'></div>
|
||||
<? endif;?>
|
||||
<div class="row">
|
||||
<div class="col-12 col-md-6">
|
||||
<div id="contact-additional-info"><?= $settings['additional_info'];?></div>
|
||||
</div>
|
||||
<div class="col-12 col-md-6">
|
||||
<? if ( $settings['contact_form'] ):?>
|
||||
<form class="form-horizontal" id="contact-form">
|
||||
<div id="contact-form">
|
||||
<div class="form-group row">
|
||||
<div class="col-12">
|
||||
<input type='email' id="email" name="email" class="form-control" placeholder="<?= ucfirst( $lang['email'] );?> *" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<div class="col-12">
|
||||
<input type='text' id="phone" name="phone" class="form-control" placeholder="<?= ucfirst( $lang['nr-telefonu'] );?> *" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<div class="col-12">
|
||||
<input type='text' id="subject" name="subject" placeholder="<?= ucfirst( $lang['temat'] );?>" value="Zapytanie ze strony <?= preg_replace( '#^(http(s)?://)?w{3}\.#', '$1', $_SERVER['SERVER_NAME'] );?>" class="form-control" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<div class="col-12">
|
||||
<textarea id="text" name="text" class="form-control" placeholder="<?= ucfirst( $lang['wiadomosc'] );?>"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-xs-12 small">
|
||||
<input type="checkbox" id="agreement" name="agreement" required="required" style="position: relative; top: 2px;" /> <?= $lang['kontakt-zgoda-checkbox'];?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-xs-12">
|
||||
<a href="#" class='btn btn-success' id="contact-form-send" onclick="send_message(); return false;"><span class="text"><?= $lang['wyslij'];?></span></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<? endif;?>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
function send_message()
|
||||
{
|
||||
var email = $.trim( $( '#contact-form #email' ).val() );
|
||||
var phone = $.trim( $( '#contact-form #phone' ).val() );
|
||||
var subject = $.trim( $( '#contact-form #subject' ).val() );
|
||||
var text = $.trim( $( '#contact-form #text' ).val() );
|
||||
|
||||
if ( email === '' && phone === '' )
|
||||
{
|
||||
$.alert(
|
||||
{
|
||||
title: '<?= ucfirst( $lang['blad'] );?>',
|
||||
content: '<?= $lang['prosze-uzupelnic-email-i-telefon'];?>',
|
||||
type: 'orange',
|
||||
closeIcon: true,
|
||||
closeIconClass: 'fas fa-close',
|
||||
typeAnimated: true,
|
||||
animation: 'opacity',
|
||||
useBootstrap: false,
|
||||
theme: 'modern',
|
||||
autoClose: 'confirm|10000',
|
||||
icon: 'fas fa-exclamation',
|
||||
buttons:
|
||||
{
|
||||
confirm:
|
||||
{
|
||||
text: '<?= $lang['zamknij'];?>',
|
||||
btnClass: 'btn-blue',
|
||||
keys: ['enter'],
|
||||
action: function() {}
|
||||
}
|
||||
}
|
||||
});
|
||||
return false;
|
||||
}
|
||||
|
||||
if ( !$( '#contact-form #agreement' ).is( ':checked' ) )
|
||||
{
|
||||
$.alert(
|
||||
{
|
||||
title: '<?= ucfirst( $lang['blad'] );?>',
|
||||
content: '<?= $lang['prosze-zaznaczyc-zgode'];?>',
|
||||
type: 'orange',
|
||||
closeIcon: true,
|
||||
closeIconClass: 'fas fa-close',
|
||||
typeAnimated: true,
|
||||
animation: 'opacity',
|
||||
useBootstrap: false,
|
||||
theme: 'modern',
|
||||
autoClose: 'confirm|10000',
|
||||
icon: 'fas fa-exclamation',
|
||||
buttons:
|
||||
{
|
||||
confirm:
|
||||
{
|
||||
text: '<?= $lang['zamknij'];?>',
|
||||
btnClass: 'btn-blue',
|
||||
keys: ['enter'],
|
||||
action: function() {}
|
||||
}
|
||||
}
|
||||
});
|
||||
return false;
|
||||
}
|
||||
|
||||
$.ajax(
|
||||
{
|
||||
type: 'POST',
|
||||
cache: false,
|
||||
url: 'ajax.php',
|
||||
data:
|
||||
{
|
||||
a: 'contact_form',
|
||||
email: email,
|
||||
phone: phone,
|
||||
subject: subject,
|
||||
text: text
|
||||
},
|
||||
beforeSend: function()
|
||||
{
|
||||
alert1 = $.alert(
|
||||
{
|
||||
title: '<?= ucfirst( $lang['informacja'] );?>',
|
||||
content: '<?= $lang['prosze-czekac'];?>',
|
||||
type: 'orange',
|
||||
closeIcon: true,
|
||||
closeIconClass: 'fas fa-close',
|
||||
typeAnimated: true,
|
||||
animation: 'opacity',
|
||||
useBootstrap: false,
|
||||
theme: 'modern',
|
||||
autoClose: 'confirm|10000',
|
||||
icon: 'fas fa-info',
|
||||
buttons:
|
||||
{
|
||||
confirm:
|
||||
{
|
||||
text: '<?= $lang['zamknij'];?>',
|
||||
btnClass: 'btn-blue',
|
||||
keys: ['enter'],
|
||||
action: function() {}
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
success: function( data )
|
||||
{
|
||||
response = jQuery.parseJSON( data );
|
||||
|
||||
if ( response.status === 'ok' )
|
||||
var msg = '<?= $lang['wiadomosc-zostala-wyslana'];?>';
|
||||
else
|
||||
var msg = '<?= $lang['wiadomosc-niezostala-wyslana'];?>';
|
||||
|
||||
alert1.close();
|
||||
|
||||
$( '#contact-formp-big #email, #contact-form-big #text' ).val( '' );
|
||||
|
||||
$.alert(
|
||||
{
|
||||
title: '<?= ucfirst( $lang['informacja'] );?>',
|
||||
content: msg,
|
||||
type: 'orange',
|
||||
closeIcon: true,
|
||||
closeIconClass: 'fas fa-close',
|
||||
typeAnimated: true,
|
||||
animation: 'opacity',
|
||||
useBootstrap: false,
|
||||
theme: 'modern',
|
||||
autoClose: 'confirm|10000',
|
||||
icon: 'fas fa-info',
|
||||
buttons:
|
||||
{
|
||||
confirm:
|
||||
{
|
||||
text: '<?= $lang['zamknij'];?>',
|
||||
btnClass: 'btn-blue',
|
||||
keys: ['enter'],
|
||||
action: function() {}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
34
templates/site/cookie-information.php
Normal file
34
templates/site/cookie-information.php
Normal file
@@ -0,0 +1,34 @@
|
||||
<div id="cookie-information">
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-xs-12">
|
||||
W ramach naszej witryny stosujemy pliki cookies w celu świadczenia Państwu usług na najwyższym poziomie, w tym w sposób dostosowany do indywidualnych potrzeb.
|
||||
Korzystanie z witryny bez zmiany ustawień dotyczących cookies oznacza akceptację faktu iż będą one zamieszczane w Państwa urządzeniu końcowym.
|
||||
Możecie Państwo dokonać w każdym czasie zmiany ustawień dotyczących cookies. <a href="#" onclick="cookie_close(); return false;">[akceptuję]</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script class="footer" type="text/javascript">
|
||||
function cookie_close()
|
||||
{
|
||||
$.ajax(
|
||||
{
|
||||
type: 'POST',
|
||||
cache: false,
|
||||
url: '/ajax.php',
|
||||
data:
|
||||
{
|
||||
a: 'cookie_close'
|
||||
},
|
||||
beforeSend: function()
|
||||
{
|
||||
$( '#cookie-information' ).remove();
|
||||
},
|
||||
success: function( data )
|
||||
{
|
||||
$( '#cookie-information' ).remove();
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
4
templates/site/copyright.php
Normal file
4
templates/site/copyright.php
Normal file
@@ -0,0 +1,4 @@
|
||||
<div id="copyright">
|
||||
Copyright © 2019 - <?= date('Y');?> by Marianek.
|
||||
Realizacja: Project-Pro <a href="https://www.project-pro.pl">sklepy internetowe</a>
|
||||
</div>
|
||||
3
templates/site/error.php
Normal file
3
templates/site/error.php
Normal file
@@ -0,0 +1,3 @@
|
||||
<div class="alert alert-danger">
|
||||
<a href="#" class="close" data-dismiss="alert" aria-label="close">×</a><?= $this -> error;?>
|
||||
</div>
|
||||
48
templates/site/facebook.php
Normal file
48
templates/site/facebook.php
Normal file
@@ -0,0 +1,48 @@
|
||||
<div id="facebook">
|
||||
<div id="facebook-toggle"></div>
|
||||
<iframe src="//www.facebook.com/plugins/likebox.php?href=<?= urlencode( $this -> facebook_link );?>&width=292&height=558&show_faces=true&colorscheme=light&stream=true&border_color=%23FFF&header=false&appId=194295077275888" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:292px; height:558px;" allowTransparency="true"></iframe>
|
||||
</div>
|
||||
<style type="text/css">
|
||||
#facebook {
|
||||
position: fixed;
|
||||
top: 50%;
|
||||
margin-top: -277px;
|
||||
background: #FFF;
|
||||
z-index: 10;
|
||||
border: 1px solid #3B5998;
|
||||
border-left: 0px;
|
||||
width: 292px;
|
||||
height: 558px;
|
||||
left: -293px;
|
||||
-webkit-box-shadow: 1px 0px 3px 1px rgba(0, 0, 0, 0.3);
|
||||
box-shadow: 1px 0px 3px 1px rgba(0, 0, 0, 0.3);
|
||||
}
|
||||
#facebook-toggle {
|
||||
background: url( '/images/system/facebook.jpg' ) no-repeat center;
|
||||
height: 133px;
|
||||
width: 50px;
|
||||
position: relative;
|
||||
z-index: 12;
|
||||
float: right;
|
||||
right: -50px;
|
||||
top: -1px;
|
||||
-webkit-box-shadow: 1px 0px 3px 1px rgba(0, 0, 0, 0.3);
|
||||
box-shadow: 1px 0px 3px 1px rgba(0, 0, 0, 0.3);
|
||||
cursor: pointer;
|
||||
}
|
||||
#facebook iframe {
|
||||
margin-top: -133px;
|
||||
}
|
||||
</style>
|
||||
<script class="footer" type="text/javascript">
|
||||
$( function()
|
||||
{
|
||||
$( '#facebook-toggle' ).click( function()
|
||||
{
|
||||
if ( !$( '#facebook' ).hasClass( 'show' ) )
|
||||
$( '#facebook' ).addClass( 'show' ).animate({ left: -1 }, 1000 );
|
||||
else
|
||||
$( '#facebook' ).removeClass( 'show' ).animate({ left: -293 }, 500 );
|
||||
});
|
||||
});
|
||||
</script>
|
||||
20
templates/site/languages.php
Normal file
20
templates/site/languages.php
Normal file
@@ -0,0 +1,20 @@
|
||||
<? global $lang_id, $page;?>
|
||||
<div id="languages">
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-xs-12">
|
||||
<? if ( is_array( $this -> languages ) ):?>
|
||||
<ul>
|
||||
<? foreach ( $this -> languages as $lg ):?>
|
||||
<li <? if ( $lang_id == $lg['id'] ) echo 'class="active"';?>>
|
||||
<a href="<?= \front\factory\Pages::lang_url( $page['id'], $lg['id'] );?>" title="Język: <?= $lg['name'];?>">
|
||||
<img src="/admin/css/lang-<?= $lg['id'];?>.jpg" alt="Język: <?= $lg['name'];?>">
|
||||
</a>
|
||||
</li>
|
||||
<? endforeach;?>
|
||||
</ul>
|
||||
<? endif;?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
65
templates/site/loader.php
Normal file
65
templates/site/loader.php
Normal file
@@ -0,0 +1,65 @@
|
||||
<div id="loader">
|
||||
<div class="lds-ripple"><div></div><div></div></div>
|
||||
</div>
|
||||
<style type="text/css">
|
||||
#loader {
|
||||
background: #77cdd1;
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
z-index: 100;
|
||||
display: -webkit-box;
|
||||
display: -moz-box;
|
||||
display: -ms-flexbox;
|
||||
display: -webkit-flex;
|
||||
display: flex;
|
||||
-webkit-align-items: center;
|
||||
-moz-align-items: center;
|
||||
-ms-align-items: center;
|
||||
align-items: center;
|
||||
-webkit-justify-content: center;
|
||||
-moz-justify-content: center;
|
||||
-ms-justify-content: center;
|
||||
justify-content: center;
|
||||
-ms-flex-pack: center;
|
||||
}
|
||||
.lds-ripple {
|
||||
display: inline-block;
|
||||
position: relative;
|
||||
width: 64px;
|
||||
height: 64px;
|
||||
}
|
||||
.lds-ripple div {
|
||||
position: absolute;
|
||||
border: 4px solid #fff;
|
||||
opacity: 1;
|
||||
border-radius: 50%;
|
||||
animation: lds-ripple 1s cubic-bezier(0, 0.2, 0.8, 1) infinite;
|
||||
}
|
||||
.lds-ripple div:nth-child(2) {
|
||||
animation-delay: -0.5s;
|
||||
}
|
||||
@keyframes lds-ripple {
|
||||
0% {
|
||||
top: 28px;
|
||||
left: 28px;
|
||||
width: 0;
|
||||
height: 0;
|
||||
opacity: 1;
|
||||
}
|
||||
100% {
|
||||
top: -1px;
|
||||
left: -1px;
|
||||
width: 58px;
|
||||
height: 58px;
|
||||
opacity: 0;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
<script class="footer" type="text/javascript">
|
||||
$( function() {
|
||||
$( '#loader' ).fadeOut( 500, function() { $( this ).remove(); });
|
||||
});
|
||||
</script>
|
||||
45
templates/site/pager.php
Normal file
45
templates/site/pager.php
Normal file
@@ -0,0 +1,45 @@
|
||||
<?
|
||||
global $lang;
|
||||
|
||||
if ( $this -> link )
|
||||
$link = $this -> link;
|
||||
else
|
||||
{
|
||||
$this -> page['language']['seo_link'] ? $link = $this -> page['language']['seo_link'] : $link = 's-' . $this -> page['id'] . '-' . \S::seo( $this -> page['language']['title'] );
|
||||
}
|
||||
?>
|
||||
<ul class="pager">
|
||||
<? if ( $this -> bs > 1 ):?>
|
||||
<li class="first">
|
||||
<a href="/<?= $link;?>"><?= $lang['pierwsza'];?></a>
|
||||
</li>
|
||||
<li class="previous">
|
||||
<a href="/<?= $link;?><?= ( $this -> bs - 1 > 1 ) ? '/' . ( $this -> bs - 1 ) : '';?>"><?= $lang['poprzednia'];?></a>
|
||||
</li>
|
||||
<? else:?>
|
||||
<li class="first">
|
||||
<a href="#" class="inactive"><?= $lang['pierwsza'];?></a>
|
||||
</li>
|
||||
<li class="previous">
|
||||
<a href="#" class="inactive"><?= $lang['poprzednia'];?></a>
|
||||
</li>
|
||||
<? endif;?>
|
||||
<li>
|
||||
<span><?= $this -> bs ;?> <?= $lang['z'];?> <?= $this -> ls;?></span>
|
||||
</li>
|
||||
<? if ( $this -> bs < $this -> ls ):?>
|
||||
<li class="next">
|
||||
<a href="/<?= $link;?>/<?= $this -> bs + 1;?>"><?= $lang['nastepna'];?></a>
|
||||
</li>
|
||||
<li class="last">
|
||||
<a href="/<?= $link;?>/<?= $this -> ls;?>"><?= $lang['ostatnia'];?></a>
|
||||
</li>
|
||||
<? else:?>
|
||||
<li class="next">
|
||||
<a href="#" class="inactive"><?= $lang['nastepna'];?></a>
|
||||
</li>
|
||||
<li class="last">
|
||||
<a href="#" class="inactive"><?= $lang['ostatnia'];?></a>
|
||||
</li>
|
||||
<? endif;?>
|
||||
</ul>
|
||||
5
templates/site/title.php
Normal file
5
templates/site/title.php
Normal file
@@ -0,0 +1,5 @@
|
||||
<? if ( $this -> show_title ):?>
|
||||
<h1 class="site-title">
|
||||
<?= $this -> page_title ? $this -> page_title : $this -> title;?>
|
||||
</h1>
|
||||
<? endif;?>
|
||||
Reference in New Issue
Block a user