VirtueMart Forum

VirtueMart 2 + 3 + 4 => General Questions => Topic started by: abhkum on September 11, 2013, 20:13:54 PM

Title: Disable payment method for particular shipping
Post by: abhkum on September 11, 2013, 20:13:54 PM
Hi,

i wanted to apply COD for some cities only, so I did this:

I have two shipping methods, 1. normal shipping 2. COD shipping (added zip codes for desired cities)
I made two payment methods 2. Online payment 2. COD (cash on delivery)

Now I want that when user clicks on COD shipping, then only COD payment appears and When user clicks normal shipping, online payment only appears.

Can somebody provide me the code or hack for this. Thanks a lot

I am using VM 2.0.20b
Title: Re: Disable payment method for particular shipping
Post by: WebStuff on September 11, 2013, 22:39:21 PM
If your shipping charge is fixed then a simple way to do it would be:
Create one shipment method which is free.
Choose automatic Shipment in Configuration.
Then set a 'fee' for the payment option that equals what your shipping charge would have been.
E.G.
Shipping = 0.00 (automatic selection) for everyone.
Customer chooses COD payment they get charged or billed 5.00(whatever-your-currency-is) by the COD payment plugin.
Or
Customer chooses Normal payment they get charged or billed 20.00(whatever-your-currency-is) by the Normal payment plugin

You could try it the other way round as well. whatever works best for you.

Hope I've understood what your asking and that this helps.
Title: Re: Disable payment method for particular shipping
Post by: abhkum on September 11, 2013, 22:49:30 PM
hey, thanks for the reply.

Actually the problem is that I want cash on delivery option for some selected zip codes only.
I want COD option to be seen by users only when they enter the zip code matching COD Zips, other wise they see only online payment option.

Hope you got my issue.

Thanks

Title: Re: Disable payment method for particular shipping
Post by: Maxim Pishnyak on September 12, 2013, 09:56:34 AM
Quote from: abhkum on September 11, 2013, 20:13:54 PM
Now I want that when user clicks on COD shipping, then only COD payment appears and When user clicks normal shipping, online payment only appears.
Did you try forum search button for finding already posted here solution for this?