Zen Cart Logo
Forums / Built-in Shipping and Payment Modules / Need to enforce US shipping only for one category

Need to enforce US shipping only for one category

Views: 883

Results 1 to 7 of 7
24 Jan 2011, 7:28 AM
#1
blackorchidcouture avatar

blackorchidcouture

Zen Follower

Join Date:
Apr 2010
Location:
Albuquerque, NM
Posts:
198
Plugin Contributions:
0

Need to enforce US shipping only for one category

One of my categories can only be shipped to the US, this category has a flat shipping rate applied to it, and for the other products in the order USPS will be used. This all is configured correctly. The only thing is I need to be sure an international customer cannot buy anything from this one category since I can't send it to them. So how to I apply one shipping zone (United States) to this one category? Also, if someone adds one of these products to their cart, then adds their shipping info which flags them as an international customer, what will happen to that product in their cart? I need the product to be removed from their cart, with a nice message added saying that product can only be shipping to the US at this time. Would anyone know how to do this?

Thanks ahead of time!

24 Jan 2011, 3:02 PM
#2
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Need to enforce US shipping only for one category

If the only country that can use the Flat Rate is US, then build a Zone Definition with the Details for who you will allow and add it to Flat Rate ...

Then, your code that switches from USPS to just the Flat Rate will manage which shipping module shows and the Zone Definition will manage who can use it ...

What happens on a mixed cart of this Category that ships Flat Rate and other Products from other Categories?

24 Jan 2011, 10:19 PM
#3
blackorchidcouture avatar

blackorchidcouture

Zen Follower

Join Date:
Apr 2010
Location:
Albuquerque, NM
Posts:
198
Plugin Contributions:
0

Re: Need to enforce US shipping only for one category

Hi Linda, you actually helped me extensively with modifying my shipping before, and I was finally able to get the shipping part sorted out correctly. Basically for one product that will be dropshipped, it's a flat $5 shipping charge, and this product can only be shipped to US addresses. BUT, for any other product, whether it's shipped in the US or internationally, I'll use USPS. If one of the flat rate products is in the cart, the $5 applies, and if there is a flat rate product and a different product, the USPS priority kicks in with the $5 on top, that is all correct.

The issue is that I added US only and other products to the cart and then pretended to be from another country, and it looks like it would let me continue with the order. I need the cart to update as soon as an international address is applied to basically not let the order go through with the US only product.

I do have a United States zone set up, and in the flat rate shipping I applied the US zone. Should this be enough to only allow US addresses? Because it doesn't seem to be enough. BTW, I just installed the upgraded USPS shipping module and added my modifications back in. Honestly I hadn't tested this out with an international address before, so I don't know how this would have played out before.

Hope this is enough but not too much info....

Thanks!

24 Jan 2011, 10:52 PM
#4
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Need to enforce US shipping only for one category

One way to do it is see how many Products are in the cart from that Category ... then test if it is the same number of Products that are in the Cart ...

If it is the same number, then disable USPS and enable Flat Rate ...

Flat Rate would have the Zone Definition on it for US only Addresses ...

Then, if there are more Products in the Cart than just the Products from that Category, you could add $5.00 to the cost in the USPS to cover the cost of Shipping plus that Category of Products ...

The trick is, that when using the USPS shipping module you need to disable it if the Shipping Address is not the US and there is 1 or more Products in the Cart from that Category ...

Somewhere I have written up something like this for a shipping module ... but I have to hunt it down on the forum or try to re-write the test ...

Maybe later tonight or tomorrow I can try to build this code again ... or perhaps someone will hunt it down for you and help us both out ... :smile:

25 Jan 2011, 3:02 AM
#5
blackorchidcouture avatar

blackorchidcouture

Zen Follower

Join Date:
Apr 2010
Location:
Albuquerque, NM
Posts:
198
Plugin Contributions:
0

Re: Need to enforce US shipping only for one category

This might all sound familiar since you did help me awhile back in this post: http://www.zen-cart.com/forum/showthread.php?t=157759

If the cart is using a US address, it's all working correctly, it sorts out the flat rate $5 fee and/or USPS correctly. It's just the cart allowing an international address to allow a product into it that is only set for a US zone that I need to fix.

You said one way would be to have the cart disable USPS for international addresses. But what if that's the service I'm choosing to use for shipping internationally? Would I then perhaps clone the USPS shipping module, make one of them just for the US, and one for international shipping?

I guess I don't understand the zones settings, since my flat rate module is set for my US zone I set up, yet a product that only uses this flat rate is allowed into an international cart...

25 Jan 2011, 3:44 AM
#6
blackorchidcouture avatar

blackorchidcouture

Zen Follower

Join Date:
Apr 2010
Location:
Albuquerque, NM
Posts:
198
Plugin Contributions:
0

Re: Need to enforce US shipping only for one category

This might all sound familiar since you did help me awhile back in this post: http://www.zen-cart.com/forum/showthread.php?t=157759

If the cart is using a US address, it's all working correctly, it sorts out the flat rate $5 fee and/or USPS correctly. It's just the cart allowing an international address to allow a product into it that is only set for a US zone that I need to fix.

You said one way would be to have the cart disable USPS for international addresses. But what if that's the service I'm choosing to use for shipping internationally? Would I then perhaps clone the USPS shipping module, make one of them just for the US, and one for international shipping?

I guess I don't understand the zones settings, since my flat rate module is set for my US zone I set up, yet a product that only uses this flat rate is allowed into an international cart...

25 Jan 2011, 3:57 AM
#7
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Need to enforce US shipping only for one category

Currently, there isn't anything testing the cart to disable the USPS shipping module when you have both Products that can ship to International and Products that cannot ship to International ...

There has to be an extra test on the cart to disable the shipping module when a Product from the US only Category is in the cart ...

As I say, I have to re-write the code or find the code I wrote before for something like this to work ...