Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Any Big Brains out there


ksaun

Recommended Posts

Hey All, :huh:

 

When a customer signs up, it asks for the State, if they put PA it says to choose from a list, which is no big deal and I know there is a contrib to fix that.

 

My problem is, I want to offer 2 tax zones for PA, One for Allegheny County residents for (7%) and another for Everyone else in PA for (6%). I had a company that supposedly did it for me, but it doesn't work right.

 

In the State list it shows "Pennsylvania" and "Pennsylvania-Allegheny County"

 

If they select the second one everything works OK, the account is created and they are charged 7% sales tax for their purchases, which is correct.

 

But if they choose "Pennsylvania" it just displays the error message "Please select a state from the States pull down menu." Over and over again. And it will not create the Account.

 

Any Idea how to fix this or how to Implement something that does work? :blink:

 

My business is in Allegeny County so I don't know if I even have to collect different tax rates for different areas.

 

And if I do should I try to set it up usine zip codes as the key?

 

If you want to see for yourself what it is doing check out my website

 

My Webpage

My Favorite Quote from a movie.

 

Question: How do you know women sooo well?

 

Answer: I think of a man, then take away reason and accountability.

Link to comment
Share on other sites

Hey All,  :huh:

 

When a customer signs up, it asks for the State, if they put PA it says to choose from a list, which is no big deal and I know there is a contrib to fix that.

 

My problem is, I want to offer 2 tax zones for PA, One for Allegheny County residents for (7%) and another for Everyone else in PA for (6%). I had a company that supposedly did it for me, but it doesn't work right.

 

In the State list it shows "Pennsylvania" and "Pennsylvania-Allegheny County"

 

If they select the second one everything works OK, the account is created and they are charged 7% sales tax for their purchases, which is correct.

 

But if they choose "Pennsylvania" it just displays the error message "Please select a state from the States pull down menu." Over and over again. And it will not create the Account.

 

Any Idea how to fix this or how to Implement something that does work? :blink:

 

My business is in Allegeny County so I don't know if I even have to collect different tax rates for different areas.

 

And if I do should I try to set it up usine zip codes as the key?

 

If you want to see for yourself what it is doing check out my website

 

My Webpage

 

 

well, that is because the state validation checks in the database for the selected state "Pennsylvania" and uses the "like" statement.

So it gets 2 records back, "Pennsylvania" and "Pennsylvania-Allegheny County", which it then in turn does not like.

 

the same happens with all countries with states that have subsets of strings:

 

example :

 

1 orange county

2 orange county south

 

select 2 is OK but select 1 and you will see the error.

 

So 2 possible solutions:

 

1)change Pennsylvania into Pennsylvania(general) or something like that

2)replace the "like" statement in the validation to "="

 

I chose the latter.

Treasurer MFC

Link to comment
Share on other sites

the same happens with all countries with states that have subsets of strings:

 

example :

 

1 orange county

2 orange county south

 

select 2 is OK but select 1 and you will see the error.

 

So 2 possible solutions:

 

1)change Pennsylvania into Pennsylvania(general) or something like that

2)replace the "like" statement in the validation to "="

 

I chose the latter.

 

OK, So where do I find this statement? :blink:

My Favorite Quote from a movie.

 

Question: How do you know women sooo well?

 

Answer: I think of a man, then take away reason and accountability.

Link to comment
Share on other sites

well, that is because the state validation checks in the database for the selected state "Pennsylvania" and uses the "like" statement.

So it gets 2 records back, "Pennsylvania" and "Pennsylvania-Allegheny County", which it then in turn does not like.

 

the same happens with all countries with states that have subsets of strings:

 

example :

 

1 orange county

2 orange county south

 

select 2 is OK but select 1 and you will see the error.

 

So 2 possible solutions:

 

1)change Pennsylvania into Pennsylvania(general) or something like that

2)replace the "like" statement in the validation to "="

 

I chose the latter.

 

 

to be more precise for option 2:

 

in create_account you will see this line:

 

$zone_query = tep_db_query("select distinct zone_id from " . TABLE_ZONES . " where zone_country_id = '" . (int)$country . "' and (zone_name like '" . tep_db_input($state) . "%' or zone_code like '%" . tep_db_input($state) . "%')");

 

 

change that to:

 

$zone_query = tep_db_query("select distinct zone_id from " . TABLE_ZONES . " where zone_country_id = '" . (int)$country . "' and (zone_name = '" . tep_db_input($state) . "' or zone_code = '" . tep_db_input($state) . "')");

 

 

this also happens in other files like checkout_payment_adress etc.

Treasurer MFC

Link to comment
Share on other sites

to be more precise for option 2:

 

in create_account you will see this line:

 

          $zone_query = tep_db_query("select distinct zone_id from " . TABLE_ZONES . " where zone_country_id = '" . (int)$country . "' and (zone_name like '" . tep_db_input($state) . "%' or zone_code like '%" . tep_db_input($state) . "%')");

change that to:

 

        $zone_query = tep_db_query("select distinct zone_id from " . TABLE_ZONES . " where zone_country_id = '" . (int)$country . "' and (zone_name = '" . tep_db_input($state) . "' or zone_code = '" . tep_db_input($state) . "')");

this also happens in other files like checkout_payment_adress etc.

 

Well that sort of worked, but now the tax for Allegeny County is not even an option and it doesn't display the list of states at all now.

 

Any other Ideas? :blink:

My Favorite Quote from a movie.

 

Question: How do you know women sooo well?

 

Answer: I think of a man, then take away reason and accountability.

Link to comment
Share on other sites

Well that sort of worked, but now the tax for Allegeny County is not even an option and it doesn't display the list of states at all now.

 

Any other Ideas?  :blink:

 

I don't see where the tax comes in at sign up.

maybe you have another issue there.

 

but you can test it,

 

use option 1 and see if that solved the tax/listbox issue.

Treasurer MFC

Link to comment
Share on other sites

I don't see where the tax comes in at sign up.

maybe you have another issue there.

 

but you can test it,

 

use option 1 and see if that solved the tax/listbox issue.

 

Thanks Works great now :thumbsup:

My Favorite Quote from a movie.

 

Question: How do you know women sooo well?

 

Answer: I think of a man, then take away reason and accountability.

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...