c9ad2799d0
- fix the number of products displayed in the 'best sales for family' case - replace the slider by an adapted block with visuals differents from the best sales slider. - adapt the show cart javascript in order to get the correct height of product blocks on which the user click - fix selection between accessories and best sales for family in hooks - add a hook in order to display the correct label in the new tab - restore olds methods for best sales product. Routines related to the best sales family products have their own methods. - fix cache generation
81 lines
2.8 KiB
Smarty
81 lines
2.8 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');
|
|
|
|
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) {
|
|
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>");
|
|
|
|
$('#product .expresscart_frame iframe').height(height);
|
|
}
|
|
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>
|