Merge branch 'ticket-8048'
This commit is contained in:
commit
e6fdac5dbe
@ -7,7 +7,7 @@
|
||||
<li>
|
||||
<div class="hover-slide">
|
||||
<a onclick="showExpressCart(event); return false;" class="add-to-cart ajax_add_to_cart_product_footer_button" rel="{$product.id_product}" href="" title="{l s='Add to cart' mod='blockbestsellers'}"></a>
|
||||
<a class="see-product" href="{$product.link}" title="{l s='See this product' mod='blockbestsellers'}"></a>
|
||||
<a class="see-product" href="{$product.link}" target="_blank" title="{l s='See this product' mod='blockbestsellers'}"></a>
|
||||
</div>
|
||||
<div class="product_added product_added_{$product.id_product}">
|
||||
<p>{l s='Product added to your cart' mod='blockbestsellers'}</p>
|
||||
@ -73,7 +73,7 @@
|
||||
error: function(XMLHttpRequest, textStatus, errorThrown)
|
||||
{
|
||||
alert("TECHNICAL ERROR: unable to add the product.\n\nDetails:\nError thrown: " + XMLHttpRequest + "\n" + 'Text status: ' + textStatus);
|
||||
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -7,7 +7,7 @@
|
||||
<li class='slide-item'>
|
||||
<div class="hover-slide">
|
||||
<a onclick="showExpressCart(event); return false;" class="add-to-cart ajax_add_to_cart_product_footer_button" rel="{$product.id_product}" href="" title="{l s='Add to cart' mod='blockbestsellers'}"></a>
|
||||
<a class="see-product" href="{$product.link}" title="{l s='See this product' mod='blockbestsellers'}"></a>
|
||||
<a class="see-product" href="{$product.link}" target="_blank" title="{l s='See this product' mod='blockbestsellers'}"></a>
|
||||
</div>
|
||||
<div class="product_added product_added_{$product.id_product}">
|
||||
<p>{l s='Product added to your cart' mod='blockbestsellers'}</p>
|
||||
@ -73,7 +73,7 @@
|
||||
error: function(XMLHttpRequest, textStatus, errorThrown)
|
||||
{
|
||||
alert("TECHNICAL ERROR: unable to add the product.\n\nDetails:\nError thrown: " + XMLHttpRequest + "\n" + 'Text status: ' + textStatus);
|
||||
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -7,7 +7,7 @@
|
||||
<li>
|
||||
<div class="hover-slide">
|
||||
<a onclick="showExpressCart(event); return false;" class="add-to-cart ajax_add_to_cart_product_footer_button" rel="{$product.id_product}" href="" title="{l s='Add to cart' mod='blockbestsellers'}"></a>
|
||||
<a class="see-product" href="{$product.link}" title="{l s='See this product' mod='blockbestsellers'}"></a>
|
||||
<a class="see-product" href="{$product.link}" target="_blank" title="{l s='See this product' mod='blockbestsellers'}"></a>
|
||||
</div>
|
||||
<div class="product_added product_added_{$product.id_product}">
|
||||
<p>{l s='Product added to your cart' mod='blockbestsellers'}</p>
|
||||
@ -73,7 +73,7 @@
|
||||
error: function(XMLHttpRequest, textStatus, errorThrown)
|
||||
{
|
||||
alert("TECHNICAL ERROR: unable to add the product.\n\nDetails:\nError thrown: " + XMLHttpRequest + "\n" + 'Text status: ' + textStatus);
|
||||
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -1,4 +1,5 @@
|
||||
<script type="text/javascript">
|
||||
|
||||
{literal}
|
||||
|
||||
function hideExpressCart(event){
|
||||
@ -15,18 +16,32 @@ function hideExpressCart(event){
|
||||
|
||||
function showExpressCart(event) {
|
||||
var m = $(event.target);
|
||||
var expresscart_frame_visible = m.parents('.slider_sales_product_footer').next('.expresscart_frame:visible');
|
||||
var expresscart_frame = m.parents('.slider_sales_product_footer').next('.expresscart_frame');
|
||||
|
||||
m.toggleClass('active');
|
||||
|
||||
if($(".expresscart_frame:visible").length > 0) {
|
||||
var height = m.parents('.slider_sales_product_footer').height();
|
||||
|
||||
if (height < $('#product .expresscart_frame').height()) {
|
||||
height = $('#product .expresscart_frame').height();
|
||||
}
|
||||
|
||||
$('#product .expresscart_frame').height(height);
|
||||
$('#product .expresscart_frame .loading').height(height);
|
||||
|
||||
if(expresscart_frame_visible.length > 0) {
|
||||
m.removeClass('active');
|
||||
hideFooterExpressCart();
|
||||
} else {
|
||||
$(".expresscart_frame").slideDown(function() {
|
||||
if($(".expresscart_frame").children("p.loading").length > 0) {
|
||||
expresscart_frame.slideDown(function() {
|
||||
if(expresscart_frame.children("p.loading").length > 0) {
|
||||
var id_product = m.parent().children(".ajax_add_to_cart_product_footer_button").attr("rel");
|
||||
$(".expresscart_frame").append("<iframe src=\"{/literal}{$base_dir_ssl}{literal}modules/expresscart/ajax.php?page=1&id_product=" + id_product + "\" style=\"display: none;\" border=\"0\" marginheight=\"0\" marginwidth=\"0\" frameborder=\"0\" onload=\"$(this).show(); $(this).parent().children('p.loading').remove();\"></iframe>");
|
||||
expresscart_frame.append("<iframe src=\"{/literal}{$base_dir_ssl}{literal}modules/expresscart/ajax.php?page=1&id_product=" + id_product + "\" style=\"display: none;\" border=\"0\" marginheight=\"0\" marginwidth=\"0\" frameborder=\"0\" onload=\"$(this).show(); $(this).parent().children('p.loading').remove();\"></iframe>");
|
||||
|
||||
$('#product .expresscart_frame iframe').height(height);
|
||||
}
|
||||
$(".expresscart_frame").append('<a href="#" class="close_popup_footer"></a>');
|
||||
expresscart_frame.append('<a href="#" class="close_popup_footer"></a>');
|
||||
|
||||
$('a.close_popup_footer').click(function() {
|
||||
$(this).remove();
|
||||
@ -38,6 +53,7 @@ function showExpressCart(event) {
|
||||
$("html").bind("click", {m: m}, hideExpressCart);
|
||||
});
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -388,6 +388,9 @@
|
||||
var uploading_in_progress = '{l s='Uploading in progress, please wait...' mod='expresscart' js=1}';
|
||||
var fieldRequired = '{l s='Please fill in all required fields, then save the customization.' mod='expresscart' js=1}';
|
||||
|
||||
var quantityAvailableSentence = '{l s='Warning: X items in stock!' mod='expresscart' js=1}';
|
||||
var oneQuantityAvailableSentence = '{l s='Warning: 1 item in stock!' mod='expresscart' js=1}';
|
||||
|
||||
{if isset($groups)}
|
||||
// Combinations
|
||||
{foreach from=$combinations key=idCombination item=combination}
|
||||
|
@ -441,6 +441,9 @@
|
||||
var uploading_in_progress = '{l s='Uploading in progress, please wait...' mod='expresscart' js=1}';
|
||||
var fieldRequired = '{l s='Please fill in all required fields, then save the customization.' mod='expresscart' js=1}';
|
||||
|
||||
var quantityAvailableSentence = '{l s='Warning: X items in stock!' mod='expresscart' js=1}';
|
||||
var oneQuantityAvailableSentence = '{l s='Warning: 1 item in stock!' mod='expresscart' js=1}';
|
||||
|
||||
{if isset($groups)}
|
||||
// Combinations
|
||||
{foreach from=$combinations key=idCombination item=combination}
|
||||
|
136
modules/privatesales_similarproducts/front_similarproducts.tpl
Normal file
136
modules/privatesales_similarproducts/front_similarproducts.tpl
Normal file
@ -0,0 +1,136 @@
|
||||
<div id="privatesales_similarproduct">
|
||||
{if $ps_other_products|@count > 0}
|
||||
<div class='slider_sales_product_footer'>
|
||||
<ul>
|
||||
{foreach from=$ps_other_products item=product}
|
||||
<li>
|
||||
|
||||
<div class="hover-slide">
|
||||
<a onclick="showExpressCart(event); return false;" class="add-to-cart ajax_add_to_cart_product_footer_button" rel="{$product.id_product}" href="" title="{l s='Add to cart' mod='privatesales_similarproducts'}"></a>
|
||||
<a class="see-product" href="{$product.link}" target="_blank" title="{l s='See this product' mod='privatesales_similarproducts'}"></a>
|
||||
</div>
|
||||
<div class="product_added product_added_{$product.id_product}">
|
||||
<p>{l s='Product added to your cart' mod='privatesales_similarproducts'}</p>
|
||||
</div>
|
||||
|
||||
<div class="similar_product">
|
||||
<div class="product_sellers_label">
|
||||
<span class="product_link_sellers">{$product.name}</span>
|
||||
</div>
|
||||
<div class="img_sellers">
|
||||
<img src="{$link->getImageLink($product.link_rewrite, $product.id_image, 'medium')}" alt="{$product.legend|escape:'htmlall':'UTF-8'}" />
|
||||
</div>
|
||||
<div class="info_sellers">
|
||||
<p class="price">{$product.price}</p>
|
||||
<p class="price_info">
|
||||
<span class="old_price">{convertPrice price=$product.price_without_reduction}</span>
|
||||
{if $product.specific_prices.reduction_type =='percentage'}
|
||||
{assign var="reduc_value" value=$product.specific_prices.reduction * 100}
|
||||
<span class="percentage">(-{$reduc_value|intval}%)</span>
|
||||
{elseif $product.specific_prices.reduction_type == 'amount'}
|
||||
<span class="amount">(-{$product.specific_prices.reduction|number_format:2:",":"."}€)</span>
|
||||
{/if}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
{/foreach}
|
||||
</ul>
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
<script>
|
||||
{literal}
|
||||
$(document).ready(function(){
|
||||
var frame = $('#privatesales_similarproduct .slider_sales_product_footer');
|
||||
var list_items = frame.find('ul');
|
||||
var nb_items = list_items.find('li').length;
|
||||
|
||||
if (nb_items>3) {
|
||||
|
||||
// adjust css
|
||||
frame.css({
|
||||
'overflow': 'hidden',
|
||||
'margin-left':'51px',
|
||||
'width':'800px',
|
||||
});
|
||||
list_items.css({
|
||||
'padding-left':'10px',
|
||||
});
|
||||
list_items.find('li').css({
|
||||
'width':'252px',
|
||||
'margin-left':'0px',
|
||||
});
|
||||
list_items.find('li').find('.similar_product').css({
|
||||
'width':'auto',
|
||||
});
|
||||
// prepare parameters
|
||||
var animation_options = {
|
||||
'duration':500,
|
||||
'esaing': 'linear'
|
||||
};
|
||||
var state_scroll = {
|
||||
'nb_items': nb_items,
|
||||
'cpt_item' : 0,
|
||||
'step': 2
|
||||
}
|
||||
|
||||
var item = $(list_items.find('li')[0]);
|
||||
var item_width = 0;
|
||||
var margin_width;
|
||||
|
||||
// outWidth is supposed to include margin... However sometimes only margin width is return...
|
||||
if (item.outerWidth(true) < item.outerWidth(false)) {
|
||||
item_width = item.outerWidth(false);
|
||||
margin_width = item.outerWidth(true);
|
||||
item_width += margin_width;
|
||||
}
|
||||
else {
|
||||
item_width = item.outerWidth(true);
|
||||
margin_width = 0;
|
||||
}
|
||||
|
||||
// add the margin with the new width to ensure the listitem width is large enough
|
||||
list_items.width(nb_items * item_width + margin_width*2);
|
||||
|
||||
// add navigation arrows
|
||||
frame.append('<div class="ico_prev"></div><div class="ico_next"></div>');
|
||||
|
||||
frame.find('.ico_prev')
|
||||
.css({
|
||||
'position':'absolute',
|
||||
'left':'0px',
|
||||
'top':'100px',
|
||||
'z-index':'10'
|
||||
})
|
||||
.hover(function(ev) {
|
||||
$(ev.target).css('cursor', 'pointer');
|
||||
})
|
||||
.click(function(ev){
|
||||
if (state_scroll.cpt_item>0) {
|
||||
list_items.animate({'left':'+='+(10+item_width*state_scroll.step)}, animation_options);
|
||||
state_scroll.cpt_item -= state_scroll.step;
|
||||
}
|
||||
});
|
||||
|
||||
frame.find('.ico_next')
|
||||
.css({
|
||||
'position':'absolute',
|
||||
'right':'0px',
|
||||
'top':'100px',
|
||||
'z-index':'10'
|
||||
})
|
||||
.hover(function(ev) {
|
||||
$(ev.target).css('cursor', 'pointer');
|
||||
})
|
||||
.click(function(ev){
|
||||
console.log(item_width*state_scroll.step);
|
||||
if (state_scroll.cpt_item<(state_scroll.nb_items-state_scroll.step)) {
|
||||
list_items.animate({'left':'-='+(10+item_width*state_scroll.step)}, animation_options);
|
||||
state_scroll.cpt_item += state_scroll.step;
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
{/literal}
|
||||
</script>
|
36
modules/privatesales_similarproducts/index.php
Executable file
36
modules/privatesales_similarproducts/index.php
Executable file
@ -0,0 +1,36 @@
|
||||
<?php
|
||||
/*
|
||||
* 2007-2011 PrestaShop
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Open Software License (OSL 3.0)
|
||||
* that is bundled with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://opensource.org/licenses/osl-3.0.php
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@prestashop.com so we can send you a copy immediately.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||
* versions in the future. If you wish to customize PrestaShop for your
|
||||
* needs please refer to http://www.prestashop.com for more information.
|
||||
*
|
||||
* @author PrestaShop SA <contact@prestashop.com>
|
||||
* @copyright 2007-2011 PrestaShop SA
|
||||
* @version Release: $Revision: 7233 $
|
||||
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*/
|
||||
|
||||
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
|
||||
header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
|
||||
|
||||
header("Cache-Control: no-store, no-cache, must-revalidate");
|
||||
header("Cache-Control: post-check=0, pre-check=0", false);
|
||||
header("Pragma: no-cache");
|
||||
|
||||
header("Location: ../");
|
||||
exit;
|
BIN
modules/privatesales_similarproducts/logo.gif
Executable file
BIN
modules/privatesales_similarproducts/logo.gif
Executable file
Binary file not shown.
After Width: | Height: | Size: 3.7 KiB |
247
modules/privatesales_similarproducts/privatesales_similarproducts.php
Executable file
247
modules/privatesales_similarproducts/privatesales_similarproducts.php
Executable file
@ -0,0 +1,247 @@
|
||||
<?php
|
||||
if (!defined('_PS_VERSION_'))
|
||||
exit;
|
||||
|
||||
class Privatesales_similarproducts extends Module
|
||||
{
|
||||
const HAS_ACCESSORIES_UNKNOWN = 0;
|
||||
const HAS_ACCESSORIES_YES = 1;
|
||||
const HAS_ACCESSORIES_NO = 2;
|
||||
|
||||
private $has_accessories_state = self::HAS_ACCESSORIES_UNKNOWN;
|
||||
private $family = null;
|
||||
private $label = '';
|
||||
|
||||
private $hooks = array(
|
||||
'similarProduct' => array('Accessories or similar products', 'Called on displaying similar product in product details'),
|
||||
'simlarProductTabLabel' => array('Tab labl accessories or similar products', 'Called on displaying tab in product details'
|
||||
)
|
||||
);
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->name = 'privatesales_similarproducts';
|
||||
$this->tab = 'front_office_features';
|
||||
$this->version = '1.0';
|
||||
$this->author = 'Antadis';
|
||||
$this->need_instance = 0;
|
||||
|
||||
parent::__construct();
|
||||
|
||||
$this->displayName = $this->l('Produits complémentaires ou similaires');
|
||||
$this->description = $this->l('Ajoute un bloc affichant les produits complémentaires (accessoires) ou les meilleures ventes de la famille d\'un produit.');
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ModuleCore::install()
|
||||
*/
|
||||
public function install()
|
||||
{
|
||||
// Add custom hooks
|
||||
foreach($this->hooks as $k => $v) {
|
||||
if(count(Db::getInstance()->ExecuteS('
|
||||
SELECT `id_hook`
|
||||
FROM `'._DB_PREFIX_.'hook`
|
||||
WHERE `name` = "'.$k.'"
|
||||
LIMIT 1
|
||||
')) == 0) {
|
||||
Db::getInstance()->ExecuteS('
|
||||
INSERT INTO `'._DB_PREFIX_.'hook`
|
||||
VALUES (DEFAULT, "'.$k.'", "'.$v[0].'", "'.$v[1].'", 0, 0)
|
||||
');
|
||||
}
|
||||
}
|
||||
|
||||
$install_success = parent::install();
|
||||
if ($install_success) {
|
||||
foreach($this->hooks as $k => $v) {
|
||||
$install_success = $this->registerHook($k);
|
||||
if (!$install_success) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!$install_success) {
|
||||
$this->uninstall();
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public function uninstall()
|
||||
{
|
||||
// Remove custom hooks
|
||||
foreach($this->hooks as $k => $v) {
|
||||
Db::getInstance()->Execute('
|
||||
DELETE FROM `'._DB_PREFIX_.'hook`
|
||||
WHERE `name` = "'.$k.'"
|
||||
');
|
||||
}
|
||||
parent::uninstall();
|
||||
}
|
||||
|
||||
public function hookSimilarProduct($params)
|
||||
{
|
||||
if(_PS_MOBILE_) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$this->initFromHook($params);
|
||||
|
||||
if ($this->has_accessories_state == self::HAS_ACCESSORIES_YES) {
|
||||
return $this->displayAccessories($params);
|
||||
}
|
||||
|
||||
if ($this->has_accessories_state == self::HAS_ACCESSORIES_NO) {
|
||||
return $this->displayBestVPSalesSameFamily($params);
|
||||
}
|
||||
return '';
|
||||
}
|
||||
|
||||
public function hookSimlarProductTabLabel($params)
|
||||
{
|
||||
if(_PS_MOBILE_) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$this->initFromHook($params);
|
||||
return $this->label;
|
||||
}
|
||||
|
||||
private function initFromHook(array &$params)
|
||||
{
|
||||
if ($this->has_accessories_state != self::HAS_ACCESSORIES_UNKNOWN) {
|
||||
return;
|
||||
}
|
||||
|
||||
$query = '
|
||||
SELECT COUNT(`id_product_2`)
|
||||
FROM `'._DB_PREFIX_.'accessory`
|
||||
JOIN `'._DB_PREFIX_.'product` p ON p.`id_product` = `id_product_2`
|
||||
WHERE `id_product_1` = '.(int)$params['product']->id.'
|
||||
AND p.`active` = 1
|
||||
';
|
||||
|
||||
if (Db::getInstance()->getValue($query)>0) {
|
||||
$this->has_accessories_state = self::HAS_ACCESSORIES_YES;
|
||||
$this->label = $this->l('Produits complémentaires');
|
||||
}
|
||||
else {
|
||||
$this->has_accessories_state = self::HAS_ACCESSORIES_NO;
|
||||
$this->family = ProductSale::getSaleFamily(
|
||||
$params['sale']->id,
|
||||
$params['cookie']->id_lang
|
||||
);
|
||||
if (!empty($this->family)) {
|
||||
$bestsellers = ProductSale::getFamilyBestSales($this->family['id_category_family'], $params['cookie']->id_lang,3, 10,$params['product']->id);
|
||||
//$this->label = $this->l('Autres produits dans').' '.$this->family['name'];
|
||||
if(is_array($bestsellers) && !empty($bestsellers)) {
|
||||
$this->label = $this->l('À découvrir');
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private function displayAccessories($params)
|
||||
{
|
||||
global $smarty;
|
||||
|
||||
$cache_id = (int)$params['cookie']->id_lang.'_'.(int)$params['product']->id;
|
||||
|
||||
if (!$this->isTemplateCached($cache_id)) {
|
||||
$other_products = array();
|
||||
|
||||
$accessories = $params['product']->getAccessories($params['cookie']->id_lang);
|
||||
if(is_array($accessories)) {
|
||||
|
||||
$currency = new Currency((int)($params['cookie']->id_currency));
|
||||
|
||||
foreach ($accessories AS $accessory)
|
||||
{
|
||||
$accessory['price'] = Tools::displayPrice(Product::getPriceStatic((int)($accessory['id_product'])), $currency);
|
||||
$other_products[] = $accessory;
|
||||
}
|
||||
}
|
||||
|
||||
if (empty($other_products)) {
|
||||
return '';
|
||||
}
|
||||
|
||||
$smarty->assign(
|
||||
array(
|
||||
'label' => $this->label,
|
||||
'ps_other_products' => $other_products,
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
return $this->flushTemplateCache($cache_id);
|
||||
}
|
||||
|
||||
|
||||
private function displayBestVPSalesSameFamily($params)
|
||||
{
|
||||
global $smarty;
|
||||
|
||||
$cache_id = (int)$params['cookie']->id_lang.'_'.(int)$params['product']->id;
|
||||
|
||||
if (!$this->isTemplateCached($cache_id)) {
|
||||
$currency = new Currency((int)($params['cookie']->id_currency));
|
||||
|
||||
// get all best sales of the product family
|
||||
$other_products = array();
|
||||
|
||||
$bestsellers = ProductSale::getFamilyBestSales(
|
||||
$this->family['id_category_family'],
|
||||
$params['cookie']->id_lang,
|
||||
3, 10,
|
||||
$params['product']->id
|
||||
);
|
||||
|
||||
if(is_array($bestsellers)) {
|
||||
foreach ($bestsellers AS $bestseller) {
|
||||
$bestseller['price'] = Tools::displayPrice(Product::getPriceStatic((int)($bestseller['id_product'])), $currency);
|
||||
$other_products[] = $bestseller;
|
||||
}
|
||||
}
|
||||
|
||||
if (empty($other_products)) {
|
||||
return '';
|
||||
}
|
||||
|
||||
$smarty->assign(
|
||||
array(
|
||||
'label' => $this->label,
|
||||
'ps_other_products' => $other_products,
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
return $this->flushTemplateCache($cache_id);
|
||||
|
||||
}
|
||||
|
||||
private function isTemplateCached(&$cache_id)
|
||||
{
|
||||
global $smarty;
|
||||
|
||||
Tools::enableCache();
|
||||
$smarty->cache_lifetime = 3600;
|
||||
|
||||
return $this->isCached('front_similarproducts.tpl', $cache_id);
|
||||
}
|
||||
|
||||
private function flushTemplateCache($cache_id)
|
||||
{
|
||||
global $smarty;
|
||||
|
||||
$display = $this->display(__FILE__, 'front_similarproducts.tpl', $cache_id);
|
||||
Tools::restoreCacheSettings();
|
||||
$smarty->cache_lifetime = -1;
|
||||
return $display;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -27,7 +27,7 @@ class ProductSale extends ProductSaleCore
|
||||
|
||||
$sale_product = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS('
|
||||
SELECT
|
||||
DISTINCT(p.id_product),
|
||||
DISTINCT(p.id_product), p.`out_of_stock`, p.`id_category_default`, p.`ean13`,
|
||||
pl.`description`, pl.`description_short`, pl.`link_rewrite`, pl.`meta_description`, pl.`meta_keywords`, pl.`meta_title`, pl.`name`, m.`name` AS manufacturer_name, p.`id_manufacturer` as id_manufacturer,
|
||||
i.`id_image`, il.`legend`,
|
||||
ps.`quantity` AS sales, t.`rate`, pl.`meta_keywords`, pl.`meta_title`, pl.`meta_description`,
|
||||
@ -108,4 +108,115 @@ class ProductSale extends ProductSaleCore
|
||||
';
|
||||
return $sales = Db::getInstance()->ExecuteS($query);
|
||||
}
|
||||
|
||||
|
||||
public static function getSaleFamily(
|
||||
$id_sale,
|
||||
$id_lang
|
||||
)
|
||||
{
|
||||
$query = '
|
||||
SELECT DISTINCT a.`id_category_family`, c.`name`
|
||||
FROM `'._DB_PREFIX_.'category_family_association` a
|
||||
JOIN `'._DB_PREFIX_.'category_family_lang` c ON c.`id_category_family` = a.`id_category_family`
|
||||
JOIN `'._DB_PREFIX_.'privatesale_category` b ON b.`id_category` = a.`id_category`
|
||||
WHERE b.`id_sale` = '.pSql($id_sale).'
|
||||
AND c.`id_lang` = '.pSql($id_lang);
|
||||
return Db::getInstance()->getRow($query);
|
||||
}
|
||||
|
||||
|
||||
public static function getFamilyBestSales(
|
||||
$id_category_family,
|
||||
$id_lang,
|
||||
$nb_products_max = 3,
|
||||
$filter_price=0,
|
||||
$exclude_id_product
|
||||
)
|
||||
{
|
||||
if ($nb_products_max < 1) {
|
||||
$nb_products_max = 3;
|
||||
}
|
||||
|
||||
$categories = self::_getPrivateSalesCategoriesOfFamily($id_category_family);
|
||||
if (empty($categories)) {
|
||||
return [];
|
||||
}
|
||||
|
||||
$query = '
|
||||
SELECT
|
||||
DISTINCT(p.`id_product`), p.`out_of_stock`, p.`id_category_default`, p.`ean13`,
|
||||
|
||||
pl.`description`, pl.`description_short`, pl.`link_rewrite`, pl.`meta_description`, pl.`meta_keywords`, pl.`meta_title`, pl.`name`,
|
||||
m.`name` AS manufacturer_name,
|
||||
p.`id_manufacturer` AS id_manufacturer,
|
||||
i.`id_image`, il.`legend`,
|
||||
ps.`quantity` AS sales,
|
||||
t.`rate`,
|
||||
pl.`meta_keywords`, pl.`meta_title`, pl.`meta_description`,
|
||||
DATEDIFF(p.`date_add`, DATE_SUB(NOW(), INTERVAL '.(Validate::isUnsignedInt(Configuration::get('PS_NB_DAYS_NEW_PRODUCT')) ? Configuration::get('PS_NB_DAYS_NEW_PRODUCT') : 20).' DAY)) > 0 AS new
|
||||
FROM `'._DB_PREFIX_.'product` p
|
||||
JOIN `'._DB_PREFIX_.'product_sale` ps ON (ps.`id_product` = p.`id_product`)
|
||||
JOIN `'._DB_PREFIX_.'category_product` cp ON (cp.`id_product` = p.`id_product`)
|
||||
JOIN `'._DB_PREFIX_.'category_family_association` cfa ON cfa.id_category = cp.id_category
|
||||
JOIN `'._DB_PREFIX_.'product_lang` pl ON (p.`id_product` = pl.`id_product` AND pl.`id_lang` = '.(int)($id_lang).')
|
||||
LEFT JOIN `'._DB_PREFIX_.'image` i ON (i.`id_product` = p.`id_product` AND i.`cover` = 1)
|
||||
LEFT JOIN `'._DB_PREFIX_.'image_lang` il ON (i.`id_image` = il.`id_image` AND il.`id_lang` = '.(int)($id_lang).')
|
||||
LEFT JOIN `'._DB_PREFIX_.'manufacturer` m ON (m.`id_manufacturer` = p.`id_manufacturer`)
|
||||
LEFT JOIN `'._DB_PREFIX_.'tax_rule` tr ON (p.`id_tax_rules_group` = tr.`id_tax_rules_group`
|
||||
AND tr.`id_country` = '.(int)Country::getDefaultCountryId().'
|
||||
AND tr.`id_state` = 0)
|
||||
LEFT JOIN `'._DB_PREFIX_.'tax` t ON (t.`id_tax` = tr.`id_tax`)
|
||||
WHERE p.`active` = 1
|
||||
AND p.`quantity` > 0
|
||||
AND cp.`id_category` IN ('. pSql(implode(',', array_column($categories, 'id_category'))).')
|
||||
AND cfa.`id_category_family` = '.(int)$id_category_family.'
|
||||
AND p.`id_product` <> '.(int)$exclude_id_product.'
|
||||
ORDER BY sales DESC
|
||||
';
|
||||
$best_sale_products = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS($query);
|
||||
|
||||
if (empty($best_sale_products)) {
|
||||
return [];
|
||||
}
|
||||
|
||||
$filtered_best_sale_products = array();
|
||||
|
||||
foreach ($best_sale_products as $product) {
|
||||
$properties = Product::getProductProperties($id_lang, $product, false);
|
||||
if (isset($filter_price) && is_int($filter_price) && $properties['price']<$filter_price) {
|
||||
continue;
|
||||
}
|
||||
if ($nb_products_max==0) {
|
||||
break;
|
||||
}
|
||||
$filtered_best_sale_products[] = $properties;
|
||||
$nb_products_max--;
|
||||
}
|
||||
|
||||
return $filtered_best_sale_products;
|
||||
}
|
||||
|
||||
/**
|
||||
* display all categories (parents/children) having opened private sales the current version (lang)
|
||||
* and for the given family
|
||||
*/
|
||||
private static function _getPrivateSalesCategoriesOfFamily($id_category_family)
|
||||
{
|
||||
global $site_version_front;
|
||||
|
||||
$query = '
|
||||
SELECT `sale_cat`.`id_category`
|
||||
FROM `'._DB_PREFIX_.'privatesale_category` `sale_cat`
|
||||
JOIN `'._DB_PREFIX_.'privatesale` `sale` ON `sale`.`id_sale` = `sale_cat`.`id_sale`
|
||||
JOIN `'._DB_PREFIX_.'privatesale_site_version` `vers` ON `vers`.`id_sale` = `sale`.`id_sale`
|
||||
JOIN `'._DB_PREFIX_.'category_family_association` `cat_fam` ON `cat_fam`.`id_category` = `sale_cat`.`id_category`
|
||||
WHERE `cat_fam`.`id_category_family` = '.$id_category_family.'
|
||||
AND `sale`.`date_start` <= NOW()
|
||||
AND `sale`.`date_end` >= NOW()
|
||||
AND `vers`.`version` = "'.pSql($site_version_front).'"
|
||||
';
|
||||
return Db::getInstance()->ExecuteS($query);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -44,6 +44,8 @@ class ProductController extends ProductControllerCore {
|
||||
|
||||
self::$smarty->assign(array(
|
||||
'sale' => $sale,
|
||||
'HOOK_SIMILAR_PRODUCT' => Module::hookExec('similarProduct', array('product' => $this->product, 'sale' => $sale)),
|
||||
'HOOK_SIMILAR_PRODUCT_TABLABEL' => Module::hookExec('simlarProductTabLabel', array('product' => $this->product, 'sale' => $sale)),
|
||||
'HOOK_PRIVATESALES_PRODUCT' => Module::hookExec('privatesales_product', array('sale' => $sale)),
|
||||
'is_sale_home' => ($sale? $sale->id_category == $id_category: FALSE),
|
||||
'is_thumb_vp' => (file_exists(_PS_ROOT_DIR_.'/img/c/'.$id_category_thumb.'_thumb_vp.jpg')),
|
||||
|
@ -6830,3 +6830,195 @@ table#carrierTable tbody td {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
/* ticket 8048 - Product details - Other similar products / best sales for product family */
|
||||
/* Slider product footer (blockbestsellers)*/
|
||||
#product #privatesales_similarproduct {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
#product #privatesales_similarproduct strong {
|
||||
background-size: 100% 100%;
|
||||
color: #4F4E9A;
|
||||
margin-right: 0px;
|
||||
}
|
||||
|
||||
#product #privatesales_similarproduct .slider_sales_product_footer {
|
||||
border: 1px solid transparent; /* trick to get the correct height in javascript */
|
||||
/*width:880px;*/
|
||||
}
|
||||
|
||||
#product #privatesales_similarproduct ul {
|
||||
list-style: none;
|
||||
width:880px;
|
||||
position:relative;
|
||||
}
|
||||
#product #privatesales_similarproduct ul li{
|
||||
position: relative;
|
||||
box-sizing: border-box;
|
||||
max-height: 300px;
|
||||
background: #fff;
|
||||
margin: 0 10px 0 10px;
|
||||
display:inline-block;
|
||||
|
||||
-moz-box-shadow: 0px 0px 5px 1px #cccccc;
|
||||
-webkit-box-shadow: 0px 0px 5px 1px #CCC;
|
||||
-ms-box-shadow:: 0px 0px 5px 1px #cccccc;
|
||||
-o-box-shadow: 0px 0px 5px 1px #cccccc;
|
||||
box-shadow: 0px 0px 5px 1px #CCC;
|
||||
}
|
||||
#product #privatesales_similarproduct ul li .hover-slide,
|
||||
#product #privatesales_similarproduct ul li .product_added{
|
||||
display: none;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width:100%;
|
||||
height:100%;
|
||||
background-color: rgba(0,0,0,0.7);
|
||||
box-sizing: border-box;
|
||||
text-align: center;
|
||||
position: absolute;
|
||||
}
|
||||
#product #privatesales_similarproduct ul li .product_added{
|
||||
z-index: 999;
|
||||
padding: 45px 20px;
|
||||
}
|
||||
#product #privatesales_similarproduct ul li .product_added p{
|
||||
font-family: "georgia";
|
||||
font-style: italic;
|
||||
font-weight: bold;
|
||||
}
|
||||
#product #privatesales_similarproduct ul li:hover div.hover-slide{
|
||||
display: block;
|
||||
}
|
||||
#product #privatesales_similarproduct ul li .hover-slide a{
|
||||
display: inline-block;
|
||||
width: 40%;
|
||||
height: 100%;
|
||||
}
|
||||
#product #privatesales_similarproduct ul li .hover-slide a.add-to-cart {
|
||||
background: url("../img/panier2.png") no-repeat center center;
|
||||
}
|
||||
#product #privatesales_similarproduct ul li .hover-slide a.see-product {
|
||||
background: url("../img/loupe.png") no-repeat center center;
|
||||
}
|
||||
|
||||
#product #privatesales_similarproduct ul li:after{
|
||||
content: '';
|
||||
display: block;
|
||||
clear: both;
|
||||
}
|
||||
|
||||
#product #privatesales_similarproduct ul li .similar_product {
|
||||
background-color: #fff;
|
||||
width:244.667px;
|
||||
padding:10px;
|
||||
}
|
||||
#product #privatesales_similarproduct ul li .img_sellers,
|
||||
#product #privatesales_similarproduct ul li .info_sellers {
|
||||
text-align: center;
|
||||
}
|
||||
#product #privatesales_similarproduct ul li .info_sellers {
|
||||
background: #fff;
|
||||
background-color: #E4E4EE;
|
||||
padding: 10px 10px;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
#product #privatesales_similarproduct ul li .product_link_sellers,
|
||||
#product #privatesales_similarproduct ul li .info_sellers p.price,
|
||||
#product #privatesales_similarproduct ul li .info_sellers .old_price,
|
||||
#product #privatesales_similarproduct ul li .info_sellers .percentage,
|
||||
#product #privatesales_similarproduct ul li .info_sellers .amount{
|
||||
font-family: "georgia";
|
||||
font-style: italic;
|
||||
font-weight: bold;
|
||||
}
|
||||
#product #privatesales_similarproduct ul li .product_link_sellers{
|
||||
display: block;
|
||||
display: -webkit-box;
|
||||
max-width: 70%;
|
||||
height: 44px;
|
||||
margin: 0 auto;
|
||||
font-size: 12px;
|
||||
line-height: 15px;
|
||||
-webkit-line-clamp: 3;
|
||||
-webkit-box-orient: vertical;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
font-weight: 500;
|
||||
color: #1e1633;
|
||||
}
|
||||
#product #privatesales_similarproduct ul li .product_sellers_label {
|
||||
border-bottom: 1px solid #e9e5e6;
|
||||
width:100%;
|
||||
margin-bottom:2px;
|
||||
text-align: center;
|
||||
background: #fff;
|
||||
padding-top:10px;
|
||||
}
|
||||
#product #privatesales_similarproduct ul li .img_sellers {
|
||||
border-top: 1px solid #e9e5e6;
|
||||
width:100%;
|
||||
}
|
||||
#product #privatesales_similarproduct ul li .product_link_sellers:hover{
|
||||
text-decoration: none;
|
||||
}
|
||||
#product #privatesales_similarproduct ul li .info_sellers p {
|
||||
margin:0px;
|
||||
}
|
||||
#product #privatesales_similarproduct ul li .info_sellers p.price {
|
||||
border:0;
|
||||
padding-top: 0px;
|
||||
color: #FB69AA;
|
||||
font-size: 16px;
|
||||
}
|
||||
#product #privatesales_similarproduct ul li .info_sellers .price_info {
|
||||
padding:0px;
|
||||
margin:0px;
|
||||
}
|
||||
#product #privatesales_similarproduct ul li .info_sellers .price_info .old_price {
|
||||
color: #B0B0B0;
|
||||
text-decoration: line-through;
|
||||
padding:0px;
|
||||
margin:0px;
|
||||
}
|
||||
#product #privatesales_similarproduct ul li .info_sellers .price_info .percentage,
|
||||
#product #privatesales_similarproduct ul li .info_sellers .price_info .amount{
|
||||
color: #4F4E9A;
|
||||
}
|
||||
|
||||
|
||||
/* ============= SLIDER ====================*/
|
||||
/*
|
||||
#product #privatesales_similarproduct .flex-direction-nav {
|
||||
position: inherit;
|
||||
}
|
||||
#product #privatesales_similarproduct .flex-control-nav{
|
||||
display: none;
|
||||
}
|
||||
*/
|
||||
#product #privatesales_similarproduct .ico_prev,
|
||||
#product #privatesales_similarproduct .ico_next {
|
||||
top: -80px;
|
||||
border-radius: 50%;
|
||||
width: 50px;
|
||||
height: 50px;
|
||||
content: '';
|
||||
background: #fff;
|
||||
color: transparent;
|
||||
opacity: 1;
|
||||
-moz-box-shadow: 0px 0px 5px 1px #cccccc;
|
||||
-webkit-box-shadow: 0px 0px 5px 1px #CCC;
|
||||
-ms-box-shadow:: 0px 0px 5px 1px #cccccc;
|
||||
-o-box-shadow: 0px 0px 5px 1px #cccccc;
|
||||
box-shadow: 0px 0px 5px 1px #CCC;
|
||||
}
|
||||
#product #privatesales_similarproduct .ico_prev{
|
||||
background: url("../img/arrow_blue_left.png") no-repeat center center #fff;
|
||||
}
|
||||
#product #privatesales_similarproduct .ico_next{
|
||||
background: url("../img/arrow_blue_right.png") no-repeat center center #fff;
|
||||
}
|
||||
#product #privatesales_similarproduct .ico_prev:before,
|
||||
#product #privatesales_similarproduct .ico_next:before{
|
||||
display: none;
|
||||
}
|
||||
|
@ -7,7 +7,7 @@
|
||||
<li class="slide-item">
|
||||
<div class="hover-slide">
|
||||
<a onclick="showExpressCart(event); return false;" class="add-to-cart ajax_add_to_cart_product_footer_button" rel="{$product.id_product}" href="" title="{l s='Add to cart' mod='blockbestsellers'}"></a>
|
||||
<a class="see-product" href="{$product.link}" title="{l s='See this product' mod='blockbestsellers'}"></a>
|
||||
<a class="see-product" href="{$product.link}" target="_blank" title="{l s='See this product' mod='blockbestsellers'}"></a>
|
||||
</div>
|
||||
<div class="product_added product_added_{$product.id_product}">
|
||||
<p>{l s='Product added to your cart' mod='blockbestsellers'}</p>
|
||||
@ -73,7 +73,7 @@
|
||||
error: function(XMLHttpRequest, textStatus, errorThrown)
|
||||
{
|
||||
alert("TECHNICAL ERROR: unable to add the product.\n\nDetails:\nError thrown: " + XMLHttpRequest + "\n" + 'Text status: ' + textStatus);
|
||||
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -462,6 +462,9 @@ var oneQuantityAvailableSentence = '{l s='Warning: 1 item in stock!' js=1}';
|
||||
{if !empty($product->description)}<li><a id="more_info_tab_data_sheet" href="#idTab2">{l s='Good to know'}</a></li>{/if}
|
||||
{*if $product->buy_guide}<li><a id="more_info_tab_data_sheet" href="#idTab3">{l s='Buy guide'}</a></li>{/if*}
|
||||
{if !empty($product->videos)}<li><a id="more_info_tab_data_sheet" href="#idTab4">{l s='Videos'}</a></li>{/if}
|
||||
{if isset($HOOK_SIMILAR_PRODUCT_TABLABEL) && $HOOK_SIMILAR_PRODUCT_TABLABEL!=''}
|
||||
<li><a id="more_info_tab_data_sheet" href="#idTab6">{$HOOK_SIMILAR_PRODUCT_TABLABEL}</a></li>
|
||||
{/if}
|
||||
<li><a id="more_info_tab_data_sheet" href="#idTab5">{l s='Shipping'}</a></li>
|
||||
{*{if $features}<li><a id="more_info_tab_data_sheet" href="#idTab2">{l s='Data sheet'}</a></li>{/if}
|
||||
{if $attachments}<li><a id="more_info_tab_attachments" href="#idTab9">{l s='Download'}</a></li>{/if}
|
||||
@ -534,6 +537,13 @@ var oneQuantityAvailableSentence = '{l s='Warning: 1 item in stock!' js=1}';
|
||||
{$product->description_delivery}
|
||||
{/if}
|
||||
</div>
|
||||
|
||||
{if isset($HOOK_SIMILAR_PRODUCT)}
|
||||
<div id="idTab6" class="rte">
|
||||
{$HOOK_SIMILAR_PRODUCT}
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
{if $features}
|
||||
<!-- product's features -->
|
||||
<ul id="idTab8" class="bullet">
|
||||
@ -549,37 +559,39 @@ var oneQuantityAvailableSentence = '{l s='Warning: 1 item in stock!' js=1}';
|
||||
{/foreach}
|
||||
</ul>
|
||||
{/if}
|
||||
{if isset($accessories) AND $accessories}
|
||||
<!-- accessories -->
|
||||
<ul id="idTab7" class="bullet">
|
||||
<div class="block products_block accessories_block clearfix">
|
||||
<div class="block_content">
|
||||
<ul>
|
||||
{foreach from=$accessories item=accessory name=accessories_list}
|
||||
{assign var='accessoryLink' value=$link->getProductLink($accessory.id_product, $accessory.link_rewrite, $accessory.category)}
|
||||
<li class="ajax_block_product {if $smarty.foreach.accessories_list.first}first_item{elseif $smarty.foreach.accessories_list.last}last_item{else}item{/if} product_accessories_description">
|
||||
<h5><a href="{$accessoryLink|escape:'htmlall':'UTF-8'}">{$accessory.name|truncate:22:'...':true|escape:'htmlall':'UTF-8'}</a></h5>
|
||||
<div class="product_desc">
|
||||
<a href="{$accessoryLink|escape:'htmlall':'UTF-8'}" title="{$accessory.legend|escape:'htmlall':'UTF-8'}" class="product_image"><img src="{$link->getImageLink($accessory.link_rewrite, $accessory.id_image, 'medium')}" alt="{$accessory.legend|escape:'htmlall':'UTF-8'}" width="{$mediumSize.width}" height="{$mediumSize.height}" /></a>
|
||||
<a href="{$accessoryLink|escape:'htmlall':'UTF-8'}" title="{l s='More'}" class="product_description">{$accessory.description_short|strip_tags|truncate:70:'...'}</a>
|
||||
</div>
|
||||
<p class="product_accessories_price">
|
||||
{if $accessory.show_price AND !isset($restricted_country_mode) AND !$PS_CATALOG_MODE}<span class="price">{if $priceDisplay != 1}{displayWtPrice p=$accessory.price}{else}{displayWtPrice p=$accessory.price_tax_exc}{/if}</span>{/if}
|
||||
<a class="button" href="{$accessoryLink|escape:'htmlall':'UTF-8'}" title="{l s='View'}">{l s='View'}</a>
|
||||
{if ($accessory.allow_oosp || $accessory.quantity > 0) AND $accessory.available_for_order AND !isset($restricted_country_mode) AND !$PS_CATALOG_MODE}
|
||||
<a class="exclusive button ajax_add_to_cart_button" href="{$link->getPageLink('cart.php')}?qty=1&id_product={$accessory.id_product|intval}&token={$static_token}&add" rel="ajax_id_product_{$accessory.id_product|intval}" title="{l s='Add to cart'}">{l s='Add to cart'}</a>
|
||||
{else}
|
||||
<span class="exclusive">{l s='Add to cart'}</span>
|
||||
<span class="availability">{if (isset($accessory.quantity_all_versions) && $accessory.quantity_all_versions > 0)}{l s='Product available with different options'}{else}{l s='Out of stock'}{/if}</span>
|
||||
{/if}
|
||||
</p>
|
||||
</li>
|
||||
{if !isset($HOOK_SIMILAR_PRODUCT)}
|
||||
{if isset($accessories) AND $accessories}
|
||||
<!-- accessories -->
|
||||
<ul id="idTab7" class="bullet">
|
||||
<div class="block products_block accessories_block clearfix">
|
||||
<div class="block_content">
|
||||
<ul>
|
||||
{foreach from=$accessories item=accessory name=accessories_list}
|
||||
{assign var='accessoryLink' value=$link->getProductLink($accessory.id_product, $accessory.link_rewrite, $accessory.category)}
|
||||
<li class="ajax_block_product {if $smarty.foreach.accessories_list.first}first_item{elseif $smarty.foreach.accessories_list.last}last_item{else}item{/if} product_accessories_description">
|
||||
<h5><a href="{$accessoryLink|escape:'htmlall':'UTF-8'}">{$accessory.name|truncate:22:'...':true|escape:'htmlall':'UTF-8'}</a></h5>
|
||||
<div class="product_desc">
|
||||
<a href="{$accessoryLink|escape:'htmlall':'UTF-8'}" title="{$accessory.legend|escape:'htmlall':'UTF-8'}" class="product_image"><img src="{$link->getImageLink($accessory.link_rewrite, $accessory.id_image, 'medium')}" alt="{$accessory.legend|escape:'htmlall':'UTF-8'}" width="{$mediumSize.width}" height="{$mediumSize.height}" /></a>
|
||||
<a href="{$accessoryLink|escape:'htmlall':'UTF-8'}" title="{l s='More'}" class="product_description">{$accessory.description_short|strip_tags|truncate:70:'...'}</a>
|
||||
</div>
|
||||
<p class="product_accessories_price">
|
||||
{if $accessory.show_price AND !isset($restricted_country_mode) AND !$PS_CATALOG_MODE}<span class="price">{if $priceDisplay != 1}{displayWtPrice p=$accessory.price}{else}{displayWtPrice p=$accessory.price_tax_exc}{/if}</span>{/if}
|
||||
<a class="button" href="{$accessoryLink|escape:'htmlall':'UTF-8'}" title="{l s='View'}">{l s='View'}</a>
|
||||
{if ($accessory.allow_oosp || $accessory.quantity > 0) AND $accessory.available_for_order AND !isset($restricted_country_mode) AND !$PS_CATALOG_MODE}
|
||||
<a class="exclusive button ajax_add_to_cart_button" href="{$link->getPageLink('cart.php')}?qty=1&id_product={$accessory.id_product|intval}&token={$static_token}&add" rel="ajax_id_product_{$accessory.id_product|intval}" title="{l s='Add to cart'}">{l s='Add to cart'}</a>
|
||||
{else}
|
||||
<span class="exclusive">{l s='Add to cart'}</span>
|
||||
<span class="availability">{if (isset($accessory.quantity_all_versions) && $accessory.quantity_all_versions > 0)}{l s='Product available with different options'}{else}{l s='Out of stock'}{/if}</span>
|
||||
{/if}
|
||||
</p>
|
||||
</li>
|
||||
|
||||
{/foreach}
|
||||
</ul>
|
||||
{/foreach}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</ul>
|
||||
</ul>
|
||||
{/if}
|
||||
{/if}
|
||||
{$HOOK_PRODUCT_TAB_CONTENT}
|
||||
</div>
|
||||
|
Loading…
Reference in New Issue
Block a user