VirtueMart Forum

VirtueMart 2 + 3 + 4 => General Questions => Topic started by: vittoriobruno on February 02, 2016, 13:46:08 PM

Title: Cart does not update when selecting shipment method
Post by: vittoriobruno on February 02, 2016, 13:46:08 PM
Hello,
I am using Joomla 3.4.8 + Virtuemart 3.0.12 and I have an issue in the cart. Currently, my cart module is integrated in a menu.
The issue is related to the update of the cart. When I add any product in the cart, popup appears and cart updates its total and number of products. Here, it's okay, it seems AJAX is working fine. Once logged in, when I click on "show cart", I have to select the shipment method (OPC is enabled): I have to select between 3 choices. Each one has a cost. But when I select one shipment method, cart total does not update. I cannot see any update even if I select any other shipment method. It updates only if I refresh the page. This is not good since user sees a price in the cart module and another in the end of cart summary. I wonder why the update is not occurring just when selecting shipment method. Could anyone help me?
I attach some backend settings, hoping they can be useful.

Thanks!
Vittorio
Title: Re: Cart does not update when selecting shipment method
Post by: jenkinhill on February 02, 2016, 17:25:09 PM
Template overrides?  OPC plugin?  URL?
Title: Re: Cart does not update when selecting shipment method
Post by: vittoriobruno on February 02, 2016, 18:31:34 PM
Hi, sorry for the missing informations.
Url is shop.magazzinilasorgente.it
Template was created with component "template creator" and menu where cart is present was customized with component Maximenu Params.
The only override I made on cart module is on file ..../mod_virtuemart_cart/default.php.  Here I slightly changed the layout of the text in the cart. Since I integrated it in an horizontal menu, width requirements became relevant: so I modified module in order to show number of products in the first row, total of cart in the second row (removing the right floating of "total" div), and finally "show cart" link in the third row. Then, I just forced width:auto for the cart module.
I created some other overrides, about order details and cart summary... but I don't think they are part of the discussion.
About OPC plugin I do not know exactly what to tell... I mean, I have never managed it and I have never installed anything related, so I think I am using the default plugin provided by Virtuemart. I do not know whether template creator rather than maximenu params components have impact on this plugin.

Thanks
Title: Re: Cart does not update when selecting shipment method
Post by: GJC Web Design on February 03, 2016, 01:28:46 AM
1. switch back to Protostar template and see if the problem still exists

2. if you have ajax enabled chk u have no JS errors on the cart page

3. chk console for ajax sends and responses
Title: Re: Cart does not update when selecting shipment method
Post by: vittoriobruno on February 03, 2016, 13:30:20 PM
Hello,
I have tried to set both protostar and beez templates: issue is still present. I tried also to add a cart module in the left side of the page, just to understand if its integration in a menu could create troubles... but there is no difference.
Then, I tried to use firebug in my firefox browser in order to check for js errors and also to use the console manager of the browser: they do not report any errors.
The 2 procedures just informed me about:
- using "getAttribute()" instead of "getAttributeNode()", that is deprecated;
- unreachable code after return statement
I am attaching relative images.
I do not know if this satisfies what you asked me to do but, since I am not pro in this stuff, I do not know exactly which steps I have to do.

Thanks
Title: Re: Cart does not update when selecting shipment method
Post by: GJC Web Design on February 03, 2016, 13:44:01 PM
It is never good to have any errors in JS as the run stops at that point --

I don't know what this is refering to?->  unreachable code after return statement

