Zen Cart Logo
Forums / Setting Up Categories, Products, Attributes / Disable sales to a specific state

Disable sales to a specific state

Views: 3,946

Results 1 to 16 of 16
4 Jun 2009, 8:47 PM
#1
lasdf1234 avatar

lasdf1234

New Zenner

Join Date:
Jun 2009
Posts:
2
Plugin Contributions:
0

Disable sales to a specific state

I'm looking for a way to disable sales for only one product since it cannot be sold in that state. Any help would be appreciated.

7 Jun 2009, 2:45 PM
#2
ajeh avatar

ajeh

Oba-san

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

Re: Disable sales to a specific state

You could customize the Add to Cart based on the customer's address ...

However a few thoughts ...

You want to stop sales to a specific state ... is this based on billing or shipping?

Do you want to allow Grandma in Ohio, assume for the moment that is the state not allowed to have the product, be able to buy it, but ship it to little Tiny Tim in New York, assuming the block is on shipping address and New York is okay?

8 Jun 2009, 7:15 PM
#3
lasdf1234 avatar

lasdf1234

New Zenner

Join Date:
Jun 2009
Posts:
2
Plugin Contributions:
0

Re: Disable sales to a specific state

Thanks for your response. I would like not to allow shipping for 1 specific product to 1 specific state (CA).

Could you be more specific regarding customizing the add to cart button to accomplish this? Thanks in advance.

Ajeh:

You could customize the Add to Cart based on the customer's address ...

However a few thoughts ...

You want to stop sales to a specific state ... is this based on billing or shipping?

Do you want to allow Grandma in Ohio, assume for the moment that is the state not allowed to have the product, be able to buy it, but ship it to little Tiny Tim in New York, assuming the block is on shipping address and New York is okay?

8 Jun 2009, 9:04 PM
#4
ajeh avatar

ajeh

Oba-san

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

Re: Disable sales to a specific state

If you just wanted to control this based on Add to Cart, the customer would have to be logged in and you would be checking their Primary Address ...

That means that someone from California could not add it to the cart and then ship it to New York as the "control" over the Add to Cart is happening too early ...

If you want to control it based on the shipping address, then anyone can add the Product to the cart but only when the shipping address is "not California" can they get past the shipping page ...

This lets someone in California ship the product to someone in New York ...

So you need to decide what kind of control do you want on the Product ...

1 at the Add to Cart stage

2 at the Checkout Shipping stage

It sounds like you want to stop the order at the checkout_shipping if the product is in the cart and if the customer has a California address ...

26 Oct 2009, 10:24 PM
#5
ahaynes106 avatar

ahaynes106

New Zenner

Join Date:
Oct 2009
Posts:
38
Plugin Contributions:
0

Re: Disable sales to a specific state

Ajeh:

If you just wanted to control this based on Add to Cart, the customer would have to be logged in and you would be checking their Primary Address ...

That means that someone from California could not add it to the cart and then ship it to New York as the "control" over the Add to Cart is happening too early ...

If you want to control it based on the shipping address, then anyone can add the Product to the cart but only when the shipping address is "not California" can they get past the shipping page ...

This lets someone in California ship the product to someone in New York ...

So you need to decide what kind of control do you want on the Product ...

1 at the Add to Cart stage

2 at the Checkout Shipping stage

It sounds like you want to stop the order at the checkout_shipping if the product is in the cart and if the customer has a California address ...

This ties in with the 48 states free shipping you already helped me with, but how can I block all orders from being shipped to the other two states based on option "2 at the Checkout Shipping stage"

26 Oct 2009, 11:31 PM
#6
ajeh avatar

ajeh

Oba-san

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

Re: Disable sales to a specific state

If you have only the 48 states defined in your Zone for your shipping module(s) then the other 2 states cannot be shipped to ...

If for some reason you cannot take payments from those 2 states either, then add the same Zone to your Payment module(s) ...

27 Oct 2009, 1:51 AM
#7
ahaynes106 avatar

ahaynes106

New Zenner

Join Date:
Oct 2009
Posts:
38
Plugin Contributions:
0

Re: Disable sales to a specific state

Great. Thanks!

4 Apr 2010, 5:34 AM
#8
virtualomega avatar

virtualomega

New Zenner

Join Date:
Apr 2010
Posts:
4
Plugin Contributions:
0

