Merge branch 'tiket-productTemplate' into develop
This commit is contained in:
commit
e7d540092a
@ -0,0 +1,84 @@
|
||||
<div id="best-sellers_block_product" class="block products_block">
|
||||
<h1 class="">{l s='Les meilleures ventes' mod='blockbestsellers'}</h1>
|
||||
{if $best_sellers|@count > 0}
|
||||
<div class="slider_sales_product_footer">
|
||||
<ul class="slides">
|
||||
{foreach from=$best_sellers item=product name=myLoop}
|
||||
<li>
|
||||
<div class="hover-slide">
|
||||
<a class="add-to-cart ajax_add_to_cart_product_footer_button" rel="ajax_id_product_footer_{$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>
|
||||
</div>
|
||||
<div class="product_added product_added_{$product.id_product}">
|
||||
<p>{l s='Product added to your cart' mod='blockbestsellers'}</p>
|
||||
</div>
|
||||
<div class="img_sellers">
|
||||
<a href="{$product.link}" title="{$product.name|escape:'htmlall':'UTF-8'}"><img src="{$link->getImageLink($product.link_rewrite, $product.id_image, 'medium')}" alt="{$product.legend|escape:'htmlall':'UTF-8'}" /></a>
|
||||
</div>
|
||||
<div class="info_sellers">
|
||||
<a href="{$product.link}" title="{$product.name|escape:'htmlall':'UTF-8'}" class="product_link_sellers">{$product.name}</a>
|
||||
<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>
|
||||
</li>
|
||||
{/foreach}
|
||||
</ul>
|
||||
</div>
|
||||
{else}
|
||||
<p>{l s='No best sellers at this time' mod='blockbestsellers'}</p>
|
||||
{/if}
|
||||
</div>
|
||||
|
||||
<link rel="stylesheet" href="/modules/blockbestsellers/assets/css/flexslider.css">
|
||||
<script type="text/javascript" src="/modules/blockbestsellers/assets/js/jquery.flexslider.js"></script>
|
||||
|
||||
<script>
|
||||
{literal}
|
||||
$( document ).ready(function() {
|
||||
$('.slider_sales_product_footer').flexslider({
|
||||
animation: "slide",
|
||||
directionNav: true,
|
||||
itemWidth: (860/3),
|
||||
useCSS : false,
|
||||
pauseOnHover: true,
|
||||
});
|
||||
$('.slider_sales_product_footer .flex-direction-nav .flex-next').text('');
|
||||
$('.slider_sales_product_footer .flex-direction-nav .flex-prev').text('');
|
||||
$('.ajax_add_to_cart_product_footer_button').click(function(){
|
||||
var idProduct = $(this).attr('rel').replace('ajax_id_product_footer_', '');
|
||||
if ($(this).attr('disabled') != 'disabled'){
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
url: baseDir + 'cart.php',
|
||||
async: true,
|
||||
cache: false,
|
||||
dataType : "json",
|
||||
data: 'add=1&ajax=true&qty=1&id_product=' + idProduct + '&token=' + static_token + '&ipa=',
|
||||
success: function(jsonData,textStatus,jqXHR)
|
||||
{
|
||||
ajaxCart.updateCartInformation(jsonData, false);
|
||||
$('.product_added_'+idProduct).show();
|
||||
setTimeout(function() {
|
||||
$('.product_added_'+idProduct).hide();
|
||||
}, 3000);
|
||||
},
|
||||
error: function(XMLHttpRequest, textStatus, errorThrown)
|
||||
{
|
||||
alert("TECHNICAL ERROR: unable to add the product.\n\nDetails:\nError thrown: " + XMLHttpRequest + "\n" + 'Text status: ' + textStatus);
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
return false;
|
||||
});
|
||||
});
|
||||
{/literal}
|
||||
</script>
|
Loading…
Reference in New Issue
Block a user