eyeconect Posted September 10, 2007 Share Posted September 10, 2007 I am using Discount Coupon Code - http://www.oscommerce.com/community/contributions,4269 My customer now have products that are downloadable. If the only products in the cart is downloadable, delivery address is bypassed, Hence discount coupon fails to finish calculation. We get Following message and the checkout process stops. *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 'or z2g.zone_id = 0 or z2g.zone_id IS NULL ) SELECT dc2z.geo_zone_id FROM discount_coupons_to_zones dc2z LEFT JOIN jor_zones_to_geo_zones z2g USING( geo_zone_id ) WHERE ( z2g.zone_id= or z2g.zone_id = 0 or z2g.zone_id IS NULL ) AND ( z2g.zone_country_id= or z2g.zone_country_id = 0 ) AND dc2z.coupons_id="somecouponcode" [TEP STOP] So, as I am about to fix this, Just checking if anyone has fixed this already. Looking forward to any reply. Regards. Quote Link to comment Share on other sites More sharing options...
barnasoft Posted September 30, 2007 Share Posted September 30, 2007 I have exacly the same problem, don't know where is the problem. I am looking for it Thanks! Quote Link to comment Share on other sites More sharing options...
jonkopp Posted October 4, 2007 Share Posted October 4, 2007 anybody got any thoughts on this? I need help! :) Quote Link to comment Share on other sites More sharing options...
eyeconect Posted October 5, 2007 Author Share Posted October 5, 2007 anybody got any thoughts on this? I need help! :) Here is what fixed the problem on my site. Basically, the fix is to check if zone_id is set . if set continue else skip this part. On file catelog/include/classes/discount_coupon.php . version: /* * discount_coupon.php * August 4, 2006 * author: Kristen G. Thorson * ot_discount_coupon_codes version 3.0 * * * Released under the GNU General Public License * */ ----------------------------- Starts at around line 68 //shipping zone exclusions if($delivery['zone_id'] != '' && $delivery['country_id'] != '') // Added by eyeconect to fix for downloadable only in cart. { .... no changes below $check_user_query = tep_db_query($sql = 'SELECT dc2z.geo_zone_id FROM '.TABLE_DISCOUNT_COUPONS_TO_ZONES.' dc2z LEFT JOIN '.TABLE_ZONES_TO_GEO_ZONES.' z2g USING( geo_zone_id ) WHERE ( z2g.zone_id='.$delivery['zone_id'].' or z2g.zone_id = 0 or z2g.zone_id IS NULL ) AND ( z2g.zone_country_id='.$delivery['country_id'].' or z2g.zone_country_id = 0 ) AND dc2z.coupons_id="'.tep_db_input( $code ).'"' ); if (tep_db_num_rows( $check_user_query ) > 0 ) { $this->message( ENTRY_DISCOUNT_COUPON_ERROR ); //display the error message //use this to debug exclusions: //$this->message( 'Shipping Zones exclusion check failed' ); } ..... no changes above //end shipping zone exclusions }//end of if delivery array is set. By EyeConect. ------------------------ Best Regards. Quote Link to comment Share on other sites More sharing options...
chrisarr Posted May 15, 2008 Share Posted May 15, 2008 You are a hero EyeConect! Quote Link to comment Share on other sites More sharing options...
TVGHatesTVG Posted July 1, 2008 Share Posted July 1, 2008 awesome. this fixed my problem too. :D Quote Link to comment Share on other sites More sharing options...
evo_j Posted February 3, 2009 Share Posted February 3, 2009 hi all i have been asked to look at a site with this module installed, it has a slight problem for example the coupon system is installed and working fine, but has a small issue all shipping is free above 30gbp if you add product to your cart 35gbp then add discount coupon 50% off RRP price your total is gonna be around 21gbp therefore shipping should be reapplied as per shipping total 0-30gbp order is 3.95gbp for shipping but it doesnt work, shipping still shows as free UNLESS you leave the cart, go back to the site and then go to cart again, in which case, shipping is calculated correctly can anyone suggest a fix for this issue? thanks Quote Link to comment Share on other sites More sharing options...
freelanceweb Posted February 26, 2009 Share Posted February 26, 2009 (edited) Thank you EyeConect! This also fixed my issue! :rolleyes: Edited February 26, 2009 by freelanceweb Quote Link to comment Share on other sites More sharing options...
beanzy Posted June 28, 2010 Share Posted June 28, 2010 Any reason why coupons that have a quantity of zero show unlimited in admin? I tried to use the same coupon with a test order and same account and works properly stating that the coupon was already used. However, if I create another account with different email, you can use the same code used in the prior order. Not sure what is going on with both issues. Need to fix; Admin shows coupon unlimited when quantity is zero - Should show 0 Stop coupon from being used multiple times when set to use once only in admin Any help would be appreciated...Thanks Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.