Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Discount Coupon Contribution and downloadable porducts


eyeconect

Recommended Posts

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.

Link to comment
Share on other sites

  • 3 weeks later...
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.

Link to comment
Share on other sites

  • 7 months later...
  • 1 month later...
  • 7 months later...

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

Link to comment
Share on other sites

  • 4 weeks later...
  • 1 year later...

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

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...