Jump to content
Sign in to follow this  
jwsfun

County Sales Tax Mod

Recommended Posts

Hello,

 

This is the first time I've contributed to osCommerce, and I hope you'll find this useful.

I will be uploading a zip in the Contributions area of the osCommerce Support site later this evening.

This contrib is a modification of the "City Tax Rate Hack for MS1", written by 'Ocularmagic' and 'Akshara Weave'. All credit goes to them, whereas I have only made the necessary changes to reflect a county tax, and not a city tax.

One install.txt file is included, no additional .php files to add and only one change to your database (but only if you need it).

Any questions, comments, or suggestions for improvement can be made here in this forum, via this thread.

Thanks to the above two mentioned individuals for allowing me to utilize their work to solve a problem I've been plagued with for a long time now.

I hope this mod is beneficial to the rest of you who may need it.

Good luck :).

Share this post


Link to post
Share on other sites

I have applied this MOD and now the site will not load. I receive the following errors in the log file:

PHP Fatal error: main(): Failed opening required 'includes/languages/.php' (include_path='.:/usr/local/lib/php-4.3.3/lib/php') in /home/users/web/b64/morsem005/commerce/catalog/includes/application_top.php on line 285

PHP Warning: main(includes/languages/.php): failed to open stream: No such file or directory in /home/users/web/b64/morsem005/commerce/catalog/includes/application_top.php on line 285

PHP Parse error: parse error in /home/users/web/b64/morsem005/commerce/catalog/includes/functions/general.php on line 311

 

Anyone have any suggestions? /Thanks.

Share this post


Link to post
Share on other sites

application_top.php

// include the language translations
require(DIR_WS_LANGUAGES . $language . '.php');

 

general.php

306 // Returns the tax rate for a zone / class
307 // TABLES: tax_rates, zones_to_geo_zones
308 function tep_get_tax_rate($class_id, $country_id = -1, $zone_id = -1) {
309    global $customer_zone_id, $customer_country_id, $customer_id;
310
311	$customer_suburb_query = tep_db_query("select entry_suburb, entry_zone_id" from  . TABLE_ADDRESS_BOOK . " where customers_id =  '" . $customer_id . "'");

Share this post


Link to post
Share on other sites

Hi.

 

I am having the same problem with application_top. I figured out the one in the general file--it was a missing brace (the close curly brace } ) after custom tax rate 3 (the last elseif statement).

 

The problem with application top is a little baffling, since I did not have to make any changes there--there was no reference to SUBURB to change in my original application top file. So the problem must also be in general.

 

The variable $language is not being evaluated correctly--it is evaluating to NULL for some reason, despite the fact that the section of application top immediately preceding the affected line is the bit having to do with grabbing the language. Unfortunately knowing this doesn't help me fix it, since I'm not a coder.

 

If anyone knows what's missing or how to fix this, I'd appreciate a clue. I'd really like to get this working, since I'm trying to build my local clientele. I suppose I could lobby the NC legislature to pressure Mecklenberg county to use the same tax rate as the 99 other counties in the state, but I'm guessing that's a rough sell.

 

*sigh* Help?

 

shris

Share this post


Link to post
Share on other sites

after I figure out the problem in general it seems to also fix the problem in application_top

 

 

 

Also, he says in the install doc that he doesn't get the individual text to show... it does on mine and I did it the way he says, so I dunno


Angela

Share this post


Link to post
Share on other sites

I have installed the mod and got things working fine. One question though... what if the person doesn't type the county in correctly? Like a misspelling or using all caps, or all lower case?

 

Seems like you would have to add all counties to the database and instruct the php file to run a check against the database to check in that county exists, if not give an error message. That an have a note on the side saying to type a certain way (caps, first letter caps, etc).

Share this post


Link to post
Share on other sites

I am not sure if it is due to this mod, but if I add a product and choose none for the tax class it still adds tax... I do not want to charge tax for gift vouchers and such... any help?

Edited by Orphon

Angela

Share this post


Link to post
Share on other sites

Anyone have any idea? it seems that this mod makes the cart ignore wether you have a tax class set or not... if you are in one of the taxable zones it charges tax even if the item is marked not taxable.

 

Anyone help ASAP?


Angela

Share this post


Link to post
Share on other sites
I have installed the mod and got things working fine.? One question though...? what if the person doesn't type the county in correctly?? Like a misspelling or using all caps, or all lower case?

 

Seems like you would have to add all counties to the database and instruct the php file to run a check against the database to check in that county exists, if not give an error message.? That an have a note on the side saying to type a certain way (caps, first letter caps, etc).

If I remember correctly, the MOD uses a Like operator in the MySQL query, meaning that A. capitalization does not matter and B. as long as it is close enough, it will detect the county.

Edited by SNewman

Share this post


Link to post
Share on other sites

Angela, Did you ever figure anything out with this? I have the same issue.

 

As I look at the code, it appears that the tax rates are set in the County code, and thus the normal processing of checking to ensure a tax rate has been selected for a product does not happen (or does not work).

 

I'm going to try to see if I can get it to check for the tax rate before the mod starts.

 

If you have any insight, let me know. If I am successful, I'll let you know.

 

Mark

 

 

I am not sure if it is due to this mod, but if I add a product and choose none for the tax class it still adds tax... I do not want to charge tax for gift vouchers and such... any help?

Share this post


Link to post
Share on other sites

I was able to address the issue about the tax class and tax rates.

 

I added an if statement checking to see if the $class_id is '0' (which indicates that you did not select a tax class for the product. If it is '0', I skip over where the County mod sets the tax rates in the functions/general.php file (somewhere between lines 250 and 310, I believe).

 

Glad to have that issue behind me. Hope it helps.

 

Mark

Share this post


Link to post
Share on other sites
The problem with application top is a little baffling, since I did not have to make any changes there--there was no reference to SUBURB to change in my original application top file. So the problem must also be in general.

 

Hi.

 

For me the line in step three

 

define('ACCOUNT_SUBURB', true);

 

was not in either

includes/application_top.php

or

includes/filenames.php

 

so I just added it to application_top.php, and that worked for me.

Share this post


Link to post
Share on other sites

Hy,

 

hopefully u will be fine.

 

I have used ur contribution, its working fine, but issue is quite bit different.

 

My requirement is taht i have a seprate individual price for each product, I have added a module of seprate shipping price, that workikng fine,

 

now i want to add sales tax of 8% for produycts which are shipped from california.

 

If i enable your contribution, then my individual shipping price dosnt work

 

I need ur help in this regard,

 

Login that is there is fine that u can only select only one ship[ping module(Flat/Tbale/Ind SHipping Price etc),

 

Wiaitn for ur reply

 

 

Regards,

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×