Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

[Contribution] Discount Coupon Codes


kgt

Recommended Posts

Hi

 

I have recently upgraded to version rc2, and use with fast easy checkout

ms2.2 has always worked - but since upgrading discount coupons has stopped working totally

 

I have been through the code about 5 times, and checked everythin is in place.

 

the coupon box shows on checkout_shipping (this is where it needs to go with fec) but the discount doesn't show on checkout_confirmation.

 

can anyone shed any light on this - as to what the problem could be

Link to comment
Share on other sites

Hi there,

 

Since a few days i'm getting the following error in my checkout_confirmation.php

 

Fatal error: Using $this when not in object context in /var/www/vhosts/beauty7.be/httpdocs/includes/classes/discount_coupon.php on line 165

 

I would really appreciate any help. The weird thing is that it just happened, I didn't change anything or didn't install anything else you know.

 

I get the same error (most likely php 5.xx vs. 4.xx issue). Did yuo fix this yet and if so, how?

Link to comment
Share on other sites

I have contri 3.31 installed

 

I have a problem, i have "the minimum order total for this coupon is $100,-" set. But when i put items in my shopping cart over $100,- i get an error. That the minimum order total $100,- is.

 

But i have more than $100,- in my shoppingcart!

 

Could someone help me?

Link to comment
Share on other sites

I'm having problems. I'm getting

 

1062 - Duplicate entry 'test-0' for key 1

insert into discount_coupons_to_orders (coupons_id, orders_id) values (test', '')

[TEP STOP]

 

on checkout_confirmation.php

this is only happening with IE though. On firefox it works great. Any help? Thanks!

 

EDIT: well now its doing it for firefox too....

Edited by zeroxxorez
Link to comment
Share on other sites

ok well now it seems that firefox ocassionally will work...but IE never does...it throws the error every time and stops loading the page I really need help with this and I am also willing to pay for help. The store that is running this is SpiceWorld420.com It shouldn't be too hard of a fix but it seems like nobody ever answered it when other people asked the same question.

Link to comment
Share on other sites

Hi,

 

Can anyone help me with this issue.

 

I just installed Discount Coupon Codes and what a powerful contribution. Everything works fine, however when the customer and admin receives the order email, the discount is not in the email. Also it is not shown in the admin area under customers' orders, i.e. invoice, etc.

 

I have re-checked the code time and time again and it all looks good. What I really want to know is what file is responsible for this so that I can debug it or something. Just to let you know I'm not a PHP guru, just a novice or trying to be and I cannot just add this file direct into my server as I have added other contributions. Instead, I edited most of the files and some I copied direct as they did not have a contribution added to that file.

 

Thanks for your help.

antonitus

Link to comment
Share on other sites

I get the same error (most likely php 5.xx vs. 4.xx issue). Did yuo fix this yet and if so, how?

 

 

I didn't mate, definitely php 5 prob, didn't have it on php 4.3. my shop is still not functioning, handling sales through mail currently. let me know if you find out how.

Edited by Bambino
Link to comment
Share on other sites

I didn't mate, definitely php 5 prob, didn't have it on php 4.3. my shop is still not functioning, handling sales through mail currently. let me know if you find out how.

I can't believe we're the only ones with this issue. Hundreds if not thousands of ppl are using this contribution.

Link to comment
Share on other sites

Man there should be a forum just for this contribution. It's all messed up here and so confusing.

 

KGT if you're listening, which I don't think you are any more, you need to create another forum on another website dedicated to this contribution only. If you want, I can help with the web server side. As you can see there are many types of problems with no specific topic attached to them. So how can we find a specific issue through over 100 pages?

 

antonitus

Link to comment
Share on other sites

I can't believe we're the only ones with this issue. Hundreds if not thousands of ppl are using this contribution.

 

If there's no one out here who can help, its probably just changing 2 lines of code i'm gonna hire on tonight to do the job for 15$ :)

