VirtueMart Forum

VirtueMart 2 + 3 + 4 => Plugins: Payment, Shipment and others => Topic started by: bortolani on August 03, 2016, 10:19:33 AM

Title: Disable payment AFTER choosing country
Post by: bortolani on August 03, 2016, 10:19:33 AM
Hi,
VM standard behaviour is to enable payments and/or shipping methods after the user has logged in and selected a country.
In many cases (most, actually) it would make  sense to do the opposite, i.e. disable unavailable payment methods after getting shipping info.


Is there a way to force this behaviour instead of the default one?

Thanks,
Bruno
Title: Re: Disable payment AFTER choosing country
Post by: GJC Web Design on August 03, 2016, 11:39:05 AM
well it does more or less...  if u change your address to a non available country the payment method will disappear.. hard to see the difference in what your proposing?
If you want the client to know what payment methods are possible just make a small module or something
Title: Re: Disable payment AFTER choosing country
Post by: bortolani on August 03, 2016, 15:39:12 PM
No, it does not work like you say... If you have a payment that is available just for some countries but not for all, it only appears after you fill in your address.
In practice it does not disappear if unavaible, but instead it appears if available.
In this way users cannot see that a payment method is available until they fill in the cart with their address.

As you said one may write that infomation somewhere in the site but it makes a difference to see it immediately as an option in the checkout page.
I'll try to dig the code and see if I can change the logic...

Bruno

Title: Re: Disable payment AFTER choosing country
Post by: GJC Web Design on August 03, 2016, 15:47:48 PM
QuoteIf you have a payment that is available just for some countries but not for all, it only appears after you fill in your address.

thats what I said

and if u subsequently change the address to a non available country then it disappears

look at the checkConditions() function of the payment plugs to adapt
Title: Re: Disable payment AFTER choosing country
Post by: bortolani on August 03, 2016, 16:34:37 PM
I will. Many thanks for the hint!

Bruno