Jump to content
kgt

[Contribution] Discount Coupon Codes

Recommended Posts

Hi,

My name is Matthew, I had a quick question regarding this contribution. I installed it this morning, and I noticed that once I installed it when placing a sample order that my attributes were not carrying over throughout the checkout process. I have an option type feature installed where my customer can enter text information when ordering and the text is what is not carrying over. There is just a blank line where the information should be.The first page I noticed it missing is the "checkout confirmation.php page.

 

Do you happen to know if anyone else having these issues?

Any help would be greatly appreciated.

 

Regards,

 

Matthew

Share this post


Link to post
Share on other sites
Thanks for the very cool module. I'm having a similar problem to the other people over the past few posts, where my order total is incorrect. In my case, it's not just happening when I have multiple items in the cart, though. It happens with only one item, as well.

Update:

After carefully checking over all the edited code and making sure everything was exactly as it was supposed to be, I checked my settings over again and was able to make the total calculate correctly with the following settings:

 

Sort order: 1 - Discount Coupon, 2 - Sub-Total, 3 - Tax, 4 - Shipping, 5 - Total.

Display discount with minus (-) sign? - True

Display subtotal with applied discount? - True

Display tax in discount line? - None

Exclude product specials? - True

Random Code Length - 6

Display discount total lines for each tax group? - False

Allow negative order total? - False

Use the language file to format display string? - False

Display Format for Order Total Line - Discount Coupon "[coupon_desc]" applied ([discount_amount])

Debug Mode - false

 

These settings work correctly for single items and multiple items, so it looks like your bug fix worked, KGT.

 

Thanks very much for the clean code!

 

Stace


The soul is greater than the hum of its parts. -- Douglas R. Hofstadter in Gödel, Escher, Bach

Share this post


Link to post
Share on other sites

Hello!

Thanksfor the contribution.. I'm having problems working with it though. After installing/editing all appropriate files, I'm directed to create the coupons by going to Catalog > Discount Coupons. But I can't seem to to find any link to the Coupons anywhere! Can someone please direct me to where/what I must do?? Also, let me know what files I need to show. Thanks so much..

Share this post


Link to post
Share on other sites
Hello!

Thanksfor the contribution.. I'm having problems working with it though. After installing/editing all appropriate files, I'm directed to create the coupons by going to Catalog > Discount Coupons. But I can't seem to to find any link to the Coupons anywhere! Can someone please direct me to where/what I must do?? Also, let me know what files I need to show. Thanks so much..

 

 

Same here. I installed, enable the module and there wasn't any errors occur. But when I go to Catalog > Discount Coupons to create a coupon, I could NOT find Discount Coupons under Catalog. What could be wrong ???

Share this post


Link to post
Share on other sites
Hi KGT,

 

Thanks for the very cool module. I'm having a similar problem to the other people over the past few posts, where my order total is incorrect. In my case, it's not just happening when I have multiple items in the cart, though. It happens with only one item, as well.

 

I downloaded the package yesterday, but I believe I downloaded it after you had already applied the bug fix. When I compare the file timestamps and sizes in the current package and those in the one I installed, the only differences I see are in the timestamps on the folder creation.

 

Can you let me know which files changed in the bugfix so I can compare them against the files I have installed, rather than going through the whole installation procedure again?

 

Thanks,

Stace

 

 

The files that changed in version 3.3 were includes/classes/order.php and includes/classes/discount_coupon.php. You can also check the install instructions for that version to get both a complete list of new files and a list of the changed files.

 

If your installation still looks correct, see the manual for help on obtaining a debug output and send that to me via email or PM.


Contributions

 

Discount Coupon Codes

Donations

Share this post


Link to post
Share on other sites
Hi,

My name is Matthew, I had a quick question regarding this contribution. I installed it this morning, and I noticed that once I installed it when placing a sample order that my attributes were not carrying over throughout the checkout process. I have an option type feature installed where my customer can enter text information when ordering and the text is what is not carrying over. There is just a blank line where the information should be.The first page I noticed it missing is the "checkout confirmation.php page.

 