Link to comment
Share on other sites

If there's no one out here who can help, its probably just changing 2 lines of code i'm gonna hire on tonight to do the job for 15$ :)

 

Yeah, this line must be altered to php5 standards:

$order_total = $this->cart_info['total_products']['total'];

Link to comment
Share on other sites

Yeah, this line must be altered to php5 standards:

$order_total = $this->cart_info['total_products']['total'];

 

change:

$order_total = $this->cart_info['total_products']['total'];

 

to:

$order_total = $cart_info['total_products']['total'];

 

and its solved.

Link to comment
Share on other sites

change:

$order_total = $this->cart_info['total_products']['total'];

 

to:

$order_total = $cart_info['total_products']['total'];

 

and its solved.

 

See, i had this good feeling some program wizz such as yourself would be hinted by my snippet, rather than getting inside the script;-)

 

I'll go try. Thanks.

Link to comment
Share on other sites

Hiya. I have just installed Discount Coupon codes, but when i add a product to my cart, then checkout, i get the following error!

 

Any ideas how to fix it?

 

Thanks,

 

Andy

 

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 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="10% Off"

 

[TEP STOP]

 

I had this same problem and I found a "duct tape" fix. I am no programming expert but this worked for me. It removes your shipping zone exclusions completely so if you need to use that part of this contribution this fix will not work for you. This is what I did:

 

 

open: admin\includes\languages\english\coupons_exclusions.php

 

around line 42 find:

 //shipping zone exclusions

case 'zones' :
  $heading_available = 'This coupon may be used in these shipping zones.';
  $heading_selected = 'This coupon may <b>not</b> be used in these shipping zones.';
  break;
//end zone exclusions

 

Replace with:

/***
//shipping zone exclusions

case 'zones' :
  $heading_available = 'This coupon may be used in these shipping zones.';
  $heading_selected = 'This coupon may <b>not</b> be used in these shipping zones.';
  break;
//end zone exclusions
**/

 

open: catalog\includes\classes\discount_coupons.php

Around line 71 find:

//shipping zone exclusions

	$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' );
	  }
	  //end shipping zone exclusions

 

Replace with:

/***
	//shipping zone exclusions

	$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' );
	  }
	  //end shipping zone exclusions
	  ***/

 

Open admin\coupons.php

around line 293 find:

'<a href="' . tep_href_link(FILENAME_DISCOUNT_COUPONS_EXCLUSIONS, 'cID='.$cInfo->coupons_id.'&type=zones') . '">' . tep_image_button('button_shipping_zone_exclusions.gif', IMAGE_SHIPPING_ZONE_EXCLUSIONS, 'hspace="2" vspace="2"') . '</a> '

 

Replace with:

/**
								  .'<a href="' . tep_href_link(FILENAME_DISCOUNT_COUPONS_EXCLUSIONS, 'cID='.$cInfo->coupons_id.'&type=zones') . '">' . tep_image_button('button_shipping_zone_exclusions.gif', IMAGE_SHIPPING_ZONE_EXCLUSIONS, 'hspace="2" vspace="2"') . '</a> '
								  **/

This just comments out the code which executes the shipping zones script.

Thats what I did and I do not receive the sql syntax error any longer. . I actually dont receive it after I fix the catalog\includes\classes\discount_coupons.php file. The rest of the code is simply to remove the shipping zones from view so that It is not used since removing the code in the discount_coupons.php file breaks that portion of the module. I hope this helps, use at your own risk it has not been extensively tested.

 

This contribution is OK. It does not work out of the box for most people. I suggest that it be removed as the original creator has obviously given up on it.

Edited by jrd1mra
Link to comment
Share on other sites

You're right jrd1mra, the creator doesn't seem to be interested no more, however there are smart PHP programmers out there who can take on this project.

 

It has a few problems for me and I will be removing it from my system, although it's a powerful contribution, but I can live without it, it's no big deal, there are other discount contributions out there.

