Jump to content
kgt

[Contribution] Discount Coupon Codes

Recommended Posts

You've got a template, and for some reason template makers seem to like putting things in places they don't belong. However, that's not really your problem. It's looks like your real problem is that you uploaded admin/includes/boxes/categories.php to catalog/includes/boxes/categories.php. That file should be in the admin directory. You'll need to restore categories.php from a backup and re-upload admin/includes/boxes/categories.php to the correct directory.

 

There does not seem to be a admin/includes/boxes/categories.php in either this contribution or in the scCommerce full download. The categories box shows up just fine in the store. I don't beleive that there is a categories box in the admin.

 

I'm not sure how you knew that I have a template, but that is correct. Could that have something to do with this problem? If so, how can I go about fixing it.

 

Thanks.

Share this post


Link to post
Share on other sites
There does not seem to be a admin/includes/boxes/categories.php in either this contribution or in the scCommerce full download. The categories box shows up just fine in the store. I don't beleive that there is a categories box in the admin.

 

I'm not sure how you knew that I have a template, but that is correct. Could that have something to do with this problem? If so, how can I go about fixing it.

 

Thanks.

 

I'm sorry, you're correct. I was thinking of admin/includes/boxes/catalog.php, not categories.php.

 

I knew you had a template because this is a common problem with templates. Do a google search for your error, and you should be able to find some solutions.


Contributions

 

Discount Coupon Codes

Donations

Share this post


Link to post
Share on other sites

Hi,

 

I have everything properly installed (as far as I know) and when I go to the /admin/coupons.php page, it is giving me this error . Keep in mind my admin interface is still intact, it's spitting out this error where the content should be:

 

 

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 '-9, 9' at line 1

select * from discount_coupons cd order by cd.coupons_date_end, coupons_date_start limit -9, 9

[TEP STOP]

Share this post


Link to post
Share on other sites
You're getting a fatal error, but you have display errors turned off (which is why you get a blank screen). It's pointless to just guess at the error (though you might try commenting out line 14 in includes/modules/order_total/ot_discount_coupon.php since it tends to give people problems). I recommend setting up a test site so you can make sure everything is error-free before going live. Add the following two lines to the top of includes/application_top.php to turn on error reporting so you can find out what the error is:

 

ini_set('error_reporting', E_ALL);

ini_set('display_errors', 1);

 

I commented out like 14 as suggested and still no luck. It seems to stall between the checkout_confirmation.php file and the checkout_payment.php files.

 

 

Running the error reporting script it came up with the following error messages:

 

Notice: Constant FILENAME_ADDITIONAL_INFO already defined in /var/www/vhosts/vogueknitting.com/httpdocs/books/includes/application_top.php on line 537
This line only contained an "//END" comment.

 

Notice: Undefined offset: 0 in /var/www/vhosts/vogueknitting.com/httpdocs/books/includes/classes/boxes.php on line 124

<i> line 124 reads: 'text' => $contents[0]['text']),

 

 

Any thoughts?

Share this post


Link to post
Share on other sites

I am having a strange problem. When I create a coupon with a .1 in the percentage discount field, it corectly shows in the admin as 10%, but in checkout_confirmation.pgp the discount ends up being way off. For example, a cart total of 1610.99 is discounted $511.99, which is about 32%.

 

A flat discout of $1.23 end up being a discount of $1.62 for the same cart as above and shows in the admin as being a discount of 24.6%.

 

I'm using Discount Coupon Codes 2.1 with MySQL 4.0 and PHP 5

 

Any ideas?

Thanks.

Share this post


Link to post
Share on other sites
Hi!

 

This does not work with PayPal IPN 1.4!!!

 

Installed the contrib. "Discount Coupon Codes 2.1 with Paypal IPN v1.4" but still no chance

Share this post


Link to post
Share on other sites

