Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Limit Sales to Select States...PLEASE HELP!


nchavez

Recommended Posts

I am in the process of working on a website for a winery. Due to liquor laws, wine can only be shipped to certain states. Does anyone have any idea how to restrict sales to those states that do not allow shipment of wine?

 

I tried to delete some of the states from the zones, but that only partially works. For example, Alabama is one of those states that can't be shipped to. When I deleted Alabama from the zones, then tried to add a new address with Alabama as the state, if I typed the state as "Alabama" it came up with the error that said to choose from the drop down list of states, however if I typed the state as "AL" it defaults to the next in the list, which happened to be Alaska. I would like it to come up with an error message that says something about not currently being able to ship to that state, whether the user spells out the state or uses the 2 letter state code.

 

I'm not great at PHP coding, could someone please help me solve this issue. I've searched and searched and haven't been able to find a solution.

Link to comment
Share on other sites

Since I'm not a PHP guru either, I can't really guide you on setting up the error message idea. But if you don't get any help with that, here is an alternate way to at least fully restrict states without the chance of it defaulting to a wrong state name. The following would replace the text boxes for state entry with dropdown boxes that are only populated with the states in your zones. You could then work some text into the appropriate pages to explain why their state may not be listed.

 

Just as you have, delete the states you don't ship to.

 

Then install the State list dropdown and US default country contribution.

 

There is an addendum to the contribution for making the same changes to:

 

checkout_new_address.php

address_book_details.php

 

Without digging deeper, it looks to me like it would also need to be applied to:

 

address_book_process.php

checkout_shipping_address.php

 

But I may be wrong about these last two. They may be calling the other two files to accomplish that part of their page.

Rule #1: Without exception, backup your database and files before making any changes to your files or database.

Rule #2: Make sure there are no exceptions to Rule #1.

Link to comment
Share on other sites

Thanks so much for your response. I'll give it a try and let you know if it works. Thanks again.

 

Since I'm not a PHP guru either, I can't really guide you on setting up the error message idea. But if you don't get any help with that, here is an alternate way to at least fully restrict states without the chance of it defaulting to a wrong state name. The following would replace the text boxes for state entry with dropdown boxes that are only populated with the states in your zones. You could then work some text into the appropriate pages to explain why their state may not be listed.

 

Just as you have, delete the states you don't ship to.

 

Then install the State list dropdown and US default country contribution.

 

There is an addendum to the contribution for making the same changes to:

 

checkout_new_address.php

address_book_details.php

 

Without digging deeper, it looks to me like it would also need to be applied to:

 

address_book_process.php

checkout_shipping_address.php

 

But I may be wrong about these last two. They may be calling the other two files to accomplish that part of their page.

Link to comment
Share on other sites

Hi,

on a similar thing I would like to notify people of areas of delivery, without restricting them from signing up to the shopping cart. I would like to use the drop down option so they can view where deliveries are availble to within the UK.

 

For example (UK):

Person from London buying flowers for a person in Leeds.

Deliveries can only be delivered to certain areas within Leeds and not others ie (ZIP CODE) LS1, LS2, LS4, LS5 - as you can see LS3 is missing.

 

Now I would like the client to still be able to register because he/she may need my services in the future to send flowers elsewhere within the UK....is this viable using the downloads MOD that is available?

I could go for the easy option and just create an array that would show up in a pop up window detailing the zip codes when clicked upon but clients may miss this and place orders that cannot be delivered to.

Hence to say some unhappy cliets from time to time, as well as creating a bad name for the site.

 

Any help on the matter would really help.

Kroggy.

:)

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...