Jump to content
kgt

[Contribution] Discount Coupon Codes

Recommended Posts

Hello

 

With install I had no problem - no errors. I add UNIQUE number in admin ( sub-total 1, discount 2, shipping 3, tax 4, total 5 ), but in Confirmation there is no discounts ( only sub-total, shipping, tax, total )!

 

Thx,

 

drumer979

Share this post


Link to post
Share on other sites

Installed and testing great - well done - BUT I NEED HELP!!!![/b] please.

 

Members will recieve a 100% discount for a period of time when downloading data only - Also using add-on Quantity Discount.

 

The problem I'm having is that I cant get past the payment details page - thats fine for non-members.

 

Is there a code that I can write in somewhere, that would go something like - if total equals $0.00 or -$x.00, then mark as payment received or something like that - this would allow the customer to get their download details for the items they want.

 

I'm just passed a newbie, so please be gentle with me :blush: I follow instructions very well.

 

thanks heaps!

Have you looked into the add-ons that allow for free pricing? - I'm sure there are a few in the add-ons section. Then you could test your total, and this would make a 'free payment' module active, which they would tick to progress. Also, another idea might be the SPPC (customer specific pricing) module? You can categorise your customers, and give them free prices on certain products for a period if you wish. It might be a bitch to integrate, but it works very well. One last little thing (you're a newbie, so I'll be gentle): please don't put I NEED HELP in capitals bold etc. It makes you look like a TXTing bogun from Sunshine :)

Edited by p2409

OSC User Definitions

"I can add modules to OSC" = I can search, cut and paste. But not well, or I wouldn't be here.

"I start my posting with 'works like a charm' = I'm letting you down gently, nothing works and I have no idea why

"I finish postings with "plzzzz....hlp" = My installation is buggered and I know I'm going to have to pay someone, but I really, really don't want to.

Share this post


Link to post
Share on other sites

Is it possible for someone to fill me in the other steps that are involved in this process. I installed this code as it says in the instructions but when I go to my admin>catalog, I do not see the discount coupon config to install it. What am I missing?

 

I am not knowledgeable at all in this and a step by step scenario would really help me to figure out how to install this.

 

Thank you everyone for your time.

If you can't see it in Admin, I'd check that the SQL that updates the configuation file actually did run and secondly, that you correctly modified a 'boxes' directory file somewhere properly. These two things are what makes an option appear in Admin.


OSC User Definitions

"I can add modules to OSC" = I can search, cut and paste. But not well, or I wouldn't be here.

"I start my posting with 'works like a charm' = I'm letting you down gently, nothing works and I have no idea why

"I finish postings with "plzzzz....hlp" = My installation is buggered and I know I'm going to have to pay someone, but I really, really don't want to.

Share this post


Link to post
Share on other sites

Have you looked into the add-ons that allow for free pricing? - I'm sure there are a few in the add-ons section. Then you could test your total, and this would make a 'free payment' module active, which they would tick to progress. Also, another idea might be the SPPC (customer specific pricing) module? You can categorise your customers, and give them free prices on certain products for a period if you wish. It might be a bitch to integrate, but it works very well. One last little thing (you're a newbie, so I'll be gentle): please don't put I NEED HELP in capitals bold etc. It makes you look like a TXTing bogun from Sunshine :)

 

 

I also want to be able to do this. I want to give a discount coupon that gives a free download. Fine if they purchase something in addition. But, if they only want to redeem the one coupon, and their total is $0, then they still have to enter a credit card. I want to be able to bypass the credit card requirement if the total is zero.

 

I've searched high and low and cannot find a contribution that meets this need. I searched again today based on your suggestion that there is an addon that does this, but haven't found it.

 

Do you know what contribution / add-on will do this? Bypass the payment part of checkout if the total, after discount, is zero?

 

I tried:

 

"paymentFree"

http://addons.oscommerce.com/info/6447

But this just makes an additional payment option of Free. So, with my $20 order, I can either enter my credit card, or check "free" option and checkout without paying. Don't understand why someone would want that.

 

"Free Of Charge Payment Module"

http://addons.oscommerce.com/info/3342

