Forums / Built-in Shipping and Payment Modules / how to restrict payment modules by shipping address zone?

how to restrict payment modules by shipping address zone?

Views: 3,716

Results 1 to 13 of 13
15 Sep 2010, 11:14 PM
#1
fakedecoy avatar

fakedecoy

Zen Follower

Join Date:
Jul 2006
Posts:
309
Plugin Contributions:
0

how to restrict payment modules by shipping address zone?

zc 1.3.8a

The payment modules all seem to be restricted according to the billing address zone. I want to restrict it by the shipping address zone. I don't care where the customer is from. I only care where the shipment is going in determining what payment methods I will accept. How do I change this?

Adamant Barbell - Home & commercial gym equipment - Since 2007
www.adamantbarbell.com

15 Sep 2010, 11:37 PM
#2
lindasdd avatar

lindasdd

Zen Follower

Join Date:
Jun 2007
Posts:
474
Plugin Contributions:
0

Re: how to restrict payment modules by shipping address zone?

Did you check out the Shipping modules?

They have that Zone part at the bottom. So if you set up your zones first you can then go ahead and restrict by zone.

If you need more info thatn that, come back with more detail on how you need it to work. What areas get what types of shipping, etc.

-lindasdd

15 Sep 2010, 11:50 PM
#3
fakedecoy avatar

fakedecoy

Zen Follower

Join Date:
Jul 2006
Posts:
309
Plugin Contributions:
0

Re: how to restrict payment modules by shipping address zone?

Right, I've pretty much got my shipping methods and zone restrictions ironed out. The only issue is when the billing and shipping addresses are different.

For example, a customer with a billing address in Alaska wants to ship to California and pay by credit card. I want to allow credit card payments for orders shipping to California, and I don't care where his billing address is. But he isn't allowed to select credit card, because credit card isn't a payment option for Alaska.

As a reverse example, a customer with a billing address in California wants to ship to Alaska. He is able to checkout and pay by credit card, but I want Alaska shipments to only have the option of a "Request for Quote" payment method I have set up. I don't care where his billing address is.

Adamant Barbell - Home & commercial gym equipment - Since 2007
www.adamantbarbell.com

16 Sep 2010, 2:32 AM
#4
lindasdd avatar

lindasdd

Zen Follower

Join Date:
Jun 2007
Posts:
474
Plugin Contributions:
0

Re: how to restrict payment modules by shipping address zone?

Hmm...... are you sure about that. My site is set up to restrict based on zone and it works based on shipping address.

Have you compared your shipping files to the standard Zen files to see if there are any diffs?

-lindasdd

16 Sep 2010, 5:56 AM
#5
fakedecoy avatar

fakedecoy

Zen Follower

Join Date:
Jul 2006
Posts:
309
Plugin Contributions:
0

Re: how to restrict payment modules by shipping address zone?

Ok, something is screwed up with how my cart handles ths zones and payment methods. Every time I start checkout with a given address, I get a different result based on whether I modify the billing address or shipping address during checkout or not, and whether I log off and log on again, etc. It's definitely inconsistent in the sense that some process in having to do with cookies or a change during the checkout process doesn't cause the intended result.

For example, I just logged on and had a California address selected as my shipping and billing address, and I got one result for payment methods. Then I switched the billing and shipping addresses a couple times, started checkout again, setting both addresses to California again, and I got a different result of payment methods.

So while before it seemed consistent to be using only the billing address zone in determining payment methods, now it's just plain buggy.

Adamant Barbell - Home & commercial gym equipment - Since 2007
www.adamantbarbell.com

16 Sep 2010, 12:16 PM
#6
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,515
Plugin Contributions:
176

Re: how to restrict payment modules by shipping address zone?

Then something's wrong in your files, either your addons or your customizations.
A clean uncustomized install of the latest version of Zen Cart doesn't exhibit the symptoms you posted; or, at least, I can't find a way to do it.

As lindasdd suggested earlier, go find out what's broken: http://www.zen-cart.com/wiki/index.php/Troubleshoot_-_Diagnosing_Obscure_Issues

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

18 Sep 2010, 5:01 PM
#7
fakedecoy avatar

fakedecoy

Zen Follower

Join Date:
Jul 2006
Posts:
309
Plugin Contributions:
0

Re: how to restrict payment modules by shipping address zone?

Does anyone have a store set up that doesn't exhibit these symptoms? I'll create a new install of zc if I have to to test it, but it's been a long time since I've done so, so it will probably take me hours.

