Jump to content


Corporate Sponsors


Latest News: (loading..)

* * * * * 5 votes

[Contribution] Discount Coupon Codes


3188 replies to this topic

#1521 knott

  • Community Member
  • 130 posts
  • Real Name:Graeme

Posted 25 September 2007, 06:29

View Postcatalano, on Sep 23 2007, 04:33 AM, said:

I just did a first time install. I used the version 3.3 download. I didn't use the 2 later fixes listed on that screen as I wasn't sure that they were required. The install went relatively smooth. I did get one of the common sql errors that a lot of people get.... something with the '-20,20' bit. But a quick read of the common problems got that fixed. So now I've got the module set up and created a coupon. That all went smoothly. Unfortunately when I went to do a test transaction, when I enter the discount code and click the Continue button I get a red bar across the top of the store with the message "The coupon code you have entered is not valid". I've tried several times, I'm even copying and pasting the code from the coupon creation screen. But I constantly get that message.

I searched through as much of the 76 pages of posts here as I could and didn't actually find anyone with this basic problem. Is there something that I can do to figure out what is going wrong? I've created another coupon and changed some of the values from the first one, but I get the same error.

FWIW, my coupon has the following values:
Coupon Code: auto generated 6 character entry
Description: Test Coupon
Discount Amount: 0.1500
Discount Type: Percentage Discount
Start Date: 9/22/07
End Date: 9/24/07
Max Use: 1
Min Order: 0
Min Order Type: Price Total
Number Available: 100 (had this blank originally)

Thanks for any help anyone can provide.

-Chris

Perhaps try making a coupon with the minimum number of fields filled in eg no start & end date, no max use just leave them blank
,

#1522 candycanuck

  • Community Member
  • 53 posts
  • Real Name:Honey T
  • Gender:Female
  • Location:Ontario

Posted 25 September 2007, 11:33

The contrib documentation says the discount will be applied before tax, BUT....

I see many recent posts that indicate the discount is being applied AFTER tax. Since this is what I'm looking for... a gift certificate that will apply as a payment, not a change to the original sale calculation. Is there a certain version of the contribution I should be downloading? Or certain 'errors' I should make during the installation?

#1523 kgt

  • Community Member
  • 2,883 posts
  • Real Name:KG Thorson

Posted 25 September 2007, 15:39

View Postcandycanuck, on Sep 25 2007, 07:33 AM, said:

The contrib documentation says the discount will be applied before tax, BUT....

I see many recent posts that indicate the discount is being applied AFTER tax. Since this is what I'm looking for... a gift certificate that will apply as a payment, not a change to the original sale calculation. Is there a certain version of the contribution I should be downloading? Or certain 'errors' I should make during the installation?


It's more like fudging. Unless you're giving a 100% discount, the tax will always be calculated against the discounted price. People who try to use these as gift certificates (applied after tax) are fudging and accepting the small errors that can crop up trying to do it that way. Or they just don't understand what the difference is.

#1524 kgt

  • Community Member
  • 2,883 posts
  • Real Name:KG Thorson

Posted 25 September 2007, 15:44

View PosttabTalk, on Sep 23 2007, 06:20 PM, said:

I have tried this but now the coupon codes don't work please help


Cannot help much without an error message or some other info to help pinpoint the problem.

#1525 kgt

  • Community Member
  • 2,883 posts
  • Real Name:KG Thorson

Posted 25 September 2007, 15:48

View Postcatalano, on Sep 22 2007, 11:33 PM, said:

I just did a first time install. I used the version 3.3 download. I didn't use the 2 later fixes listed on that screen as I wasn't sure that they were required. The install went relatively smooth. I did get one of the common sql errors that a lot of people get.... something with the '-20,20' bit. But a quick read of the common problems got that fixed. So now I've got the module set up and created a coupon. That all went smoothly. Unfortunately when I went to do a test transaction, when I enter the discount code and click the Continue button I get a red bar across the top of the store with the message "The coupon code you have entered is not valid". I've tried several times, I'm even copying and pasting the code from the coupon creation screen. But I constantly get that message.


"The coupon code you have entered is not valid" message displays when:

1. No coupons could be found with a date range that matches today
2. No coupon could be found that matches the given code
3. A customer-level exclusion was found

Double check none of the above is true. Also TRIPLE CHECK that your dates are REAL DATES. Make sure they're "9/22/2007" and not "9/22/0007".

#1526 kgt

  • Community Member
  • 2,883 posts
  • Real Name:KG Thorson

Posted 25 September 2007, 15:51