I read that This is based on the total product in the basket, so it does not include discounts.

I installed it and enabled it, but it did not show up during checkout. I didn't work at all for me. Don't know why.

 

 

"Skip checkout_payment.php when goods value is ZERO "

http://addons.oscommerce.com/info/3747

Doesn't work. Too simplistic, too old, not sure. This would be good if it worked.

Share this post


Link to post
Share on other sites

i solved the problem.

I also installed DC V-3.32 onto a RC2A ver store. This is a test store. I received same error as you did, The coupon code you have entered is not valid.[/font]

 

you posted issue resolved. Could you please post your solution so that I can get this working? Also there might be someone else out there who will run into this situation. Did check in admin, and it is enabled.

 

Thank you.

 

Bennett

Share this post


Link to post
Share on other sites

Easy question - which of the numerous contrib downloads do I need to select to get this working? Overwhelmed by x updates, annotations, auto-installers, Spanish versions etc.

 

Are there any major problems that should prevent me from installing the contrib?

 

Thanks in advance!

Gila

Share this post


Link to post
Share on other sites

Sorry to repost this, but reading my post, it does not make sense.

 

I also installed DC V-3.32 onto a RC2A ver store. This is a test store. I received same error as stated in Post 2496, The coupon code you have entered is not valid coupon. Then that same member in POST # 2498, stated that he/she resolved the isssue.

 

So I am asking if that member or any other member for the solution on why this is happening. Did check in admin, and it is enabled. Also in catalog/products ->Discount Coupon to make sure all fields were correct.

 

Thank you.

 

Bennett

Share this post


Link to post
Share on other sites

Thanks - it's running smoothly. At least since I used the updated order.php and used 0.10 instead of 10 when adding a 10% discount a080.gif Yes, it is late. I only caught that error when I switched to "display in sub-total"... and had a $2000 discount = 1000%.

Share this post


Link to post
Share on other sites

First of all, thanks for a discount coupon codes contribution that actually works!! :)

Sorry if this has been answered before, there are 130 pages here. Just let me know.

 

I've set "Display subtotal with applied discount" to false since I want the subtotal above the discount, like this;

 

Subtotal

Discount

Tax

Total

 

When doing this everything looks fine except the total sum. The total sum is actually calculated as sub total (products) including tax minus discount excluding tax. The subtracted discount calculation in the total sum should, of course, be including tax.

 

When setting "display subtotal with applied discount" as true, everything looks fine and the total sum is calculated correctly. However, I don't want to apply discount to sub total as I think that may be indistinct for the customer, especially with the sort order above (subtotal - discount = total)

 

If any one knows why or how to fix it, pleas let me know. Thanks!

Edited by Fredrik.r

Share this post


Link to post
Share on other sites

Absolutely not sure, but have you checked this entry in admin:

 

Display tax in discount line?

Select the method for displaying tax in the discount line.

None

Display discounted tax in separate line

Display discount with discounted tax applied

Share this post


Link to post
Share on other sites

Absolutely not sure, but have you checked this entry in admin:

 

Display tax in discount line?

Select the method for displaying tax in the discount line.

None

Display discounted tax in separate line

Display discount with discounted tax applied

 

Yes, thanks, but it wont help. I need to use "Display discount with discounted tax applied"

Edited by Fredrik.r

Share this post


Link to post
Share on other sites

Ok so if i have PayPal payment standard = true then coupons work fine, but if i use Paypal Payment Pro coupons do not work. On the final page through the checkout process where it supposed to show the amount deducted from the subtotal - it doesnt.

 

Does anyone have a fix for this or can help?

 

I am having the same problem with Paypal Express Checkout. Does anyone have a solution?

Share this post


Link to post
Share on other sites

I am having the same problem with Paypal Express Checkout. Does anyone have a solution?

 

Update to this issue. If I did not confirm the order and go through the check out process again, the discount shows up on the order confirmation page. I am thinking this is related to the code in checkout_confirmation here? something to do with the session?

 

//kgt - discount coupons

