first commit
This commit is contained in:
@@ -0,0 +1,85 @@
|
||||
<?php
|
||||
|
||||
|
||||
class stRecentlyViewedProductsFrontendActions extends stActions
|
||||
{
|
||||
|
||||
public function executeShowProducts()
|
||||
{
|
||||
$this->smarty = new stSmarty('stRecentlyViewedProductsFrontend');
|
||||
|
||||
$config_recently = stConfig::getInstance(sfContext::getInstance(), 'stRecentlyViewedProductsBackend');
|
||||
|
||||
|
||||
if($config_recently->get('enabled')!=1){
|
||||
|
||||
if($config_recently->get('show_in_product')!=1){
|
||||
|
||||
return sfView::NONE;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if(stRecentlyViewedProductsPluginListener::getRecentlyViewedProducts()){
|
||||
|
||||
$this->config = stConfig::getInstance(sfContext::getInstance(), 'stProduct');
|
||||
|
||||
$this->products = stRecentlyViewedProductsPluginListener::getRecentlyViewedProducts();
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
public function executeShowProductsSidebar()
|
||||
{
|
||||
$this->smarty = new stSmarty('stRecentlyViewedProductsFrontend');
|
||||
|
||||
$config_recently = stConfig::getInstance(sfContext::getInstance(), 'stRecentlyViewedProductsBackend');
|
||||
|
||||
if($config_recently->get('enabled')!=1){
|
||||
|
||||
if($config_recently->get('show_in_sidebar')!=1){
|
||||
|
||||
return sfView::NONE;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
$i18n = $this->getContext()->getI18n();
|
||||
|
||||
if(stRecentlyViewedProductsPluginListener::getRecentlyViewedProducts()){
|
||||
|
||||
$this->config = stConfig::getInstance(sfContext::getInstance(), 'stProduct');
|
||||
|
||||
$this->products = stRecentlyViewedProductsPluginListener::getRecentlyViewedProducts();
|
||||
|
||||
}else{
|
||||
return $this->renderText("<p>".$i18n->__('W tym miejscu pojawią się ostatnio oglądane produkty.')."</p>");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public function executeRemoveProduct()
|
||||
{
|
||||
|
||||
$product_id = $this->getRequestParameter('product_id');
|
||||
|
||||
stRecentlyViewedProductsPluginListener::removeRecentlyViewedProduct($product_id);
|
||||
|
||||
//return sfView::NONE;
|
||||
|
||||
return $this->renderText("true");
|
||||
}
|
||||
|
||||
public function executeRemoveAll()
|
||||
{
|
||||
|
||||
stRecentlyViewedProductsPluginListener::removeAll();
|
||||
|
||||
//return sfView::NONE;
|
||||
return $this->renderText("true");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
|
||||
|
||||
class stRecentlyViewedProductsFrontendComponents extends sfComponents
|
||||
{
|
||||
public function executeRecentlyViewedProducts()
|
||||
{
|
||||
$this->smarty = new stSmarty('stRecentlyViewedProductsFrontend');
|
||||
|
||||
$config = stConfig::getInstance(sfContext::getInstance(), 'stRecentlyViewedProductsBackend');
|
||||
|
||||
|
||||
if($config->get('enabled') != 1){
|
||||
|
||||
return sfView::NONE;
|
||||
}
|
||||
|
||||
if($config->get('show_in_product') != 1){
|
||||
|
||||
return sfView::NONE;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public function executeRecentlyViewedProductsSidebar()
|
||||
{
|
||||
$this->smarty = new stSmarty('stRecentlyViewedProductsFrontend');
|
||||
|
||||
$config = stConfig::getInstance(sfContext::getInstance(), 'stRecentlyViewedProductsBackend');
|
||||
|
||||
if($config->get('enabled') != 1){
|
||||
|
||||
return sfView::NONE;
|
||||
}
|
||||
|
||||
if($config->get('show_in_sidebar') != 1){
|
||||
|
||||
return sfView::NONE;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
<?php
|
||||
|
||||
$smarty->display('recently_viewed_products.html');
|
||||
@@ -0,0 +1,3 @@
|
||||
<?php
|
||||
|
||||
$smarty->display('recently_viewed_products_sidebar.html');
|
||||
@@ -0,0 +1,140 @@
|
||||
<?php
|
||||
|
||||
use_helper('stCurrency', 'stText', 'stProductImage', 'stUrl', 'stAvailability');
|
||||
sfLoader::loadHelpers('stProduct','stProduct');
|
||||
|
||||
st_theme_use_stylesheet('stProduct.css');
|
||||
|
||||
$results = array();
|
||||
|
||||
$smarty->assign("show_name", $config->get('show_name_other'));
|
||||
|
||||
$smarty->assign("show_image", $config->get('show_image_other'));
|
||||
|
||||
$smarty->assign("show_price", $config->get('show_price_other'));
|
||||
|
||||
$smarty->assign("show_old_price", $config->get('show_old_price_other'));
|
||||
|
||||
$smarty->assign("show_discount", $config->get('show_discount_other'));
|
||||
|
||||
$smarty->assign("show_basket", $config->get('show_basket_long'));
|
||||
|
||||
$smarty->assign("price_view", $config->get('price_view_other'));
|
||||
|
||||
$smarty->assign('button_type', $config->get('button_type_long'));
|
||||
|
||||
$photo_max_height = st_asset_thumbnail_setting('height', 'thumb');
|
||||
|
||||
$photo_max_width = st_asset_thumbnail_setting('width', 'small');
|
||||
|
||||
$cut_name = $config->get('cut_name_other');
|
||||
|
||||
$max_name_length = $config->get('cut_name_num_other');
|
||||
|
||||
foreach ($products as $index => $product)
|
||||
{
|
||||
$product_url = st_url_for('stProduct/show?url=' . $product->getFriendlyUrl());
|
||||
|
||||
$product_name = $product->getName();
|
||||
|
||||
$results[$index]['instance'] = $product;
|
||||
|
||||
if ($cut_name && st_check_strlen($product_name) > $max_name_length)
|
||||
{
|
||||
$results[$index]['name'] = '<span title="'.$product_name.'" class="hint">' . content_tag('a', st_truncate_text($product_name, $max_name_length, '...'), array('href' => $product_url, 'class' => 'product_name')) . "</span>";
|
||||
}
|
||||
else
|
||||
{
|
||||
$results[$index]['name'] = content_tag('a', $product_name, array('href' => $product_url, 'class' => 'product_name'));
|
||||
}
|
||||
|
||||
$results[$index]['id'] = $product->getId();
|
||||
|
||||
$results[$index]['photo'] = content_tag('a', st_product_image_tag($product, 'thumb'), array('href' => $product_url));
|
||||
|
||||
$results[$index]['photo_small'] = content_tag('a', st_product_image_tag($product, 'small'), array('href' => $product_url));
|
||||
|
||||
$results[$index]['photo_max_height'] = $photo_max_height;
|
||||
|
||||
// $results[$index]['uom'] = st_product_uom($product);
|
||||
|
||||
$results[$index]['stock'] = $product->getStock();
|
||||
|
||||
if ($product->isPriceVisible())
|
||||
{
|
||||
if ($config->get('show_uom_other') && $product->getUom())
|
||||
{
|
||||
$uom = " / ".$results[$index]['uom'];
|
||||
}else{
|
||||
$uom = "";
|
||||
}
|
||||
|
||||
$results[$index]['price'] = st_currency_format($product->getPriceBrutto(true)).$uom;
|
||||
|
||||
$results[$index]['price_net'] = st_currency_format($product->getPriceNetto(true)).$uom;
|
||||
|
||||
$results[$index]['price_brutto_pure'] = $product->getPriceBrutto(true).$uom;
|
||||
|
||||
$results[$index]['price_netto_pure'] = $product->getPriceNetto(true).$uom;
|
||||
|
||||
$currency = stCurrency::getInstance(sfContext::getInstance());
|
||||
|
||||
if ($currency->getFrontSymbol())
|
||||
{
|
||||
$results[$index]['currency'] = $currency->getFrontSymbol();
|
||||
}
|
||||
else
|
||||
{
|
||||
$results[$index]['currency'] = $currency->getBackSymbol();
|
||||
}
|
||||
|
||||
$old_price_brutto = $product->getOldPriceBrutto(true);
|
||||
|
||||
$results[$index]['check_old_price'] = $old_price_brutto != 0;
|
||||
|
||||
$results[$index]['old_price'] = st_currency_format($old_price_brutto);
|
||||
|
||||
$results[$index]['old_price_net'] = st_currency_format($product->getOldPriceNetto(true));
|
||||
|
||||
$results[$index]['discount'] = $product->getDiscountInPercent();
|
||||
|
||||
$results[$index]['basket'] = st_get_component('stBasket', 'add', array('product' => $product));
|
||||
|
||||
$results[$index]['check_price'] = false;
|
||||
|
||||
if ($config->get('show_basic_price_long') && $product->hasBasicPrice() && $product->getBasicPriceBrutto()!=0)
|
||||
{
|
||||
$results[$index]['basic_price'] = array(
|
||||
'netto' => st_currency_format($product->getBasicPriceNetto(true)),
|
||||
'brutto' => st_currency_format($product->getBasicPriceBrutto(true)),
|
||||
'quantity' => st_product_basic_price_quantity($product),
|
||||
'for_quantity' => st_product_basic_price_for_quantity($product),
|
||||
);
|
||||
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$results[$index]['check_price'] = true;
|
||||
}
|
||||
|
||||
$results[$index]['is_observe'] = stProductObservePluginListener::isObserveProduct($product->getId());
|
||||
|
||||
$results[$index]['name_without_link'] = $product_name;
|
||||
|
||||
$results[$index]['link'] = st_url_for('stProduct/show?url=' . $product->getFriendlyUrl());
|
||||
|
||||
$results[$index]['availability'] = st_availability_show($product);
|
||||
}
|
||||
|
||||
$smarty->assign('show_stock', $config->get('show_depository_long'));
|
||||
$smarty->assign('show_availability', $config->get('show_availability_long'));
|
||||
|
||||
$smarty->assign('results', $results);
|
||||
|
||||
$config_observe = stConfig::getInstance(sfContext::getInstance(), 'stProductObserveBackend');
|
||||
|
||||
$smarty->assign('is_observe_enabled', $config_observe->get('enabled'));
|
||||
|
||||
|
||||
$smarty->display('show_products_sidebar.html');
|
||||
@@ -0,0 +1,140 @@
|
||||
<?php
|
||||
|
||||
use_helper('stCurrency', 'stText', 'stProductImage', 'stUrl', 'stAvailability');
|
||||
sfLoader::loadHelpers('stProduct','stProduct');
|
||||
|
||||
st_theme_use_stylesheet('stProduct.css');
|
||||
|
||||
$results = array();
|
||||
|
||||
$smarty->assign("show_name", $config->get('show_name_other'));
|
||||
|
||||
$smarty->assign("show_image", $config->get('show_image_other'));
|
||||
|
||||
$smarty->assign("show_price", $config->get('show_price_other'));
|
||||
|
||||
$smarty->assign("show_old_price", $config->get('show_old_price_other'));
|
||||
|
||||
$smarty->assign("show_discount", $config->get('show_discount_other'));
|
||||
|
||||
$smarty->assign("show_basket", $config->get('show_basket_long'));
|
||||
|
||||
$smarty->assign("price_view", $config->get('price_view_other'));
|
||||
|
||||
$smarty->assign('button_type', $config->get('button_type_long'));
|
||||
|
||||
$photo_max_height = st_asset_thumbnail_setting('height', 'thumb');
|
||||
|
||||
$photo_max_width = st_asset_thumbnail_setting('width', 'small');
|
||||
|
||||
$cut_name = $config->get('cut_name_other');
|
||||
|
||||
$max_name_length = $config->get('cut_name_num_other');
|
||||
|
||||
foreach ($products as $index => $product)
|
||||
{
|
||||
$product_url = st_url_for('stProduct/show?url=' . $product->getFriendlyUrl());
|
||||
|
||||
$product_name = $product->getName();
|
||||
|
||||
$results[$index]['instance'] = $product;
|
||||
|
||||
if ($cut_name && st_check_strlen($product_name) > $max_name_length)
|
||||
{
|
||||
$results[$index]['name'] = '<span title="'.$product_name.'" class="hint">' . content_tag('a', st_truncate_text($product_name, $max_name_length, '...'), array('href' => $product_url, 'class' => 'product_name')) . "</span>";
|
||||
}
|
||||
else
|
||||
{
|
||||
$results[$index]['name'] = content_tag('a', $product_name, array('href' => $product_url, 'class' => 'product_name'));
|
||||
}
|
||||
|
||||
$results[$index]['id'] = $product->getId();
|
||||
|
||||
$results[$index]['photo'] = content_tag('a', st_product_image_tag($product, 'thumb'), array('href' => $product_url));
|
||||
|
||||
$results[$index]['photo_small'] = content_tag('a', st_product_image_tag($product, 'small'), array('href' => $product_url));
|
||||
|
||||
$results[$index]['photo_max_height'] = $photo_max_height;
|
||||
|
||||
// $results[$index]['uom'] = st_product_uom($product);
|
||||
|
||||
$results[$index]['stock'] = $product->getStock();
|
||||
|
||||
if ($product->isPriceVisible())
|
||||
{
|
||||
if ($config->get('show_uom_other') && $product->getUom())
|
||||
{
|
||||
$uom = " / ".$results[$index]['uom'];
|
||||
}else{
|
||||
$uom = "";
|
||||
}
|
||||
|
||||
$results[$index]['price'] = st_currency_format($product->getPriceBrutto(true)).$uom;
|
||||
|
||||
$results[$index]['price_net'] = st_currency_format($product->getPriceNetto(true)).$uom;
|
||||
|
||||
$results[$index]['price_brutto_pure'] = $product->getPriceBrutto(true).$uom;
|
||||
|
||||
$results[$index]['price_netto_pure'] = $product->getPriceNetto(true).$uom;
|
||||
|
||||
$currency = stCurrency::getInstance(sfContext::getInstance());
|
||||
|
||||
if ($currency->getFrontSymbol())
|
||||
{
|
||||
$results[$index]['currency'] = $currency->getFrontSymbol();
|
||||
}
|
||||
else
|
||||
{
|
||||
$results[$index]['currency'] = $currency->getBackSymbol();
|
||||
}
|
||||
|
||||
$old_price_brutto = $product->getOldPriceBrutto(true);
|
||||
|
||||
$results[$index]['check_old_price'] = $old_price_brutto != 0;
|
||||
|
||||
$results[$index]['old_price'] = st_currency_format($old_price_brutto);
|
||||
|
||||
$results[$index]['old_price_net'] = st_currency_format($product->getOldPriceNetto(true));
|
||||
|
||||
$results[$index]['discount'] = $product->getDiscountInPercent();
|
||||
|
||||
$results[$index]['basket'] = st_get_component('stBasket', 'add', array('product' => $product));
|
||||
|
||||
$results[$index]['check_price'] = false;
|
||||
|
||||
if ($config->get('show_basic_price_long') && $product->hasBasicPrice() && $product->getBasicPriceBrutto()!=0)
|
||||
{
|
||||
$results[$index]['basic_price'] = array(
|
||||
'netto' => st_currency_format($product->getBasicPriceNetto(true)),
|
||||
'brutto' => st_currency_format($product->getBasicPriceBrutto(true)),
|
||||
'quantity' => st_product_basic_price_quantity($product),
|
||||
'for_quantity' => st_product_basic_price_for_quantity($product),
|
||||
);
|
||||
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$results[$index]['check_price'] = true;
|
||||
}
|
||||
|
||||
$results[$index]['is_observe'] = stProductObservePluginListener::isObserveProduct($product->getId());
|
||||
|
||||
$results[$index]['name_without_link'] = $product_name;
|
||||
|
||||
$results[$index]['link'] = st_url_for('stProduct/show?url=' . $product->getFriendlyUrl());
|
||||
|
||||
$results[$index]['availability'] = st_availability_show($product);
|
||||
}
|
||||
|
||||
$smarty->assign('show_stock', $config->get('show_depository_long'));
|
||||
$smarty->assign('show_availability', $config->get('show_availability_long'));
|
||||
|
||||
$smarty->assign('results', $results);
|
||||
|
||||
$config_observe = stConfig::getInstance(sfContext::getInstance(), 'stProductObserveBackend');
|
||||
|
||||
$smarty->assign('is_observe_enabled', $config_observe->get('enabled'));
|
||||
|
||||
|
||||
$smarty->display('show_products.html');
|
||||
@@ -0,0 +1,30 @@
|
||||
<ul class="nav nav-tabs">
|
||||
<li class="active">
|
||||
<a rel="nofollow">{__ text="Ostatnio przeglądane produkty"}</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
</br>
|
||||
<div id="product-tab-recentyl-viewed">
|
||||
</div>
|
||||
|
||||
|
||||
{literal}
|
||||
<script type="text/javascript">
|
||||
//<![CDATA[
|
||||
jQuery(function($){
|
||||
|
||||
$(document).ready(function() {
|
||||
|
||||
$.get('{/literal}{url_for internal=stRecentlyViewedProductsFrontend/showProducts}{literal}', function(html)
|
||||
{
|
||||
setTimeout(function() {
|
||||
$('#product-tab-recentyl-viewed').html(html);
|
||||
}, 200); // 500 milisekund = 0,5 sekundy
|
||||
});
|
||||
|
||||
});
|
||||
});
|
||||
//]]>
|
||||
</script>
|
||||
{/literal}
|
||||
@@ -0,0 +1,54 @@
|
||||
<div class="sidebar-header">
|
||||
|
||||
<div class="sidebar-header-icon">
|
||||
<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M8.06319 2.02361C8.59412 2.14239 8.92975 2.67591 8.81283 3.21527L8.5656 4.35574C10.7546 2.8683 13.3873 2.00021 16.2187 2.00021C23.8299 2.00021 30 8.26818 30 16.0001C30 23.732 23.8299 30 16.2187 30C15.675 30 15.2343 29.5523 15.2343 29C15.2343 28.4477 15.675 28 16.2187 28C22.7426 28 28.0312 22.6275 28.0312 16.0001C28.0312 9.37274 22.7426 4.0002 16.2187 4.0002C13.6023 4.0002 11.1854 4.86352 9.22764 6.32633L10.4564 6.51094C10.9943 6.59174 11.3658 7.10013 11.2862 7.64647C11.2067 8.19281 10.7062 8.5702 10.1684 8.4894L6.84037 7.98941C6.57029 7.94883 6.32892 7.79613 6.17395 7.56779C6.01898 7.33944 5.96432 7.05598 6.02304 6.78511L6.89014 2.78514C7.00706 2.24579 7.53225 1.90484 8.06319 2.02361Z" fill="#5B5B5B"/>
|
||||
<path d="M15.621 21.8333C12.2765 21.8333 9.32758 19.3523 7.09969 16.8574L6.35381 17.5235L7.09969 16.8574C6.84563 16.5729 6.81816 16.1872 6.98954 15.9066C9.11106 12.4332 12.2868 10.5 15.621 10.5C18.8792 10.5 21.9839 12.3444 24.1037 15.6676C24.2591 15.9112 24.2601 16.2244 24.1034 16.472C21.9659 19.8483 18.8527 21.8333 15.621 21.8333Z" stroke="#5B5B5B" stroke-width="2" stroke-linejoin="round"/>
|
||||
<circle cx="15.5" cy="16" r="2.5" fill="#5B5B5B" stroke="#5B5B5B" stroke-width="2"/>
|
||||
</svg>
|
||||
</div>
|
||||
|
||||
{__ text="Ostatnio przeglądane produkty"}
|
||||
|
||||
<div id="remove-all-recentyl-container" style="float:right;"></div>
|
||||
|
||||
</div>
|
||||
<div id="product-tab-recentyl-viewed-sidebar">
|
||||
</div>
|
||||
|
||||
|
||||
{literal}
|
||||
<script type="text/javascript">
|
||||
//<![CDATA[
|
||||
jQuery(function($){
|
||||
|
||||
$(document).ready(function() {
|
||||
|
||||
showProductsSidebar();
|
||||
|
||||
$(document).on('click', '#remove-all-recentyl', function() {
|
||||
|
||||
$.get('{/literal}{url_for internal=stRecentlyViewedProductsFrontend/removeAll}{literal}', function(html)
|
||||
{
|
||||
setTimeout(function() {
|
||||
console.log("recentyl remove");
|
||||
showProductsSidebar();
|
||||
}, 200); // 500 milisekund = 0,5 sekundy
|
||||
});
|
||||
});
|
||||
|
||||
function showProductsSidebar()
|
||||
{
|
||||
$.get('{/literal}{url_for internal=stRecentlyViewedProductsFrontend/showProductsSidebar}{literal}', function(html)
|
||||
{
|
||||
setTimeout(function() {
|
||||
$('#product-tab-recentyl-viewed-sidebar').html(html);
|
||||
}, 200); // 500 milisekund = 0,5 sekundy
|
||||
});
|
||||
}
|
||||
|
||||
});
|
||||
});
|
||||
//]]>
|
||||
</script>
|
||||
{/literal}
|
||||
@@ -0,0 +1,96 @@
|
||||
<section id="product-recently-viewed" class="full-list product-list" >
|
||||
<div class="row" data-equalizer>
|
||||
{foreach key=row item=product from=$results}
|
||||
<div class="product col-xs-4 col-sm-4 col-md-3 col-lg-3">
|
||||
<div class="thumbnail clearfix view-img">
|
||||
|
||||
{if $is_observe_enabled }
|
||||
|
||||
<div class="product-observe {if $product.is_observe}observe-yes{else}observe-no{/if}" data-product-observe="{$product.id}">
|
||||
<svg width="23" height="21" viewBox="0 0 23 21" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M6.4592 1C3.44417 1 1 3.81598 1 7.28966C1 7.97227 1.09438 8.62947 1.26893 9.2449C1.71875 10.8309 2.96968 12.0161 4.1733 13.1426L11.5 20L18.8267 13.1426C20.0303 12.0161 21.2813 10.8309 21.7311 9.2449C21.9056 8.62947 22 7.97227 22 7.28966C22 3.81598 19.5558 1 16.5408 1C14.2698 1 12.3227 2.59762 11.5 4.87056C10.6773 2.59762 8.73018 1 6.4592 1Z" stroke-width="2" stroke-linejoin="round"/>
|
||||
</svg>
|
||||
</div>
|
||||
|
||||
{/if}
|
||||
|
||||
{if $show_image==1}<div data-equalizer-watch="image"><div class="image">{$product.photo_small}</div></div>{/if}
|
||||
<div class="text-center caption clearfix" data-equalizer-watch="info">
|
||||
<p class="name">{if $show_name==1}{$product.name}{/if}</p>
|
||||
|
||||
{if $show_availability}
|
||||
<div class="product-availability text-center">
|
||||
{$product.availability}
|
||||
{if $show_stock}
|
||||
({$product.stock} {$product.uom})
|
||||
{/if}
|
||||
</div>
|
||||
{elseif $show_stock}
|
||||
<div class="product-availability text-center">
|
||||
{__ text="Dostępność" langCatalogue="stAvailabilityFrontend"}: {$product.stock} {$product.uom}
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
{if $show_price==1 && $product.check_price!=1}
|
||||
{if $price_view=='net_gross'}
|
||||
<div class="double_price price">
|
||||
<span class="nowrap">{$product.price_net}</span>
|
||||
<div class="minor_price nowrap">({$product.price})</div>
|
||||
</div>
|
||||
{elseif $price_view=='only_gross'}
|
||||
<div class="price nowrap">{$product.price}</div>
|
||||
{elseif $price_view=='only_net'}
|
||||
<div class="price nowrap">{$product.price_net}</div>
|
||||
{elseif $price_view=='gross_net'}
|
||||
<div class="double_price price">
|
||||
<span class="nowrap">{$product.price}</span>
|
||||
<div class="minor_price nowrap">({$product.price_net})</div>
|
||||
</div>
|
||||
{/if}
|
||||
{if $product.basic_price}
|
||||
<div class="text-muted basic_price text-center"><i>{$product.basic_price.quantity} ( {$product.basic_price.brutto} {__ text="za"} {$product.basic_price.for_quantity} )</i></div>
|
||||
{/if}
|
||||
{/if}
|
||||
<div class="discount-old_price">
|
||||
{if $show_discount==1 && $product.discount!=0 && $product.check_price!=1}
|
||||
<div class="discount">{__ text="Rabat"}: <span class="nowrap">{$product.discount} %</span></div>
|
||||
{elseif ($show_old_price==1 && $product.check_price!=1)}
|
||||
{if $product.check_old_price==1}
|
||||
<div class="old_price price nowrap">
|
||||
{if ($price_view=='net_gross' || $price_view=='only_net')}
|
||||
{$product.old_price_net}
|
||||
{else}
|
||||
{$product.old_price}
|
||||
{/if}
|
||||
</div>
|
||||
{/if}
|
||||
{/if}
|
||||
</div>
|
||||
|
||||
|
||||
<div class="product-shopping-cart">
|
||||
{if $button_type == 'basket'}
|
||||
{if $show_price==1 && $show_basket==1}
|
||||
{basket_add_link product=$product.instance namespace="product_recommend_card"}
|
||||
{/if}
|
||||
{else}
|
||||
<a class="btn btn-shopping-cart" href="{$product.link}">{__ text="Sprawdź"}</a>
|
||||
{/if}
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{/foreach}
|
||||
</div>
|
||||
</section>
|
||||
|
||||
{literal}
|
||||
<script type="text/javascript">
|
||||
jQuery(function($) {
|
||||
$(document).ready(function() {
|
||||
$('#product-recently-viewed [data-equalizer]').equalizer({ use_tallest: true });
|
||||
});
|
||||
});
|
||||
</script>
|
||||
{/literal}
|
||||
@@ -0,0 +1,106 @@
|
||||
<section id="product-recently-viewed-sidebar" class="product-list" >
|
||||
|
||||
{foreach key=row item=product from=$results}
|
||||
|
||||
<div class="row">
|
||||
|
||||
<div class="col-sm-2 item-image-col">
|
||||
<div class="image">{$product.photo_small}</div>
|
||||
</div>
|
||||
|
||||
<div class="col-sm-10">
|
||||
|
||||
<a class="close-icon" data-product="{$product.id}" style="float:right;"></a>
|
||||
|
||||
{$product.name}
|
||||
|
||||
{if $show_price==1 && $product.check_price!=1}
|
||||
{if $price_view=='net_gross'}
|
||||
<div class="double_price price">
|
||||
<span class="nowrap">{$product.price_net}</span>
|
||||
<div class="minor_price nowrap">({$product.price})</div>
|
||||
</div>
|
||||
{elseif $price_view=='only_gross'}
|
||||
<div class="price nowrap">{$product.price}</div>
|
||||
{elseif $price_view=='only_net'}
|
||||
<div class="price nowrap">{$product.price_net}</div>
|
||||
{elseif $price_view=='gross_net'}
|
||||
<div class="double_price price">
|
||||
<span class="nowrap">{$product.price}</span>
|
||||
<div class="minor_price nowrap">({$product.price_net})</div>
|
||||
</div>
|
||||
{/if}
|
||||
{if $product.basic_price}
|
||||
<div class="text-muted basic_price text-center"><i>{$product.basic_price.quantity} ( {$product.basic_price.brutto} {__ text="za"} {$product.basic_price.for_quantity} )</i></div>
|
||||
{/if}
|
||||
{/if}
|
||||
|
||||
<div class="discount-old_price">
|
||||
{if $show_discount==1 && $product.discount!=0 && $product.check_price!=1}
|
||||
<div class="discount">{__ text="Rabat"}: <span class="nowrap">{$product.discount} %</span></div>
|
||||
{elseif ($show_old_price==1 && $product.check_price!=1)}
|
||||
{if $product.check_old_price==1}
|
||||
<div class="old_price price nowrap">
|
||||
{if ($price_view=='net_gross' || $price_view=='only_net')}
|
||||
{$product.old_price_net}
|
||||
{else}
|
||||
{$product.old_price}
|
||||
{/if}
|
||||
</div>
|
||||
{/if}
|
||||
{/if}
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
{/foreach}
|
||||
|
||||
{if $results|@count >= 2}
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
<div id="remove-all-recentyl" class="sidebar-header-trash">
|
||||
{__ text="Usuń wszystko"} <span class="glyphicon glyphicon-trash"></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
</section>
|
||||
|
||||
{literal}
|
||||
<script type="text/javascript">
|
||||
jQuery(function($) {
|
||||
$(document).ready(function() {
|
||||
|
||||
|
||||
$('#product-recently-viewed-sidebar .close-icon').on('click', function(e){
|
||||
|
||||
e.preventDefault(); // Zapobiega domyślnej akcji (nawigacji do strony linka)
|
||||
let productValue = $(this).data('product');
|
||||
let row = $(this).closest('.row');
|
||||
|
||||
$.get('{/literal}{url_for internal=stRecentlyViewedProductsFrontend/removeProduct}{literal}', { 'product_id':productValue}, function(data)
|
||||
{
|
||||
setTimeout(function() {
|
||||
row.remove();
|
||||
|
||||
$.get('{/literal}{url_for internal=stRecentlyViewedProductsFrontend/showProductsSidebar}{literal}', function(html)
|
||||
{
|
||||
setTimeout(function() {
|
||||
$('#product-tab-recentyl-viewed-sidebar').html(html);
|
||||
}, 200); // 500 milisekund = 0,5 sekundy
|
||||
|
||||
});
|
||||
|
||||
}, 200); // 500 milisekund = 0,5 sekundy
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
});
|
||||
</script>
|
||||
{/literal}
|
||||
Reference in New Issue
Block a user