what sort of ship plugins are these?
Title: Re: Cart does not update when selecting shipment method
Post by: vittoriobruno on February 03, 2016, 13:59:30 PM
I do not know what it refers to as well... but I can say I have never modified any JS code.
Ship plugins are the default ones: I mean, I have not installed any 3rd party plugin for shipments. The 3 methods I have set are the standard "VM Shipment - by weight, ZIP and countries" ones. I have set only the country (Italy) for all of them, no other requirements like weight, number of products...
So, I do not know how to solve..
Title: Re: Cart does not update when selecting shipment method
Post by: Milbo on February 04, 2016, 20:46:52 PM
Maybe a plugin? For xample a jquery plugin, check your "system" plugins
Title: Re: Cart does not update when selecting shipment method
Post by: vittoriobruno on February 06, 2016, 20:30:59 PM
Hello,
I did not solve the issue searching into the several plugins..
So I tried another way: I just performed a clean installation of Joomla 3.4.8 and Virtuemart 3.0.12 in my localhost site. Then, I set beez as default site template, and I have just created 2 products and 2 shipment methods (no constraints of weight, total cart, etc: just 2 different costs for shipment, it's just a test). Well... the issue is still here!! So I could start to think it's a "root" problem, not a matter of third party extension.

I attach 3 images to let you have a better idea: in step 1, product has just been added in the cart. No shipment method is selected. In step 2 I chose the first shipment method: as you can see, total cart updates but the total in CART MODULE doesn't! Same in step 3: I changed shipment method and total in cart module remains still just the item cost.
Does anyone of you have a base Joomla 3.4.8 and VM 3.0.12 installation, just to try and check the same behaviour?

Thanks
Vittorio
Title: Re: Cart does not update when selecting shipment method
Post by: Milbo on February 08, 2016, 18:04:13 PM
Did you test with the vm3.0.12.2?
Title: Re: Cart does not update when selecting shipment method
Post by: vittoriobruno on February 08, 2016, 18:10:53 PM
Hi,
3.0.12.2 is new for me! I tried with the version of VM downloadable in http://virtuemart.net/downloads
And in my backend I see just "Virtuemart 3.0.12"
Title: Re: Cart does not update when selecting shipment method
Post by: Milbo on February 08, 2016, 19:27:11 PM
I just tried and yes the module does not update, when the cart updates.
Title: Re: Cart does not update when selecting shipment method
Post by: AH on February 08, 2016, 22:28:53 PM
IMHO - if  it does update then that creates more confusion

When/If the Cart total showing includes the shipping/payment charges there is no separate line element for these additional charges

In your example:

Product item 10.00
Product total = 10.00

If the cart total updates it would show:
Product item 10.00
Product total = 20.00

There is no separate line for the shipping fee

I think that looks even more confusing??
Title: Re: Cart does not update when selecting shipment method
Post by: Milbo on February 08, 2016, 23:48:30 PM
I agree, we just should ensure that cart module developers could use a trigger, as far as I know there is a js trigger.
Title: Re: Cart does not update when selecting shipment method
Post by: jenkinhill on February 08, 2016, 23:56:20 PM
I don't see the logic in having the cart module display at checkout and display the same data twice.  I always have as few modules at checkpout as possible. 
Title: Re: Cart does not update when selecting shipment method
Post by: Milbo on February 09, 2016, 09:57:31 AM
Yepp, I think also the best way is to create a cart menu entry (maybe hidden) and to remove the cart module for the cart view
Title: Re: Cart does not update when selecting shipment method
Post by: vittoriobruno on February 09, 2016, 10:01:54 AM
Hi,
actually that was an example in a test site.
In "real" site I am not showing items list I have in the cart: this way user just sees "3 products - Total 20.00 euros" for example.
So we have two possibilities: if I show the items list in the cart, the confusion AH was mentioning is not being created, since ajax is "not working" (let me say). But showing the items in the cart is an administrator option, and I chose not to show them in the cart: in this case the confusion just mentioned again does not appear...but I have the issue again because cart total module is not updating! this is another confusion: module states 10 euros, order summary states 20. It's like, in a way or in another, confusion has to exist!

Just to answer also to jenkinhill... my cart module is a menu item, not a left module in the template like in the images I attached last: furthermore, menu item is always visible by choice. It scrolls down together with the scrolling down of the products, and it contains also articles links like "shipment", "payments", "login", etc. It has been created this way in order to let the user see always the main features.
Title: Re: Cart does not update when selecting shipment method
Post by: GJC Web Design on February 09, 2016, 10:04:14 AM
QuoteI don't see the logic in having the cart module display at checkout and display the same data twice.

Totally agree...  the aim should be to let the clients tiny mind not be distracted but anything other that getting the payment done

just disable the cart module in any cart pages
Title: Re: Cart does not update when selecting shipment method
Post by: AH on February 09, 2016, 16:37:12 PM
Gjc

Sometimes the cart module is in the header or as a dropdown and disabling it is not great for the user experience

No matter what is done - it seems as if some customers live their lives in total confusion
Title: Re: Cart does not update when selecting shipment method
Post by: vittoriobruno on February 10, 2016, 10:54:06 AM
Ok,
I followed your suggestion, removing cart module from main menu, putting it as a module in left position of the template and finally disabling its visualization in cart pages.
I just add a "show cart" menu item that sends user to cart summary, even if now it is not possible for customer to see always cart details like total products and total cart, that was my initial need.

However (could be a suggestion) maybe regardless of the redundancy of the information, it could be useful to add a field like shipment/payment method fee row in cart module, as AH someway mentioned in a previous post, and let the administrator choose whether to show it or not in frontend. This shall also have an impact on current AJAX behaviour, I think.

In any case, thanks to you for the support!