Nice addition, but I am having a problem on the cart side on the Payment Information page. I get the following errors:

 

Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at /home/httpd/vhosts/americanswing.com/httpdocs/oscommerce/catalog/checkout_payment.php:2) in /home/httpd/vhosts/americanswing.com/httpdocs/oscommerce/catalog/includes/functions/sessions.php on line 67

 

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/httpd/vhosts/americanswing.com/httpdocs/oscommerce/catalog/checkout_payment.php:2) in /home/httpd/vhosts/americanswing.com/httpdocs/oscommerce/catalog/includes/functions/sessions.php on line 67

 

I did make sure all the files in 1A are uploaded and after going over all the posts in this forum I have tried to be sure I did everything posted, but to no avail. Any suggestions?

Share this post


Link to post
Share on other sites

Thanks for the contrib! I installed, configured a coupon code, and when I input the coupon code on checkout_payment.php I get this error.

 

"Warning: Invalid argument supplied for foreach() in /../includes/classes/discount_coupon.php on line 62"

 

Anybody know why? I couldn't find anything on it in the thread.

 

Also, my fix to this common problem

 

Fatal error: Cannot redeclare class discount_coupon in

***path to shop***/includes/classes/discount_coupon.php on line 14.

 

was to change this line in includes/classes/discount_coupon.php

 

from

 

require_once( DIR_FS_CATALOG.DIR_WS_CLASSES.'discount_coupon.php' );

 

to

 

require_once( DIR_FS_CATALOG . '/' . DIR_WS_CLASSES.'discount_coupon.php' );


Brian Christensen

Share this post


Link to post
Share on other sites
Thanks for the contrib! I installed, configured a coupon code, and when I input the coupon code on checkout_payment.php I get this error.

 

"Warning: Invalid argument supplied for foreach() in /../includes/classes/discount_coupon.php on line 62"

 

Anybody know why? I couldn't find anything on it in the thread.

 

Also, my fix to this common problem

 

Fatal error: Cannot redeclare class discount_coupon in

***path to shop***/includes/classes/discount_coupon.php on line 14.

 

was to change this line in includes/classes/discount_coupon.php

 

from

 

require_once( DIR_FS_CATALOG.DIR_WS_CLASSES.'discount_coupon.php' );

 

to

 

require_once( DIR_FS_CATALOG . '/' . DIR_WS_CLASSES.'discount_coupon.php' );

Disregard the first part of my post, forgot to upload one file......doh!


Brian Christensen

Share this post


Link to post
Share on other sites

Hi,

 

This past weekend I added the Paypal IPN version (osCommerce PayPal IPN Module v2.2 For 2.2MS2) to my site and it appears to have put a kink into the discount coupon code contribution. I looked at the addition you uploaded for ver 1.4 and tried that, it still does not work. Any ideas?

 

Again thank you for all your help in the past...

 

Steve

Share this post


Link to post
Share on other sites
Hi,

 

This past weekend I added the Paypal IPN version (osCommerce PayPal IPN Module v2.2 For 2.2MS2) to my site and it appears to have put a kink into the discount coupon code contribution. I looked at the addition you uploaded for ver 1.4 and tried that, it still does not work. Any ideas?

 

Again thank you for all your help in the past...

 

Steve

 

 

The problems with Paypal IPN stem from the fact that that payment module deviates from the standard way osCommerce payment modules work. In order to keep DCC working with IPN, I have to download the latest version and see what they've done. I promise to do that as soon as I have the time, but it probably won't be today or tomorrow.

 

If you're decent with code, you can open checkout_process.php and includes/modules/payment/paypalIPN.php and compare them. There aren't many changes that have to happen to get it working, but they have to be redone for every IPN release.


Contributions

 

Discount Coupon Codes

Donations

Share this post


Link to post
Share on other sites

Hi kgt,

 

It only works if you set the PayPal Transaction Type to Aggregate but not as per Item. It would be nice if you could find a fix ASAP.

 

Thanx

Share this post


Link to post
Share on other sites
It only works if you set the PayPal Transaction Type to Aggregate but not as per Item. It would be nice if you could find a fix ASAP.

 

 