Do you happen to know if anyone else having these issues?

Any help would be greatly appreciated.

 

Regards,

 

Matthew

 

When you installed DCC, you probably overwrote some necessary code in includes/classes/order.php. Did you install manually or did you just upload the DCC files from the install zip? If you edited order.php manually, double-check against a backup to see if any of the option type feature code is missing. If you just uploaded the files from the install zip, then you've overwritten the code for the option type feature changes. You'll need to restore from backup and edit that file manually for DCC to get both installed.

 

(I am making a guess that the conflict is in includes/classes/order.php. It is possible the conflict is actually elsewhere, but that's the most obvious place.)


Contributions

 

Discount Coupon Codes

Donations

Share this post


Link to post
Share on other sites
Hello!

Thanksfor the contribution.. I'm having problems working with it though. After installing/editing all appropriate files, I'm directed to create the coupons by going to Catalog > Discount Coupons. But I can't seem to to find any link to the Coupons anywhere! Can someone please direct me to where/what I must do?? Also, let me know what files I need to show. Thanks so much..

 

 

Revisit the install instructions for admin/includes/boxes/catalog.php. You're probably just missing the changes to that file.


Contributions

 

Discount Coupon Codes

Donations

Share this post


Link to post
Share on other sites
Same here. I installed, enable the module and there wasn't any errors occur. But when I go to Catalog > Discount Coupons to create a coupon, I could NOT find Discount Coupons under Catalog. What could be wrong ???

 

 

Make sure you have edited admin/includes/boxes/catalog.php.


Contributions

 

Discount Coupon Codes

Donations

Share this post


Link to post
Share on other sites
The files that changed in version 3.3 were includes/classes/order.php and includes/classes/discount_coupon.php. You can also check the install instructions for that version to get both a complete list of new files and a list of the changed files.

 

If your installation still looks correct, see the manual for help on obtaining a debug output and send that to me via email or PM.

Hi KG,

 

I updated with post #1252 earlier, saying that everything was working correctly. Thanks, though, for your response and willingness to help. You wrote an excellent contribution. :thumbsup:

Edited by Lytspeed

The soul is greater than the hum of its parts. -- Douglas R. Hofstadter in Gödel, Escher, Bach

Share this post


Link to post
Share on other sites
Make sure you have edited admin/includes/boxes/catalog.php.

 

Thanks you for your contribution and your kindness of helping out. Actually, I didn't finish the installation yet. I thought all I need is upload the files and done. But no, I have to edit existing file as well. Just start up the site, if it make some revenues, I will definitely donate some for your contribution.

 

Good luck.

Share this post


Link to post
Share on other sites
Revisit the install instructions for admin/includes/boxes/catalog.php. You're probably just missing the changes to that file.

 

Thanks for your help. I did double-check this, and I forgot to edit the file. But after I did, I still can't see the link for the coupons. And after editing the file, I also get an error when I click on any of the links in my admin panel. The error I get is:

 

Parse error: parse error, unexpected '*' in /home/content/f/a/i/faith/html/catalog/admin/includes/boxes/catalog.php on line 40

 

I checked the catalog.php file and I don't see what I'm doing wrong.. I did just what the manual said. Please help!!! Thanks in advance..

Share this post


Link to post
Share on other sites
Thanks you for your contribution and your kindness of helping out. Actually, I didn't finish the installation yet. I thought all I need is upload the files and done. But no, I have to edit existing file as well. Just start up the site, if it make some revenues, I will definitely donate some for your contribution.

 

Good luck.

 

 

PM or email me your code for that file and I will take a look at it.


Contributions

 

Discount Coupon Codes

Donations

Share this post


Link to post
Share on other sites

I'm really excited to find this contribution. I thought all installed properly, but when I try to get to the checkout_payment.php, I get an error message instead of the page:

 

Fatal error: Cannot redeclare tep_show_category() (previously declared in /home/kylor12/public_html/includes/header.php:263) in /home/kylor12/public_html/includes/boxes/categories.php on line 13

 

I didn't see anything about it in the common problems and I have no idea what it means. Any help would be appreciated.


Kylor12

 

Use recent eBay® changes to YOUR advantage. FREE AUDIO tells how.

Share this post


Link to post
Share on other sites
I'm really excited to find this contribution. I thought all installed properly, but when I try to get to the checkout_payment.php, I get an error message instead of the page:

 

Fatal error: Cannot redeclare tep_show_category() (previously declared in /home/kylor12/public_html/includes/header.php:263) in /home/kylor12/public_html/includes/boxes/categories.php on line 13

 

I didn't see anything about it in the common problems and I have no idea what it means. Any help would be appreciated.

 

 

You have a template installed and template makers like to move that function to the header. Remove the tep_show_category() function from includes/boxes/categories.php.


Contributions

 

Discount Coupon Codes

Donations

Share this post


Link to post
Share on other sites

Hi KG et al.,

 

I love the Discount Coupon Codes 3.3 contribution, but I'm having a problem and I'm curious whether anyone else has a solution.

 

I'm using OSC 2.2 MS2, with the Website Payments Pro contribution. All works fine except the following:

 

I have set up a staff discount of 55%. A member of the staff ordered 12 of the same item at discount, and it worked fine. However, 2 staff members have tried ordering 2 different items at discount (identical orders, same price for both items), and OSC errors out on the checkout_confirmation.php file. The PayPal error dump returns the following error (summarized):

 

"Transaction refused because of an invalid argument. See additional error messages for details. Item total is invalid. (Error code10426)"

 

Here's what I think is happening:

 

When a staff member orders 12 $14.95 items at 55% discount, the total is $179.40 - 55% ($98.67) = $80.73

When a staff member orders 2 $14.95 items at 55% discount, the total is $29.90 - 55% ($16.445) = $13.455

 

If OSC is sending the order total amount to PayPal without truncating or rounding the total to two digits, that is causing PayPal to refuse the order as having an invalid total.

 

When a shopper orders something on special using the specials built into OSC, this doesn't happen, so I'm guessing it was introduced by Discount Coupon Codes 3.3.

 

What files do I need to modify in Discount Coupon Codes 3.3 in order to ensure it passes a two digit number to PayPal? Obviously, I need to put a rounding statement in there somewhere, but I'm having trouble identifying where.

 

Thanks much for any help, and thanks again for a great contrib, KG.

 

Stace


The soul is greater than the hum of its parts. -- Douglas R. Hofstadter in Gödel, Escher, Bach

Share this post


Link to post
Share on other sites

My "Discount Codes Coupon Usage Information Report" does not Update after coupon use! All else seems to work fine. :'(

Share this post


Link to post
Share on other sites
You have a template installed and template makers like to move that function to the header. Remove the tep_show_category() function from includes/boxes/categories.php.

 

 

Thanks, KGT, it's working great. I really appreciate this mod...people love discounts.

 

kylor12


Kylor12

 

Use recent eBay® changes to YOUR advantage. FREE AUDIO tells how.

Share this post


Link to post
Share on other sites

I installed the latest version (3.3) and am getting the following error when trying to create a coupon:

 

1054 - Unknown column 'coupons_discount_percent' in 'field list'

insert into discount_coupons ( coupons_id, coupons_description, coupons_discount_percent, coupons_date_start, coupons_date_end, coupons_max_use, coupons_min_order, coupons_max_order, coupons_number_available) values ('dcao10', 'Abandoned order incentive discout', '0.10', null, null, 0, 0, 0, 10)

[TEP STOP]

 

All files were uploaded (double-checked) and all existing files were changed. Any idea why?

Share this post


Link to post
Share on other sites
Hi KG et al.,

 

I love the Discount Coupon Codes 3.3 contribution, but I'm having a problem and I'm curious whether anyone else has a solution.

 

I'm using OSC 2.2 MS2, with the Website Payments Pro contribution. All works fine except the following:

 

I have set up a staff discount of 55%. A member of the staff ordered 12 of the same item at discount, and it worked fine. However, 2 staff members have tried ordering 2 different items at discount (identical orders, same price for both items), and OSC errors out on the checkout_confirmation.php file. The PayPal error dump returns the following error (summarized):

 

"Transaction refused because of an invalid argument. See additional error messages for details. Item total is invalid. (Error code10426)"

 

Here's what I think is happening:

 

When a staff member orders 12 $14.95 items at 55% discount, the total is $179.40 - 55% ($98.67) = $80.73

When a staff member orders 2 $14.95 items at 55% discount, the total is $29.90 - 55% ($16.445) = $13.455

 

If OSC is sending the order total amount to PayPal without truncating or rounding the total to two digits, that is causing PayPal to refuse the order as having an invalid total.

 

When a shopper orders something on special using the specials built into OSC, this doesn't happen, so I'm guessing it was introduced by Discount Coupon Codes 3.3.

 

What files do I need to modify in Discount Coupon Codes 3.3 in order to ensure it passes a two digit number to PayPal? Obviously, I need to put a rounding statement in there somewhere, but I'm having trouble identifying where.

 

Thanks much for any help, and thanks again for a great contrib, KG.

 

Stace

 

 

The order total stored in the database has four digits after the decimal point. I think the reason you've never run into this problem before is simply that there aren't many chances for the order total to have more than two digits after the decimal point until you introduce a discount. The rounding is something that really probably should be done in the Paypal module.

 

If you PM or email me the code for your paypal module (found in includes/modules/payment/name_of_paypal_module.php, then I can take a look at it for you. What I will be adding is something like this:

 

global $currencies;
$order_total = number_format($order->info['total'] * $currencies->get_value($my_currency), $currencies->get_decimal_places($my_currency));

 

And replace all instances of $order->info['total'] with $order_total (the rounded version of $order->info['total']).

 

By the way, good job on the debugging. I think you're probably correct on the reason for the error.


Contributions

 

Discount Coupon Codes

Donations

Share this post


Link to post
Share on other sites
I installed the latest version (3.3) and am getting the following error when trying to create a coupon:

 

1054 - Unknown column 'coupons_discount_percent' in 'field list'

insert into discount_coupons ( coupons_id, coupons_description, coupons_discount_percent, coupons_date_start, coupons_date_end, coupons_max_use, coupons_min_order, coupons_max_order, coupons_number_available) values ('dcao10', 'Abandoned order incentive discout', '0.10', null, null, 0, 0, 0, 10)

[TEP STOP]

 

All files were uploaded (double-checked) and all existing files were changed. Any idea why?

 

 

Did you upgrade or install from scratch? The problem file is admin/coupons.php. The SQL statement above is from versions 2.* of DCC. Triple check that file.


Contributions

 

Discount Coupon Codes

Donations

Share this post


Link to post
Share on other sites
My "Discount Codes Coupon Usage Information Report" does not Update after coupon use! All else seems to work fine. :'(

 

 

Double check the code you added to checkout_process.php. Also, if you're using Paypal IPN, see the README. There's an additional step you need to take to get it working.


Contributions

 

Discount Coupon Codes

Donations

Share this post


Link to post
Share on other sites
Did you upgrade or install from scratch? The problem file is admin/coupons.php. The SQL statement above is from versions 2.* of DCC. Triple check that file.

I installed 3.3 from scratch. In another shop I upgraded all the way from 2.2 with no problem.

Share this post


Link to post
Share on other sites
I installed 3.3 from scratch. In another shop I upgraded all the way from 2.2 with no problem.

 

 

The SQL you posted is not from version 3.3. Try downloading the package again and uploading admin/coupons.php again. I'm not sure what's happened, but it seems you have an old version of that file up there.


Contributions

 

Discount Coupon Codes

Donations

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×