if( tep_not_null( $coupon ) && is_object( $order->coupon ) ) { //if they have entered something in the coupon field

$order->coupon->verify_code();

if( MODULE_ORDER_TOTAL_DISCOUNT_COUPON_DEBUG != 'true' ) {

if( !$order->coupon->is_errors() ) { //if we have passed all tests (no error message), make sure we still meet free shipping requirements, if any

if( $order->coupon->is_recalc_shipping() ) tep_redirect( tep_href_link( FILENAME_CHECKOUT_SHIPPING, 'error_message=' . urlencode( ENTRY_DISCOUNT_COUPON_SHIPPING_CALC_ERROR ), 'SSL' ) ); //redirect to the shipping page to reselect the shipping method

} else {

if( tep_session_is_registered('coupon') ) tep_session_unregister('coupon'); //remove the coupon from the session

tep_redirect( tep_href_link( FILENAME_CHECKOUT_PAYMENT, 'error_message=' . urlencode( implode( ' ', $order->coupon->get_messages() ) ), 'SSL' ) ); //redirect to the payment page

}

}

} else { //if the coupon field is empty, unregister the coupon from the session

if( tep_session_is_registered('coupon') ) { //we had a coupon entered before, so we need to unregister it

tep_session_unregister('coupon');

//now check to see if we need to recalculate shipping:

require_once( DIR_WS_CLASSES.'discount_coupon.php' );

if( discount_coupon::is_recalc_shipping() ) tep_redirect( tep_href_link( FILENAME_CHECKOUT_SHIPPING, 'error_message=' . urlencode( ENTRY_DISCOUNT_COUPON_SHIPPING_CALC_ERROR ), 'SSL' ) ); //redirect to the shipping page to reselect the shipping method

}

}

//end kgt - discount coupons

Share this post


Link to post
Share on other sites

Update to this issue. If I did not confirm the order and go through the check out process again, the discount shows up on the order confirmation page. I am thinking this is related to the code in checkout_confirmation here? something to do with the session?

 

//kgt - discount coupons

if( tep_not_null( $coupon ) && is_object( $order->coupon ) ) { //if they have entered something in the coupon field

$order->coupon->verify_code();

if( MODULE_ORDER_TOTAL_DISCOUNT_COUPON_DEBUG != 'true' ) {

if( !$order->coupon->is_errors() ) { //if we have passed all tests (no error message), make sure we still meet free shipping requirements, if any

if( $order->coupon->is_recalc_shipping() ) tep_redirect( tep_href_link( FILENAME_CHECKOUT_SHIPPING, 'error_message=' . urlencode( ENTRY_DISCOUNT_COUPON_SHIPPING_CALC_ERROR ), 'SSL' ) ); //redirect to the shipping page to reselect the shipping method

} else {

if( tep_session_is_registered('coupon') ) tep_session_unregister('coupon'); //remove the coupon from the session

tep_redirect( tep_href_link( FILENAME_CHECKOUT_PAYMENT, 'error_message=' . urlencode( implode( ' ', $order->coupon->get_messages() ) ), 'SSL' ) ); //redirect to the payment page

}

}

} else { //if the coupon field is empty, unregister the coupon from the session

if( tep_session_is_registered('coupon') ) { //we had a coupon entered before, so we need to unregister it

tep_session_unregister('coupon');

//now check to see if we need to recalculate shipping:

require_once( DIR_WS_CLASSES.'discount_coupon.php' );

if( discount_coupon::is_recalc_shipping() ) tep_redirect( tep_href_link( FILENAME_CHECKOUT_SHIPPING, 'error_message=' . urlencode( ENTRY_DISCOUNT_COUPON_SHIPPING_CALC_ERROR ), 'SSL' ) ); //redirect to the shipping page to reselect the shipping method

}

}

//end kgt - discount coupons

 

I think this is similar problem with paypal_ipn module. Someone will need to modify paypal express and other paypal modules to fix the problem.

Share this post


Link to post
Share on other sites

I also installed DC V-3.32 onto a RC2A ver store. This is a test store. I received same error as you did, The coupon code you have entered is not valid.[/font]

 