This is due to Paypal's own limitations. There's nothing I can do about it, since I have no influence over what Paypal chooses to support. This is a problem shared by all discount contributions. I agree it's annoying and limiting, but aggregate is simply the only way you can properly pass discounts to Paypal.


Contributions

 

Discount Coupon Codes

Donations

Share this post


Link to post
Share on other sites

I just upgraded my Discount Coupons installation with the Apr. 20 bug fixes version. I really like the ability to edit now! The issue I seem to be having is with FIXED DISCOUNTS.

 

I enter, for example, a fixed discount of 49.99 for a minimum purchase of $1774 and when I apply it a percentage shows up of something like 0.0003 and when tested the discount works out to about 30 cents on a nearly $2000 purchase.

 

I can just stick with percentages but was wondering what this behavior was.

 

Anthony

Share this post


Link to post
Share on other sites

I'm having a problem with the discount carrying over to Paypal. When a customer has applied the discount, the updated total appears in the osC cart but the discount is gone when they get to Paypal.

 

Any suggestions?

Share this post


Link to post
Share on other sites

Version 3.0 has been uploaded.

 

http://www.oscommerce.com/community/contributions,4269

 

Bug Fixes:

  • Reduced possibility of inaccurate discounts due to rounding errors.
  • Fixed bug that limited discount to item price (should not be done for fixed discounts).

Other Changes:

  • True fixed discounts added.
  • Shipping discounts added.
  • Exclusions based on products, categories, manufacturers, and customers added.
  • TracyS provided code for an additional exclusion type, shipping zones.
  • Added new coupon minimum types "product quantity" and "price total" to limit coupon usage depending on cart item quantity or price total, respectively.
  • Added module configuration option to toggle whether product specials are excluded.
  • Added module configuration option to toggle whether order totals are allowed to be negative (can happen if you create a fixed discount with a discount amount greater than the minimum order).
  • Added a module configuration option to toggle whether debugging should be on.


Contributions

 

Discount Coupon Codes

Donations

Share this post


Link to post
Share on other sites
I'm having a problem with the discount carrying over to Paypal. When a customer has applied the discount, the updated total appears in the osC cart but the discount is gone when they get to Paypal.

 

 

We'd need to know more details, like what paypal module you're using, and what other contributions you have installed.


Contributions

 

Discount Coupon Codes

Donations

Share this post


Link to post
Share on other sites

After upgrading to version 3.0 and creating a test coupon I get the following error after I press Insert:

 

 

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 ('t12', 't12', '0.000253292806484', null, null, 1, 1974, 1974, 1)

 

[TEP STOP]

 

 

Also, on the coupon creation page the following do not appear to be defined:

TEXT_DISCOUNT_COUPONS_PERCENT

TEXT_DISCOUNT_COUPONS_FIXED

TEXT_DISCOUNT_COUPONS_MAX_ORDER

 

Anthony

Share this post


Link to post
Share on other sites
After upgrading to version 3.0 and creating a test coupon I get the following error after I press Insert:

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 ('t12', 't12', '0.000253292806484', null, null, 1, 1974, 1974, 1)

 

[TEP STOP]

Also, on the coupon creation page the following do not appear to be defined:

TEXT_DISCOUNT_COUPONS_PERCENT

TEXT_DISCOUNT_COUPONS_FIXED

TEXT_DISCOUNT_COUPONS_MAX_ORDER

 

Anthony

 

 

Please revisit the install instructions. It appears you have not uploaded all the files necessary.


Contributions

 

Discount Coupon Codes

Donations

Share this post


Link to post
Share on other sites

GAF Alert! Sorry guys, I missed the upload of admin/includes/functions/coupons.php. All is okay. Great upgrade!

 

Anthony

Share this post


Link to post
Share on other sites

GAF Alert! Sorry guys, I missed the upload of admin/includes/functions/coupons.php. All is okay. Great upgrade!

 

Anthony

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

×