Author Topic: Revision 10318 now updates the cart without setting the payment/shipment  (Read 175 times)

ssc3

  • 3rd party VirtueMart Developer
  • Jr. Member
  • *
  • Posts: 152
    • Online Store Plugins
http://dev.virtuemart.net/projects/virtuemart/repository/revisions/10318/

Revision 10318 updates the cart without updating payment or shipping methods.
 
Code: [Select]
$(\'input[name="task"]\').val("updateCartNoMethods");
Most of the time this works,

but occasionally if a payment method has been changed to a new value.

"updateCartNoMethods” will  reset the payment methods back to their old default settings.
 
Checking if the methods have changed first by checking the “defaultChecked” property might be a solution.
 
If both shipping and payment methods have not changed then run “updateCartNoMethod”, otherwise use “updatecart”

Code: [Select]
var payment_default_checked = $("input[name=\'virtuemart_paymentmethod_id\']:checked").prop("defaultChecked");
 
var shipment_default_checked = $("input[name=\'virtuemart_shipmentmethod_id\']:checked").prop("defaultChecked");
 
if (payment_default_checked && shipment_default_checked)
    {
    $(\'input[name="task"]\').val("updateCartNoMethods");
    }
else
    {
    $(\'input[name="task"]\').val("updatecart");
    }
Virtuemart Payment Plugins

https://plugins.online-store.co.uk

AH

  • Global Moderator
  • Sr. Member
  • *
  • Posts: 3230
  • VirtueMart Version: 3.8.4
regards
A

Joomla 3.9.19
php 7.3

ssc3

  • 3rd party VirtueMart Developer
  • Jr. Member
  • *
  • Posts: 152
    • Online Store Plugins
Check the change in the JS for the cart view.html.php

http://dev.virtuemart.net/projects/virtuemart/repository/diff?utf8=%E2%9C%93&rev=10334&rev_to=10333

I checked those updates, but they have no effect on the original problem.
Virtuemart Payment Plugins

https://plugins.online-store.co.uk