VirtueMart Forum

VirtueMart 2 + 3 + 4 => Templating & Layouts => Topic started by: Meton on July 18, 2015, 01:32:12 AM

Title: Fancybox close button will not update number of products in cart
Post by: Meton on July 18, 2015, 01:32:12 AM
Hi guys,

If you use the X (close) button in the fancybox it will close the lightbox witht the fancybox but it will not update your shoppingcart number of products. If you click on continue shopping it will.

What i currently did to get around this is create a 2nd continue shopping button but styled it as a close button.

Is there a better way to do this?

Kind regards,

Meton
Title: Re: Fancybox close button will not update number of products in cart
Post by: AH on July 18, 2015, 10:22:42 AM
Looks like you have a javascript error of some kind -

Look for java conflicts using a browser debugger such as firebug in firefox

And post a live url if you need someone to look at the site
Title: Re: Fancybox close button will not update number of products in cart
Post by: jenkinhill on July 18, 2015, 10:56:52 AM
Yes, the close (X) works OK for me on VM3.0.9.4 with default VM templates, closes the popup and adds the product to the cart.
Title: Re: Fancybox close button will not update number of products in cart
Post by: AH on July 18, 2015, 12:26:06 PM
But the (x)  does not influence the adding to cart - that happens "silently"
Title: Re: Fancybox close button will not update number of products in cart
Post by: hegbi on May 27, 2016, 01:48:07 AM
Older topic, but this will maybe help someone...

It seems that this is happening due to template overrides of VM Cart Module. For my template, this was a solution:

In file "modules\mod_virtuemart_cart\assets\js\update_cart.js"

between lines 24 & 25 (just before line
jQuery(module).find(".show_cart").html( datas.cart_show);
)

I have added these two lines
jQuery(module).find(".spvm-total-product").html( datas.totalProduct);
jQuery(module).find(".spvm-cart-total-bill").html( datas.billTotal);


and it works OK even if you close the popup on X button or you have autoclose add to cart popup. These two lines are for update of total quantity and total amount in cart module.

Please note that "spvm-total-product" and "spvm-cart-total-bill" are connected to my template, for various templates these are different...

J3.5.1 - VM3.0.16