Jump to content
  • Checkout
  • Login
  • Get in touch


The e-commerce.

Problem creating tax zones


Recommended Posts

I've had this store up and running for about 6 months but have never noticed this problem, even went back to my original backup and it still had the problem.


Its not letting me create a second tax zone. The Florida one that comes in the stock osc is the one I used so i never played with it much, and I can change and edit that one fine. Trying to create a second one, it will let me give the zone a name and description, but when I click on "Details" to add the country and zones it get this error


1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '-20, 20' at line 1


select a.association_id, a.zone_country_id, c.countries_name, a.zone_id, a.geo_zone_id, a.last_modified, a.date_added, z.zone_name from zones_to_geo_zones a left join countries c on a.zone_country_id = c.countries_id left join zones z on a.zone_id = z.zone_id where a.geo_zone_id = 5 order by association_id limit -20, 20


Any ideas on how to fix this? I need to get another tax zone working..

Link to comment
Share on other sites

Ah. good timing. This happened to me just a few days ago, and I found the answer searching these forums. The tricky thing is that you can't use the osCommerce forum search for words that are that short, so I used Google and came up with the following:




Basically, you need to change a couple of lines in:




From this:

$offset = ($max_rows_per_page * ($current_page_number - 1));
$sql_query .= " limit " . $offset . ", " . $max_rows_per_page;


to something like this (variable names are slightly different in each file to don't just blindly copy-n-paste):

$offset = ($max_rows_per_page * ($current_page_number - 1));
if ($offset < 0) $offset = 0;
$offset = ($max_rows_per_page * ($current_page_number - 1));
$sql_query .= " limit " . $offset . ", " . $max_rows_per_page;


Before you do anything, though, be sure to back up both files.



Link to comment
Share on other sites


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

  • Create New...