Does this module work with: Zen Cart 1.3.0.2
Does this module work with: Zen Cart 1.3.0.2
I have Zen cart 1.3.6 (the latest version) and I want to know the advantages and disadvantages of doing it via PHP file or the database.
Awesome Module!
Quick question though...
When using this module i get the following in the Order Total Section of the checkout process:
select zip from local_zips where zip='92128'
How can I get rid of this? Thanks!
-Jeremy
I am getting a similar error:
select zip from local_zips where zip='92822'
1146 Table 'db188733754.local_zips' doesn't exist
in:
[select zip from local_zips where zip='92822']
It works fine for out of state zip codes but not local.
Your "table does not exist" errors indicate that you neglected to install the database table required for the mod to work.
The readme.txt explains to do that.
.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole
Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.
I tried installing the database but I am having a bit of trouble.
My host uses MySQL. Here is what I have done so far:
I go to the database and click on phpMyAdmin and see a list of all the tables.
At the bottom, I see: Create new table on database. I use the name provided in the readme.txt notes. The setup asks me for how many fields, I entered 1.
I change all the attributes to match the sql.txt example. The only thing I wasn't sure about is the type. I left the default which is MyISAM.
It looks like I have everything setup. It looks like I can add them one at a time but is there a way to import a file? I see a link for: Insert data from a text file into the table.
Do I just edit the sample lacountylocalzip.sql txt file so it starts with this (removing the CREATE TABLE stuff at the top of the example):
INSERT INTO `local_zips` (`zip`) VALUES(90001);
INSERT INTO `local_zips` (`zip`) VALUES(90002);
INSERT INTO `local_zips` (`zip`) VALUES(90003);
INSERT INTO `local_zips` (`zip`) VALUES(90004);
INSERT INTO `local_zips` (`zip`) VALUES(90005);
INSERT INTO `local_zips` (`zip`) VALUES(90006);
INSERT INTO `local_zips` (`zip`) VALUES(90007);
Then send it up?
No.
Select your Zen Cart database from the left pulldown menu.
Then click on the "Import" tab across the top right (if no "Import", choose "SQL").
Then you can either paste the contents of the lacountylocalzip.sql file in the textbox, or you can browse for the file and upload/submit it.
That should create the table and insert the required records.
If you specified a "table prefix" during installation of your Zen Cart system, you'll need to make some changes to the lacountylocalzip.sql file contents before you do this. You can determine this by checking if your "DB_PREFIX" setting in the /includes/configure.php file is set to blank (ie: '').
.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole
Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.
It would be nice to see this work with cities as well, instead of zip codes. The state publishes a free database that has tax rates based on cities, that is constantly updated. Here is the link for the state database. Thank you.
http://www.boe.ca.gov/sutax/pam71.htm
response to creeperkat, jeremy7786, wickedstangs, perhaps others:
Regarding the message displayed on the Order Total section of the checkout process that reads "select zip from local_zips where zip='#####'" where ##### is a zip code:
First, if the message also mentions "does not exist" then do as DrByte mentions: verify that your local_zips table has been installed in your database. If you have a unique table prefix, you must go through the code in includes/modules/order_total/ot_zip_tax.php and add the prefix to every instance of 'local_zips'. For instance, I use the characters"as" for the prefix to my tables so I changed each instance of 'local_zips" to 'as_local_zips'.
This should eliminate the "does not exist" message, however you may still get the rest of the message ("select zip from local_zips where zip='#####'). If you would like to remove this message from your displays then open the following file in an editor:
That should clear it up.Code:file: includes/modules/order_total/ot_zip_tax.php Find the following lines: $selstr = "select zip from local_zips where zip='$zip'"; echo $selstr; Change to: $selstr = "SELECT zip FROM local_zips WHERE zip='$zip'"; // echo $selstr;
Also, I found an error in the included readme.txt file for this contribution:
In the instructions "to install the database version:" in step 3 there are two files you should copy to your store. The second one reads includes/modules/ot_zip_tax.php when it should read includes/modules/order_total/ot_zip_tax.php.
It's possible a similar error appears in step 2 of the instructions "to install inline zip version" but I didn't use that method so have not verified it as an error.
Once I made the above changes I found this contribution to work very smoothly.
Ron
www.aspenshopsonline.com - ZenCart 1.3.9h
www.wilkssupply.com - ZenCart 1.3.9h
www.un-du.net - ZenCart 1.3.8a
ronlee67 Nice fix thanks..