View PostJamesS, on Sep 20 2007, 08:03 PM, said:

I could use a little help.

I have installed Discount Coupon Codes 3.3 + bug fixes
Windows Server
PHP 5.2

Once I installed the Contribution and added a New Coupon, everything appeared to be great. However, when I clicked on the hyperlink 'online catalog' in the top right hand corner of the /admin screen to take me to my web site it opened a version of my admin Screen in a very basic/ diluted way. It was a mix between the /admin index.php, and my catalog index.php. If I click the refresh button many times it would eventually open the catalog Index.php file cleanly.
However, as I would walk a test order through it would give me various errors and fatal errors, but if I clicked refresh once it would usually clean that up. And after alot of refreshing and errors I could walk the order through. Once the coupon had been used it I would not expreince this problem anymore. But if I completed a New Coupon, I would get the same issue all over again. Even if I typed my URL into the address bar I would get the same issue on my index.php file.

I have moved my Catalog folder to my root folder, would this cause any issues? I also contacted my hosting company, but they are never really any help.

Can anyone point me in the right direction with this issue? Or has anyone experienced this issue.

This is highly suspicious behavior that I would attribute to a general problem rather than something you might have done installing Discount Coupon Codes.

The text of the errors you're getting is important. Always provide the error message.

A link to your site may also help debug the problem.

#1527 kgt

  • Community Member
  • 2,883 posts
  • Real Name:KG Thorson

Posted 25 September 2007, 15:53

View Postnewbie2, on Sep 20 2007, 05:33 PM, said:

This is what I have:
$contents[] = array('text' => '<a href="' . tep_href_link(FILENAME_CATEGORIES, '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_CATALOG_CATEGORIES_PRODUCTS . '</a><br>' .
'<a href="' . tep_href_link(FILENAME_PRODUCTS_ATTRIBUTES, '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_CATALOG_CATEGORIES_PRODUCTS_ATTRIBUTES . '</a><br>' .
'<a href="' . tep_href_link(FILENAME_MANUFACTURERS, '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_CATALOG_MANUFACTURERS . '</a><br>' .
'<a href="' . tep_href_link(FILENAME_REVIEWS, '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_CATALOG_REVIEWS . '</a><br>' .
'<a href="' . tep_href_link(FILENAME_SPECIALS, '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_CATALOG_SPECIALS . '</a><br>' .
//kgt - discount coupons
'<a href="' . tep_href_link(FILENAME_PRODUCTS_EXPECTED, '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_CATALOG_PRODUCTS_EXPECTED . '</a><br>'
'<a href="' . tep_href_link(FILENAME_DISCOUNT_COUPONS, '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_CATALOG_DISCOUNT_COUPONS . '</a>' );
/***************
'<a href="' . tep_href_link(FILENAME_PRODUCTS_EXPECTED, '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_CATALOG_PRODUCTS_EXPECTED . '</a>' );
***************/
//end kgt - discount coupons

This should be due to an error in the install instructions. Make it:

$contents[] = array('text' => '<a href="' . tep_href_link(FILENAME_CATEGORIES, '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_CATALOG_CATEGORIES_PRODUCTS . '</a><br>' .
'<a href="' . tep_href_link(FILENAME_PRODUCTS_ATTRIBUTES, '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_CATALOG_CATEGORIES_PRODUCTS_ATTRIBUTES . '</a><br>' .
'<a href="' . tep_href_link(FILENAME_MANUFACTURERS, '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_CATALOG_MANUFACTURERS . '</a><br>' .
'<a href="' . tep_href_link(FILENAME_REVIEWS, '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_CATALOG_REVIEWS . '</a><br>' .
'<a href="' . tep_href_link(FILENAME_SPECIALS, '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_CATALOG_SPECIALS . '</a><br>' .
//kgt - discount coupons
'<a href="' . tep_href_link(FILENAME_PRODUCTS_EXPECTED, '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_CATALOG_PRODUCTS_EXPECTED . '</a><br>' .
'<a href="' . tep_href_link(FILENAME_DISCOUNT_COUPONS, '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_CATALOG_DISCOUNT_COUPONS . '</a>' );
/***************
'<a href="' . tep_href_link(FILENAME_PRODUCTS_EXPECTED, '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_CATALOG_PRODUCTS_EXPECTED . '</a>' );
***************/
//end kgt - discount coupons


#1528 catalano

  • Community Member
  • 104 posts
  • Real Name:Chris Catalano

Posted 25 September 2007, 17:12

Wow, I feel very ashamed now. The dates do actually show 9/22/0007. I can't believe that slipped by me. I guess that's the price of doing this stuff late at night.

Thanks for quickly pointing me to the solution.

Regards,
Chris

View Postkgt, on Sep 25 2007, 11:48 AM, said:

"The coupon code you have entered is not valid" message displays when:

1. No coupons could be found with a date range that matches today
2. No coupon could be found that matches the given code
3. A customer-level exclusion was found

Double check none of the above is true. Also TRIPLE CHECK that your dates are REAL DATES. Make sure they're "9/22/2007" and not "9/22/0007".


#1529 candycanuck

  • Community Member
  • 53 posts
  • Real Name:Honey T
  • Gender:Female
  • Location:Ontario

Posted 26 September 2007, 00:16

View Postkgt, on Sep 25 2007, 11:39 AM, said:

It's more like fudging. Unless you're giving a 100% discount, the tax will always be calculated against the discounted price. People who try to use these as gift certificates (applied after tax) are fudging and accepting the small errors that can crop up trying to do it that way. Or they just don't understand what the difference is.

Can you give an example of the small errors that would show up?

What I'm looking for:
Subtotal: $100.00 +
14% tax: $14.00 +
Gift Certificate: $20.00 -
Total Due: $94.00 =

What I expect to see based on the manual:
Subtotal: $100 +
Gift Certificate: $20 -
14% tax: $11.20 +
Total Due: $91.20 =

Is this the FULL extent of the errors, or is there more I should know about?

#1530 thor101

  • Community Member
  • 8 posts
  • Real Name:B T

Posted 26 September 2007, 15:33

I've been trying to debug this on my own, but the data appears to be stuck inside an array somewhere.

I found my bug after I upgraded to 3.3 I couldn't edit invoices anymore (change the status).

I went from 2.1 to 3.3 (so maybe I fudged something).
I turned on debug mode to test. I thought I turned it off, but...
The first customer (after upgrade) came rolling through and completed a transaction.

Now when I look at the order on the orders.php page (in edit mode)

I get this:
<--snip-->
PRODUCT TABLE  (tax, price, price, total, total)
2308	  5%	  $18.00	  $18.00	  $18.00	  $18.00
Discount Coupon C007 applied: 	-$7.40 	[INVOICE BUTTON].....
<--snip-->

Notice how it doesn't have more of the subtotal in there. Just the coupon then straight to the invoice button.
It also skips over letting me edit comments, and changing the status of the order.

So I looked at the source code of the page:


<td class="smallText" align="right">Discount Coupon C007 applied:</td>
				<td class="smallText" align="right">-$7.40

<!-- Discount Coupons DEBUG
order Object
(
	[info] => Array
		(
			[order_status] => 2
			[currency] => USD
			[currency_value] => 1.00000000
			[payment_method] => Authorize.net AIM
			[cc_typ</td>
			  </tr>
			  <tr>
				<td align="right" class="smallText">Sub-Total:</td>
				<td align="right" class="smallText">$66.60</td>
			  </tr>
			  <tr>

There is this strange HTML comment in there about debug mode, which essentially omits most of the rest of the page until it gets to a full set of comments below, at which point the unbalanced comments are cleared.

I am no longer in debug mode (I even switched into it, and out of it, to make sure that I was out of it). So is this stuck in my database now that I have to go edit?

Cheers!

--Brett

P.S. On a completely different note. Any thought of creating a new Topic for 3.3? I tried to download the entire topic so I could search for this problem, but it doesn't download the whole thing, just a small chunk of it. Just a thought.

#1531 emmetje

  • Community Member
  • 73 posts
  • Real Name:Emmetje
  • Gender:Female
  • Location:The Netherlands

Posted 26 September 2007, 20:40

Hi,

First of all I would like to thank you for writing this great contribution. I've installed it this week. I'm working with tax applaid and fixed discounts. At first I didn't get the right value but commenting out line 116 of includes/classes/discount_coupon.php fixed that.

However I'm having a problem with the Max Use number. I've set it to 1 but I can use it over and over again. In the reports the Global Number Available Remaining is -4 because it's used 5 times.

I hope you can help me out here. I'm using the latest 3.3 version.
Thanks in advance.

Edited by emmetje, 26 September 2007, 20:43.


#1532 thor101

  • Community Member
  • 8 posts
  • Real Name:B T

Posted 26 September 2007, 23:27

This is a followup to my earlier post about the problem I am having on my order total page. The following should be self explanatory. I went diving into my database:

mysql> select title,text,value,class,sort_order from orders_total where orders_id={MY_ORDER_NUM};
+------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------+--------------------+------------+
| title										  | text																																																															| value   | class			  | sort_order |
+------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------+--------------------+------------+
| Discount Coupon CD2007 applied:				| -$7.40

<!-- Discount Coupons DEBUG
order Object
(
	[info] => Array
		(
			[order_status] => 2
			[currency] => USD
			[currency_value] => 1.00000000
			[payment_method] => Authorize.net AIM
			[cc_typ | -7.4000 | ot_discount_coupon |		  1 | 
| Sub-Total:									 | $66.60																																																														  | 66.6000 | ot_subtotal		|		  3 | 
| VA TAX 5.0%:								   | $3.33																																																														   |  3.3300 | ot_tax			 |		  5 | 
| Free Shipping (For orders of $0.00 or more. ): | $0.00																																																														   |  0.0000 | ot_shipping		|		  8 | 
| Total:										 | <b>$69.93</b>																																																												   | 69.9300 | ot_total		   |		 10 | 
+------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------+--------------------+------------+
5 rows in set (0.00 sec)

As you can see, it looks as if the debug stuff got inserted into the database. WHOO WHOO!! I'm going to go try to extract it.

update orders_total set text='-$7.40' where orders_total_id=809

The line above fixed the problem. I'll have to wait until I get another customer to see if this fixes it for good. I'm guessing the only reason it got stuffed in there was because I was in debug mode. *SHRUG* I'm just happy to be able to edit my invoices again!

--Brett

#1533 kgt

  • Community Member
  • 2,883 posts
  • Real Name:KG Thorson

Posted 27 September 2007, 20:36

View Postthor101, on Sep 26 2007, 07:27 PM, said:

This is a followup to my earlier post about the problem I am having on my order total page. The following should be self explanatory. I went diving into my database:

As you can see, it looks as if the debug stuff got inserted into the database. WHOO WHOO!! I'm going to go try to extract it.

update orders_total set text='-$7.40' where orders_total_id=809

The line above fixed the problem. I'll have to wait until I get another customer to see if this fixes it for good. I'm guessing the only reason it got stuffed in there was because I was in debug mode. *SHRUG* I'm just happy to be able to edit my invoices again!

--Brett


I think you are correct. Now that you have debug off, you shouldn't run into this again. Good work figuring the problem out and solving it.

Just to clarify for everyone:
Debug Mode should NOT be left on in production stores. It really is only for debugging. It's one of those things you should be turning on just to get the information and either look at it or send it to me, and then turning off again right away. It interferes with normal operation of DCC and osCommerce in more than one way.

#1534 kgt

  • Community Member
  • 2,883 posts
  • Real Name:KG Thorson

Posted 27 September 2007, 20:51

View Postemmetje, on Sep 26 2007, 04:40 PM, said:

Hi,

First of all I would like to thank you for writing this great contribution. I've installed it this week. I'm working with tax applaid and fixed discounts. At first I didn't get the right value but commenting out line 116 of includes/classes/discount_coupon.php fixed that.

However I'm having a problem with the Max Use number. I've set it to 1 but I can use it over and over again. In the reports the Global Number Available Remaining is -4 because it's used 5 times.

I hope you can help me out here. I'm using the latest 3.3 version.
Thanks in advance.


If you're using version 3.3, what did comment out? The line that would have been commented out on line 116 was from version 2. Did you upgrade? If so, make sure you uploaded the new version of the discount_coupon.php class file.

#1535 kgt

  • Community Member
  • 2,883 posts
  • Real Name:KG Thorson

Posted 27 September 2007, 20:53

View Postcandycanuck, on Sep 25 2007, 08:16 PM, said:

Can you give an example of the small errors that would show up?

What I'm looking for:
Subtotal: $100.00 +
14% tax: $14.00 +
Gift Certificate: $20.00 -
Total Due: $94.00 =

What I expect to see based on the manual:
Subtotal: $100 +
Gift Certificate: $20 -
14% tax: $11.20 +
Total Due: $91.20 =

Is this the FULL extent of the errors, or is there more I should know about?


This is exactly the kind of discrepancy you can expect. (In the US, sales taxes are generally much smaller percentages, so the difference can usually be considered a "small error" for store owners who are trying to do this).

#1536 emmetje

  • Community Member
  • 73 posts
  • Real Name:Emmetje
  • Gender:Female
  • Location:The Netherlands

Posted 27 September 2007, 21:20

View Postkgt, on Sep 27 2007, 10:51 PM, said:

If you're using version 3.3, what did comment out? The line that would have been commented out on line 116 was from version 2. Did you upgrade? If so, make sure you uploaded the new version of the discount_coupon.php class file.

Thanks for the reply. It's a fresh 3.3 install. I've removed the comment and the value of the discount was still right. I don't understand why it didn't work correctly before but it's working so don't bother.

Sadly the other problem is still there. I can use the code unlimited altough I set the max use to 1. I hope you can help me out here.

(Sorry when my english isn't correct)

#1537 emmetje

  • Community Member
  • 73 posts
  • Real Name:Emmetje
  • Gender:Female
  • Location:The Netherlands

Posted 27 September 2007, 21:27

View Postkgt, on Sep 27 2007, 10:51 PM, said:

If you're using version 3.3, what did comment out? The line that would have been commented out on line 116 was from version 2. Did you upgrade? If so, make sure you uploaded the new version of the discount_coupon.php class file.

Ok problem solved. When reading your other post I remembered that the debugging was on. Turned it of and it works fine.

Thanks for the support anyway. You've done I great job writing this contibution and you're doing an even better supporting it.

#1538 scotch33

  • Community Member
  • 162 posts
  • Real Name:John Scotcher
  • Location:UK

Posted 28 September 2007, 12:52

Issue with % discounts and non existent discountcodes.

I am experiencing some bugs with the contribution that I wondered if anyone could advise me on.

1. the development shop is - http://www.totalfx.webserverworld.co.uk/catalog/index.php

at checkout when i apply a fixed number code (e.g. CTY5V) however if I try a % discount (e.g. RTKZQU) it fails and re-routes to the cart page.

Also, if I oput in a non existent code it simply ignores it, whereas I expected to be getting a message saying something like - 'that is not a real discount code'

Can anyone help me to solve this?

Thanks!
John.

#1539 kgt

  • Community Member
  • 2,883 posts
  • Real Name:KG Thorson

Posted 28 September 2007, 14:10

View Postscotch33, on Sep 28 2007, 08:52 AM, said:

Issue with % discounts and non existent discountcodes.

I am experiencing some bugs with the contribution that I wondered if anyone could advise me on.

1. the development shop is - http://www.totalfx.webserverworld.co.uk/catalog/index.php

at checkout when i apply a fixed number code (e.g. CTY5V) however if I try a % discount (e.g. RTKZQU) it fails and re-routes to the cart page.

Also, if I oput in a non existent code it simply ignores it, whereas I expected to be getting a message saying something like - 'that is not a real discount code'

Can anyone help me to solve this?

Thanks!
John.



See the README for help getting error messages to display on templated stores.

A redirect to the shopping cart is not really something DCC normally does. If this happens, I suspect it's the result of incompatible/conflicting contributions. I'd need more information and a copy of your checkout_confirmation.php to know more.

#1540 WootCartoons

  • Community Member
  • 158 posts
  • Real Name:Jenny
  • Gender:Female
  • Location:Ohio, USA

Posted 28 September 2007, 21:26

alright, i'm not sure what i have wrong here.... i've been trying different things and it's just not working the way it should....

I have installed the contribution and all is great. In the admin area, I set up the coupon module and then created a coupon. When I log into my account, and make an order using that code, it doesn't display on the confirmation page. I have double checked the coding per the installation and all appears to be correct. When I set it up, this is the sort order that I gave everything:

2 - discount coupon
6 - shipping
3 - subtotal
4 - tax
99 - total
5 - members discount

Then, just to see what would happen, I changed the sort order to this, switching the discount coupon and the subtotal:

3 - discount coupon
6 - shipping
2 - subtotal
4 - tax
99 - total
5 - members discount

Then the coupon discount showed up fine, except that they are out of order and a bit confusing to customers. So I played with them for quite some time trying to get it to appear right. This order would be fine if the subtotal would then NOT reflect the discount coupon. I set that in the module, but it didn't work. It then still showed the discount, and applied it AGAIN after the subtotal. So then the discount was applied twice to the order. So I changed that back to reflect the coupon discount.

Then eventually I tried changing it back to the original sort order that I wanted, and all was GREAT!!! So just to make sure, I logged out, signed in again, created a new order to test it, and it's gone again. Now when I change things around again, nothing is happening.

Please if someone could help me figure out what I have or haven't done yet, that would be great!!

My site is www.wootcartoons.com, if you would like to make an account and a test order to see. The coupon code I created is JENNY which should reflect a $20 discount. The site is live, but noone else has that code. It is only for test purposes. I will not treat the order as a real order and it will be deleted if you hapen to follow all of the way through.

Thanks so much for any help in advance!!! THANKS!!!!