you posted issue resolved. Could you please post your solution so that I can get this working? Also there might be someone else out there who will run into this situation. Did check in admin, and it is enabled.

 

Thank you.

 

Bennett

 

did uninstaller using autouninstaller and did the manual method. So that error has been removed. Am having another small issue, at least I think it's small. Total is being miscaluated, for example.

 

sub-total: $110.46

Discount: - 22.09

Tax:6.5% 5.74

Shipping: 15.46

--------------------

Total: 110.58

 

The correct total should be $109.58

 

Need to start searching 130 pages in hopes of finding a solution.

 

Bennett

Edited by blr044

Share this post


Link to post
Share on other sites

Finally finished going through all pages. Did not see a fix. Did recheck checkout_confirmation.php. There was one minor differnce and that was at line 244 of catalog/includes/classes/order.php. In your instructions it states to

 

replace this:

 

        $shown_price = tep_add_tax($this->products[$index]['final_price'], $this->products[$index]['tax']) * $this->products[$index]['qty'];
       $this->info['subtotal'] += $shown_price;

 

with this:

 

        //kgt - discount coupons
       if( is_object( $this->coupon ) ) {
         $applied_discount = 0;
         $discount = $this->coupon->calculate_discount( $this->products[$index], $valid_products_count );
         if( $discount['applied_discount'] > 0 ) $valid_products_count++;
         $shown_price = $this->coupon->calculate_shown_price( $discount, $this->products[$index] );
         $this->info['subtotal'] += $shown_price['shown_price'];
         $shown_price = $shown_price['actual_shown_price'];
       } else {
         $shown_price = tep_add_tax($this->products[$index]['final_price'], $this->products[$index]['tax']) * $this->products[$index]['qty'];
         $this->info['subtotal'] += $shown_price;
       }
       /**************
       $shown_price = tep_add_tax($this->products[$index]['final_price'], $this->products[$index]['tax']) * $this->products[$index]['qty'];
       $this->info['subtotal'] += $shown_price;
       **************/
       //end kgt - discount coupons

 

The code for my store is below:

 

$shown_price = $currencies->calculate_price($this->products[$index]['final_price'], $this->products[$index]['tax'], $this->products[$index]['qty']);

$this->info['subtotal'] += $shown_price;

 

I did try both methods, but nothing was different.

 

This is what customer sees: Total before any changes = $110.46

 

 

Discount Coupon applied (20%): -$22.09

Sub-Total: $88.37

ARTAX 6.5%: $5.74

Freight Rates (Shipping to 72034): $15.46

Total: $110.58

 

All is correct, but TOTAL should be $109.57

 

Like to make this new store live by end of this week. So am looking for a solution.

 

Thanks.

 

Bennett

Share this post


Link to post
Share on other sites

Could anyone help me? I setup successfully but on the front-end, the payment total was not changed after i enter coupon code. Now I have adyen payment.

Thanks

Share this post


Link to post
Share on other sites

Finally finished going through all pages. Did not see a fix. Did recheck checkout_confirmation.php. There was one minor differnce and that was at line 244 of catalog/includes/classes/order.php. In your instructions it states to

 

replace this:

 

        $shown_price = tep_add_tax($this->products[$index]['final_price'], $this->products[$index]['tax']) * $this->products[$index]['qty'];
       $this->info['subtotal'] += $shown_price;

 

with this:

 

        //kgt - discount coupons
       if( is_object( $this->coupon ) ) {
         $applied_discount = 0;
         $discount = $this->coupon->calculate_discount( $this->products[$index], $valid_products_count );
         if( $discount['applied_discount'] > 0 ) $valid_products_count++;
         $shown_price = $this->coupon->calculate_shown_price( $discount, $this->products[$index] );
         $this->info['subtotal'] += $shown_price['shown_price'];
         $shown_price = $shown_price['actual_shown_price'];
       } else {
         $shown_price = tep_add_tax($this->products[$index]['final_price'], $this->products[$index]['tax']) * $this->products[$index]['qty'];
         $this->info['subtotal'] += $shown_price;
       }
       /**************
       $shown_price = tep_add_tax($this->products[$index]['final_price'], $this->products[$index]['tax']) * $this->products[$index]['qty'];
       $this->info['subtotal'] += $shown_price;
       **************/
       //end kgt - discount coupons

 