Re: Disable sales to a specific state

When I tried to do this, it just has fields for countries. What if I ship only to U.S. but I need to block shipping to a certain state? Where you put this in the zone module?

Ajeh:

If you have only the 48 states defined in your Zone for your shipping module(s) then the other 2 states cannot be shipped to ...

If for some reason you cannot take payments from those 2 states either, then add the same Zone to your Payment module(s) ...

4 Apr 2010, 6:05 AM
#9
ajeh avatar

ajeh

Oba-san

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

Re: Disable sales to a specific state

Look in the Free Software Add Ons for Zone Table where you can define the Zone with the Zone Definitions ...

5 Apr 2010, 3:52 AM
#10
virtualomega avatar

virtualomega

New Zenner

Join Date:
Apr 2010
Posts:
4
Plugin Contributions:
0

Re: Disable sales to a specific state

Ajeh:

Look in the Free Software Add Ons for Zone Table where you can define the Zone with the Zone Definitions ...

Are you referring to this? http://www.zen-cart.com/index.php?main_page=product_contrib_info&products_id=695

I don't need shipping rates for any states I just need to block shipping to one state.

5 Apr 2010, 4:28 AM
#11
ajeh avatar

ajeh

Oba-san

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

Re: Disable sales to a specific state

Then build a Zone Definition for your shipping module where you do ship to and add it to your shipping module(s) that you have installed ...

I thought you used Zone Rate zones ... shipping module ...

The Zones Table Rate for Multiple Zones works like Zones but works off of Zone Definitions which allow you to build Zone Definitions to the State level ...

5 Apr 2010, 4:42 AM
#12
virtualomega avatar

virtualomega

New Zenner

Join Date:
Apr 2010
Posts:
4
Plugin Contributions:
0

Re: Disable sales to a specific state

Using Zones Table Rate for Multiple Zones will setup a Zone definition that I can enter states in?

5 Apr 2010, 4:57 AM
#13
ajeh avatar

ajeh

Oba-san

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

Re: Disable sales to a specific state

That shipping module will allow you to build as many Zone Definitions as you want ...

Then install it, and you will see that you can set a seperate Table Rate based on Item Count, Price or Weight and select any of your existing Zone Definitions for it ...

So if you made a Zone Definition for:
Country: United States
Zone: Texas

That definition would work only for Texas ...

If you made a Zone Definition for:
Country: United States
Zone: Alaska

Country: United States
Zone: Hawaii

That definition would work for only Alaska and Hawaii

If you made a Zone Definition for the 48 states plus DC ... that Zone Definition would only work for the 48 States plus DC ...

If you made a Zone Definition for:
Country: United States
State: Ohio

Country: Canada
Zone: All Zones

That Zone Definition would work only for Ohio and all of Canada ...

etc. etc. etc.

22 Mar 2014, 12:51 AM
#14
pricediscrimination avatar

pricediscrimination

Zen Follower

Join Date:
May 2008
Posts:
401
Plugin Contributions:
0

Re: Disable sales to a specific state

Ajeh:

That shipping module will allow you to build as many Zone Definitions as you want ...

Then install it, and you will see that you can set a seperate Table Rate based on Item Count, Price or Weight and select any of your existing Zone Definitions for it ...

So if you made a Zone Definition for:
Country: United States
Zone: Texas

That definition would work only for Texas ...

If you made a Zone Definition for:
Country: United States
Zone: Alaska

Country: United States
Zone: Hawaii

That definition would work for only Alaska and Hawaii

If you made a Zone Definition for the 48 states plus DC ... that Zone Definition would only work for the 48 States plus DC ...

If you made a Zone Definition for:
Country: United States
State: Ohio

Country: Canada
Zone: All Zones

That Zone Definition would work only for Ohio and all of Canada ...

etc. etc. etc.

Bringing up an old thread for a relevant question: if only blocking state in the entire world (ie: CA) then it seems crazy to have to go to Zone Definitions and insert every single country>all zones and then United States>all zones except CA. I started it, but it's going to take forever to add all those zones! Isn't there a way to simply block one zone and allow all the others??

22 Mar 2014, 3:56 AM
#15
ajeh avatar

ajeh

Oba-san

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

Re: Disable sales to a specific state

Create a Zone with:

INSERT INTO `geo_zones` (`geo_zone_id`, `geo_zone_name`, `geo_zone_description`, `last_modified`, `date_added`)  VALUES  (37, 'The World except California', 'The world except California', NULL, '2008-02-01 12:12:12');  
INSERT INTO `zones_to_geo_zones` (`zone_country_id`, `zone_id`, `geo_zone_id`)  VALUES (223, 1, 37), (223, 2, 37), (223, 4, 37), (223, 5, 37), (223, 12, 37), (223, 13, 37), (223, 14, 37), (223, 15, 37), (223, 16, 37), (223, 18, 37), (223, 19, 37), (223, 21, 37), (223, 22, 37), (223, 23, 37), (223, 24, 37), (223, 25, 37), (223, 26, 37), (223, 27, 37), (223, 28, 37), (223, 29, 37), (223, 31, 37), (223, 32, 37), (223, 33, 37), (223, 34, 37), (223, 35, 37), (223, 36, 37), (223, 37, 37), (223, 38, 37), (223, 39, 37), (223, 40, 37), (223, 41, 37), (223, 42, 37), (223, 43, 37), (223, 44, 37), (223, 45, 37), (223, 47, 37), (223, 48, 37), (223, 49, 37), (223, 51, 37), (223, 53, 37), (223, 54, 37), (223, 55, 37), (223, 56, 37), (223, 57, 37), (223, 58, 37), (223, 59, 37), (223, 61, 37), (223, 62, 37), (223, 63, 37), (223, 64, 37), (223, 65, 37);

Then use this:

INSERT INTO zones_to_geo_zones (zone_country_id, zone_id, geo_zone_id, date_added) 
SELECT countries_id , 0, 37, CURDATE() 
FROM countries 
WHERE countries_iso_code_3 NOT IN ('USA');

Next, delete California ...

Now add the US Territories ...

I think that will build everything except California in the Zone ...

NOTE: I have not tested this but it should work ...

If not, we can try again tomorrow ... :lookaroun

22 Mar 2014, 4:44 PM
#16
pricediscrimination avatar

pricediscrimination

Zen Follower

Join Date:
May 2008
Posts:
401
Plugin Contributions:
0

Re: Disable sales to a specific state

Ajeh:

Create a Zone with:

INSERT INTO geo_zones (geo_zone_id, geo_zone_name, geo_zone_description, last_modified, date_added) VALUES (37, 'The World except California', 'The world except California', NULL, '2008-02-01 12:12:12');
INSERT INTO zones_to_geo_zones (zone_country_id, zone_id, geo_zone_id) VALUES (223, 1, 37), (223, 2, 37), (223, 4, 37), (223, 5, 37), (223, 12, 37), (223, 13, 37), (223, 14, 37), (223, 15, 37), (223, 16, 37), (223, 18, 37), (223, 19, 37), (223, 21, 37), (223, 22, 37), (223, 23, 37), (223, 24, 37), (223, 25, 37), (223, 26, 37), (223, 27, 37), (223, 28, 37), (223, 29, 37), (223, 31, 37), (223, 32, 37), (223, 33, 37), (223, 34, 37), (223, 35, 37), (223, 36, 37), (223, 37, 37), (223, 38, 37), (223, 39, 37), (223, 40, 37), (223, 41, 37), (223, 42, 37), (223, 43, 37), (223, 44, 37), (223, 45, 37), (223, 47, 37), (223, 48, 37), (223, 49, 37), (223, 51, 37), (223, 53, 37), (223, 54, 37), (223, 55, 37), (223, 56, 37), (223, 57, 37), (223, 58, 37), (223, 59, 37), (223, 61, 37), (223, 62, 37), (223, 63, 37), (223, 64, 37), (223, 65, 37);

> 
> Then use this:
> ```
INSERT INTO zones_to_geo_zones (zone_country_id, zone_id, geo_zone_id, date_added) 
SELECT countries_id , 0, 37, CURDATE() 
FROM countries 
WHERE countries_iso_code_3 NOT IN ('USA');

Next, delete California ...

Now add the US Territories ...

I think that will build everything except California in the Zone ...

NOTE: I have not tested this but it should work ...

If not, we can try again tomorrow ... :lookaroun

That is awesome! I will do it and report back. Thanks as usual, Ajeh.