9ecf2491c6
In product detail page : - show slider with product associated accessories if any, above the best selling products slider - show product's family best selling instead of the accessories, if any - show no slider if no accessories nor family best selling present Cache slider templates for : - associated accessories for each product for every language, if any - family best selling for each family of the product for every language, if any Fixes in javascript : - missing globals variables in module expresscart would the express cart fail when out of stock - change the express cart displaying when clicking on the cart icon in any footer sliders. Css : duplicate all css styles 'best-sellers_block_product' in 'privatesales_similarproduct' so that the latter slider can be adapted if required.
70 lines
2.4 KiB
Smarty
70 lines
2.4 KiB
Smarty
<script type="text/javascript">
|
|
|
|
{literal}
|
|
|
|
function hideExpressCart(event){
|
|
if($(".expresscart_frame:visible").length > 0) {
|
|
event.data.m.removeClass('active');
|
|
$(".expresscart_frame").slideUp();
|
|
$(".expresscart_frame").remove();
|
|
$('.close_popup_footer').remove();
|
|
$("html").unbind("click", hideExpressCart);
|
|
initButtons();
|
|
}
|
|
return false;
|
|
}
|
|
|
|
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) {
|
|
m.removeClass('active');
|
|
hideFooterExpressCart();
|
|
} else {
|
|
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('<a href="#" class="close_popup_footer"></a>');
|
|
|
|
$('a.close_popup_footer').click(function() {
|
|
$(this).remove();
|
|
m.removeClass('active');
|
|
hideFooterExpressCart();
|
|
return false;
|
|
});
|
|
|
|
$("html").bind("click", {m: m}, hideExpressCart);
|
|
});
|
|
}
|
|
|
|
return false;
|
|
}
|
|
|
|
function initButtons() {
|
|
$('.slider_sales_product_footer').after("{/literal}<div class=\"expresscart_frame\" style=\"text-align:center;\"><p class=\"loading\"><img src=\"{$img_dir|replace:'"':'"'}ajax-loader.gif\" alt=\"\" /></p></div>{literal}");
|
|
}
|
|
|
|
function hideFooterExpressCart(){
|
|
$(".expresscart_frame").slideUp();
|
|
$(".expresscart_frame").remove();
|
|
$("html").unbind("click", hideExpressCart);
|
|
initButtons();
|
|
}
|
|
|
|
$(document).ready(function() {
|
|
initButtons();
|
|
$("#product").bind("updated", function() {
|
|
initButtons();
|
|
return false;
|
|
});
|
|
});
|
|
|
|
{/literal}
|
|
</script>
|