I'm looking specifically for any configuration that has a payment method selection that differs at all based on zone and also allows different billing and shipping addresses. I will go to the last step of checkout a few times to check its behavior in presenting payment methods.

Adamant Barbell - Home & commercial gym equipment - Since 2007
www.adamantbarbell.com

18 Sep 2010, 11:44 PM
#8
lindasdd avatar

lindasdd

Zen Follower

Join Date:
Jun 2007
Posts:
474
Plugin Contributions:
0

Re: how to restrict payment modules by shipping address zone?

You can see mine, although it is set up to restrict shipping types, not payment types.

You should really only have to look at a couple files to compare them and sort it out.

Rather than doing a reinstall, try downloading a free version of Beyond Compare, unzipping a fresh version of the Zen files on your computer and then comparing the fresh version to you site version.

-lindasdd

18 Nov 2010, 5:36 AM
#9
fakedecoy avatar

fakedecoy

Zen Follower

Join Date:
Jul 2006
Posts:
309
Plugin Contributions:
0

Re: how to restrict payment modules by shipping address zone?

Can someone point me to their store so I can test this out? I've confirmed over and over again that what I described is correct for my store. I need to test another store with:

  • multiple shipping zones
  • payment methods restricted by zone (please tell me what zones)

Adamant Barbell - Home & commercial gym equipment - Since 2007
www.adamantbarbell.com

4 Mar 2011, 10:56 PM
#10
fakedecoy avatar

fakedecoy

Zen Follower

Join Date:
Jul 2006
Posts:
309
Plugin Contributions:
0

Re: how to restrict payment modules by shipping address zone?

Today I fresh installed a default installation of zc 1.3.9h and tested this issue with no mods nor code edits involved.

I configured it as follows.

Zones: California, Florida
Payment Methods: Check (zone restriction: CA), Charge Card (zone restriction: FL)

I set up a user with a three alternate addresses: CA, FL, and NY.

By testing I have confirmed that the default behavior of zc in the following scenarios with the noted results. I returned to the shopping cart page in each instance to begin checkout again and re-select the shipping and billing addresses.


Billing address CA, Shipping address CA
Payment method: Check (expected behavior)

Billing address CA, Shipping address FL
Payment method: Check (it's basing the restriction on the billing address)

Billing address CA, Shipping address NY
Payment method: Check (it's basing the restriction on the billing address)

Billing address NY, Shipping address NY
Payment method: None (expected behavior)

Billing address NY, Shipping address CA
Payment method: None (it's basing the restriction on the billing address)

So I have to insist that my original assertion in this thread was correct that zc bases the payment method zone restriction on the billing address only.

How can I modify this to have it use the shipping address for the payment zone restriction?

Adamant Barbell - Home & commercial gym equipment - Since 2007
www.adamantbarbell.com

10 Mar 2011, 12:51 AM
#11
fakedecoy avatar

fakedecoy

Zen Follower

Join Date:
Jul 2006
Posts:
309
Plugin Contributions:
0

Re: how to restrict payment modules by shipping address zone?

Bump. Any idea?

I can find most things with developer's tool kit searches, but this one is eluding me due to the complexity I think.

Adamant Barbell - Home & commercial gym equipment - Since 2007
www.adamantbarbell.com

10 Mar 2011, 1:41 AM
#12
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,515
Plugin Contributions:
176

Re: how to restrict payment modules by shipping address zone?

fakeDecoy:

So I have to insist that my original assertion in this thread was correct that zc bases the payment method zone restriction on the billing address only.Yes, it restricts based on the customer's billing/payment address.
I guess somehow I missed that you were asking about shipping addresses specifically. It's rare that anyone has wanted to restrict PAYMENT choices based on SHIPPING address alone.
fakeDecoy:

How can I modify this to have it use the shipping address for the payment zone restriction?
You'll have to edit EVERY payment module's code and change all references in the update_status() methods from referencing $order->billing to $order->delivery instead.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

10 Mar 2011, 7:14 PM
#13
fakedecoy avatar

fakedecoy

Zen Follower

Join Date:
Jul 2006
Posts:
309
Plugin Contributions:
0

Re: how to restrict payment modules by shipping address zone?

Perfect, thank you! No problem editing a few payment modules.

Adamant Barbell - Home & commercial gym equipment - Since 2007
www.adamantbarbell.com