Link to comment
Share on other sites

sorry if this is answered already but i did have a quick look through this topic and couldnt find a solution, I have installed this contribution before and it worked fine, but i recently reinstalled my shop and have now started adding my addons, i installed this but now all of a sudden I have no modules,

 

screen1yw7.th.jpgthpix.gif

 

screen2ie0.th.jpgthpix.gif

 

screen3os4.th.jpgthpix.gif

Link to comment
Share on other sites

sorry if this is answered already but i did have a quick look through this topic and couldnt find a solution, I have installed this contribution before and it worked fine, but i recently reinstalled my shop and have now started adding my addons, i installed this but now all of a sudden I have no modules,

 

screen1yw7.th.jpgthpix.gif

 

screen2ie0.th.jpgthpix.gif

 

screen3os4.th.jpgthpix.gif

 

sorry I am a complete and utter noob, i sorted it, it was nothing to do with the contribution, its because a setting was out in the admin config file..... doh!

 

but I am having a little problem now, everything seems to work, but when i add a product to my cart and click checkout i just get a white screen, any ideas what i have done wrong? I do not use table rates for shipping... instead I use this contribution - http://addons.oscommerce.com/info/2571

 

thanks peeps! ;)

Link to comment
Share on other sites

I am using 3.3.1

 

Contribution has been working OK I think.

 

I have now discovered that none of the exclusion work.

 

When I create a discount coupon it can be used with any purchase.

 

I wish to apply the coupon code to specific products and categories.

 

Any suggestions?

 

thanks Geoff

Geoff

 

Telegraph Point 2441

Australia

Link to comment
Share on other sites

Thanks for this great contribution.

 

I've searched the forums but can't find anyone with a similar issue, so I'm posting here.

 

I have Discount Coupon Codes installed and was working perfectly fine.

 

I have just installed Get 1 Free contribution - which also works fine.

 

BUT when entering a discount code the order total is wrong (shows a negative total amount).

 

 

 

I'm guessing the discount coupons code needs to be told to ignore the free items? but where and how!?

 

 

I have found a temporary fix - which is to exclude the free product from the discount code - but obviously not ideal - at least it works ok for the time being!

 

 

I hope someone here can help.

 

Cheers

SSNB

Edited by ssnb
Link to comment
Share on other sites

A suggestion to everyone. Don't bother trying to use this forum for this contribution as nobody will help any more and the creator has vanished and doesn't care at all or has kicked the bucket, one or the other. I'm quite annoyed with this contribution if there aren't people to help so in my eyes it's crap and very buggy. Because of this I decided to use Joomla.

Link to comment
Share on other sites

I think I should have the multiple coupon modification done in a week, but I'm slow at documenting what I do so I may not have it posted here in the same time frame.

 

Tapuahk,

 

Something like this would be extremely useful for me. Did you get this to work with multiple coupons?

 

Thanks in advance...

Link to comment
Share on other sites

I have a problem. I have installed the contrib and it works with fixed amount. But the problem is that i can't use the exclude part. I'm trying to exclude all manufacturers except one. Buying a product with that included manufacturer works with the discount but i'f i'm trying to buy from another manufacturer i don't receive any error message, i just proceed to the next checkout without any discount. I'f i'm buying from both an included and excluded manufacturer i do receive the discount. Anyone who knows what the problem might be?

Link to comment
Share on other sites

Hi,

First of all: Wonderful contribution!

 

Now... I recieve an error just out of nowhere and have no clue how where it came from. Have searched and it seems like I am alone on this??!!

 

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 'AND coupons_id="testcode"' at line 4

SELECT dc2u.customers_id FROM discount_coupons_to_customers dc2u WHERE customers_id= AND coupons_id="testcode"

[TEP STOP]

 

 

Any help is highly appreciated since this is "quite" urgent.

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...