The code for my store is below:

 

 

 

I did try both methods, but nothing was different.

 

This is what customer sees: Total before any changes = $110.46

 

 

Discount Coupon applied (20%): -$22.09

Sub-Total: $88.37

ARTAX 6.5%: $5.74

Freight Rates (Shipping to 72034): $15.46

Total: $110.58

 

All is correct, but TOTAL should be $109.57

 

Like to make this new store live by end of this week. So am looking for a solution.

 

Thanks.

 

Bennett

 

Problem solved, shipping was being taxed.

Share this post


Link to post
Share on other sites

I'm having a similar issue but the coupon rate that is displayed is double what it should be. However, all the calculations are correct.

 

An example of a 20% off coupon looks like this in checkout_confirmation.php

 

Discount Coupon November applied: -$12.00

Sub-Total: $23.99

United States Postal Service (1 x 0.7lbs) (First-Class Mail: Estimated 1 - 5 Days): $2.92

Total: $26.91

 

 

The product is 29.99, so the 20% coupon should be -$6.00. It does the same thing on different coupons. :(

 

Any advice / help would be greatly appreciated!!!

Share this post


Link to post
Share on other sites

I'm having a similar issue but the coupon rate that is displayed is double what it should be. However, all the calculations are correct.

 

An example of a 20% off coupon looks like this in checkout_confirmation.php

 

Discount Coupon November applied: -$12.00

Sub-Total: $23.99

United States Postal Service (1 x 0.7lbs) (First-Class Mail: Estimated 1 - 5 Days): $2.92

Total: $26.91

 

 

The product is 29.99, so the 20% coupon should be -$6.00. It does the same thing on different coupons. :(

 

Any advice / help would be greatly appreciated!!!

 

 

Nevermind. I had installed an earlier version of the contribution and had duplicate kgt code in order.php.

Share this post


Link to post
Share on other sites

I'm having an issue with the discount coupons contribution and have been unable to find an answer to it here.

 

It occurs when using the table rate shipping method based on order total. If someones order total is just over one of the thresholds in the shipping table and they enter a discount coupon that takes their order total below that threshold they are presented with an error message that says:

 

'Your calculated shipping charges have changed'

 

They are then taken back to the beginning of the checkout process, but are unable to checkout as this happens each time.

 

Can the coupons be configured to apply a discount to the order total including shipping so that this isn't a problem? Is there another fix?

 

Thanks,

Alan.

Share this post


Link to post
Share on other sites

I'm having an issue with the discount coupons contribution and have been unable to find an answer to it here.

 

It occurs when using the table rate shipping method based on order total. If someones order total is just over one of the thresholds in the shipping table and they enter a discount coupon that takes their order total below that threshold they are presented with an error message that says:

 

'Your calculated shipping charges have changed'

 

They are then taken back to the beginning of the checkout process, but are unable to checkout as this happens each time.

 

I asked about the same thing a while ago. Nobody answered.

Apparently this isn't a support forum after all.

Edited by jmroth

Share this post


Link to post
Share on other sites

Sorry if this has been asked but couldn't see it when skim reading but I have an issue were the coupon work for the customer money is taken off etc, but I do have a problem were if I have set a limit to how many time the coupon can be used it doesn't subtract the use off the total nor show how many times the coupon has been used.

 

Could someone be so kind to point me in the right direction thanks.

Can anyone point me in the right direction?

Share this post


Link to post
Share on other sites

Just installed this Ad-On and it worked well, however now when I try to log in to my admin page to check for orders and stuff it says:

 

Not Found

The requested URL /osCommerce/catalog/admin/FILENAME_LOGIN was not found on this server.

 

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

 

 

Kind of new to this...any help would be appreciated.

Share this post


Link to post
Share on other sites

Can this Contribution be setup to have a specific discount amount for individual items?

 

Say I want $5 off one item but $6 off another item but I want to use the same coupon code. Can this be done?

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

×