Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

[Contribution] Discount Coupon Codes


kgt

Recommended Posts

Strange with the new module I get this

 

1 x Gekleurde Salamander sleutelhanger €6,95

 

Sub-Totaal: €3,47

Discount Coupon testing001 applied: -€3,47

Verzendkosten: €1,95

21.0% BTW van €5,42: €0,94

Totaal incl. BTW: €5,42

 

 

which is correct maybe try uninstalling and the reinstalling in your admin/modules/order total

 

 

with the old module I would get this

 

1 x Barcino magneet: Gekko groen €6,95

 

Sub-Totaal: €4,08

Discount Coupon testing001 applied: -€2,87

Verzendkosten: €1,95

21.0% BTW van €6,03: €1,05

Totaal incl. BTW: €6,03wh

 

which is wrong or at least confusing to me

 

PS: sorry in Dutch but will give you the idea

Edited by joli1811
To improve is to change; to be perfect is to change often.

 

Link to comment
Share on other sites

I have this module working well on 2.3.3.4 - Thanks to all who contributed!

 

I know it's not "important", but I am trying to stamp out every little E_NOTICE that comes along... This module has few I have yet to sort. Anybody have a thought on this one?

 

E_NOTICE Error Count: 2

Error: Undefined property: order::$coupon

File: includes/classes/order.php

Line: 325 and 371

 

Line: 325 is:

 if ( is_object( $this->coupon ) ) {

from code block

 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 = $currencies->calculate_price($this->products[$index]['final_price'], $this->products[$index]['tax'], $this->products[$index]['qty']);
	 $this->info['subtotal'] += $shown_price;
 }

 

and Line 371

 if ( is_object( $this->coupon ) ) {

from code block

 if( is_object( $this->coupon ) ) {
 $this->info['total'] = $this->coupon->finalize_discount( $this->info );
 }

 

any pointers appreciated

Dave

-Dave

Link to comment
Share on other sites

Hello,

 

Thank you for a great addon!

 

I am testing this out and I've just ran into a small problem. Hopefully someone can help me here.

 

We use DHL for shipping and would like to offer free shipping thru a coupon code. It's giving me the correct discounts on the shipping itself, but we only use one type of payment; "payment on delivery" and this is a fixed amount of 62 SEK.

 

I would love the discount code for the shipping to also do a minus 62 on the total. Is there an easy way?

 

Thank you!

Link to comment
Share on other sites

Hi all,

 

I notice a lot of people are having the issue where they receive the error message YOUR CALCULATED SHIPPING CHARGES HAVE CHANGED error message.

 

This has caused me alot of frustration over the past few days, but I believe I have solved it.

 

The final step of the installation instructions I have state:

 

OPEN catalog/includes/modules/shipping/table.php

 

FIND on line 52:

$order_total = $cart->show_total();

REPLACE with this code:

//kgt - discount coupons

$order_total = $order->info['subtotal'];

/**************

$order_total = $cart->show_total();

**************/

//end kgt - discount coupons

 

 

If you are like me, you will more than likely have more than 1 Shipping table, mine are for different locations. I had only applied this code to table.php and not applied to the other table files (in my case table2.php & table3.php)

 

I added this code and since then, the error message has gone. Hopefully this helps some people as I noticed that nobody seemed to have come up with a solution and when people do find a solution, they don't always share with others.

 

All the best

 

Mark

Edited by matc
Link to comment
Share on other sites

  • 3 weeks later...

Hi!

 

I am not a programmer but I am making my own site by using add-ons.

 

I installed the DCC ver 3.34. I followed the steps as best as i could and everything seems working fine until i tested the discount coupon.

In my checkout_confirmation page, i found out that my sub-total is doubling.

 

For example, subtotal is 850.00 for one item, it will show 1,700. then from there, the discount will be computed so my total is not correct.

i tried to search for answer but i really cant find one so im posting my problem here.

 

hope somebody can help me with this one.

 

thanks

 

Can you tell me where the fix is please?

 

Thank you, Bruce

Link to comment
Share on other sites

Subtotal is double

 

HI folks, I have been through all the forums and tried all the various fixes. The Discount Coupons is working perfectly but I am getting the subtotal doubling and I can not find the fix. Can someone please give instruction where I may locate this problem and how to fix. I installed it today. Running 2.3.1. The doubling happens with or without the coupon being there.

 

Thanks muchly, Bruce

Link to comment
Share on other sites

Hello All

 

I have recently installed this contribution on our oSc platform. It works flawless for items with no 'Product Attributes', but the coupon code does not discount any items with Attributes. I searched for a good duration of time and was not able to locate this specific issue. (We are using the Attributes Plus contribution)

 

Any direction will help!

 

oSc 2.2-MS2

PHP -5.1.6

 

 

Link to comment
Share on other sites

Thanks to Diathinconlon's help, it was indeed extra code... now in my file at line 275/276 removed that just before the DC insertion and it works perfectly! Here was that posting:

 

 

Just a quick note on a problem I have solved - other people have reported the same problem, but I can't figure how to include thier posts in my reply.

 

When I installed this contrib (version 3.3) my sub-total started showing double what it should be - even if the discount is not applied.

 

I tracked it down to catalog/includes/classes/order.php.

 

In the instructions it says to add and replace various pieces of code. The second step -is around line 224 to REPLACE

 

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

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

 

..with the new code - but I misread it as 'ADD' the new code. So it ended up doing the '$this->info['subtotal'] += $shown_price;' twice - hence the double value!!

Hope this helps someone.

Link to comment
Share on other sites

  • 2 weeks later...

Please can you help me install a simple popup that confirms, "Yes, that is a valid discount code." ? If it is NOT a valid code, it reloads the page with the error message. But if it IS valid, it says nothing... just goes to the next page.

 

Where can I edit checkout_payment.php to put in such a confirmation popup? Thank you <3

Link to comment
Share on other sites

  • 1 month later...

@L. Haase

 

This add on is working great at the minute with 2.3.3.4 ? think you got the threads mixed up

 

Works with paypal express and paypal standard

 

paypal ipn is getting outdated so not sure of any support there why not upgrade the paypal module?

 

Regards

Joli

To improve is to change; to be perfect is to change often.

 

Link to comment
Share on other sites

Hi,

 

I could never get any of the discount coupon systems to work the way I wanted them - all of them seem very complex and some have issues with certain payment processors, also Google shopping banned me for selling Discount Coupons! - so I went about this a different way:

 

Paypal itself has the ability to generate gift vouchers, semi-customised to your design, that can be emailed direct to the recipient or printed and mailed by the buyer.

 

All you need to do is generate the code on paypal, add the code to add the graphic to your site and you are up and running - No need to edit any of the code on your site and the code is entered on the paypal payment page and not your site page.

 

Simples :)

Edited by Mort-lemur

Now running on a fully modded, Mobile Friendly 2.3.4 Store with the Excellent MTS installed - See my profile for the mods installed ..... So much thanks for all the help given along the way by forum members.

Link to comment
Share on other sites

@L. Haase

 

This add on is working great at the minute with 2.3.3.4 ? think you got the threads mixed up

 

Works with paypal express and paypal standard

 

paypal ipn is getting outdated so not sure of any support there why not upgrade the paypal module?

 

Regards

Joli

 

You're kidding, right? I've been struggling to get the PayPal IPN to work, so I could avoid confusion if the customer chooses to close the PayPal window after payment - before she is transferred back to my shop. Has that issue been addressed win PayPal Standard?

Link to comment
Share on other sites

The add on as said before works perfectly with paypal standard and paypal express from the shipping page (not shopping cart)

 

now there is a small bit of code added to both files which can be found in the addon package.

 

I see on the old discount addon site that there is a PayPal IPN fix there

 

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

 

The paypal files have been updated several times in the past years including a complete new set this week you would need to compare and add the code for the discount to work (although this problem may have been solved with the latest changes not sure need to test myself) as it does calculate slightly different.

 

If I understand correctly the discount will be calculated but I doubt if it will be itemized just need to test myself

 

best would be to ask in the actual forum for the new models

 

http://www.oscommerce.com/forums/topic/396825-testing-new-paypal-express-checkout-module/

 

The separate issue of a customer not returning to the shop after purchase I am not sure I have not seen mentioned so often the last years although was a big problem in the past with several fixes available and have not had any problems myself or read for a long time so I presume they are fixed

 

 

I personally have never used PayPal IPN addons simply because I could not get to work correctly on the osc 2.3... series and the addons are rather dated

 

The standard and express should give you an instant payment notification details here

 

http://library.oscommerce.com/Package&en&paypal&oscom23&express_checkout

 

http://library.oscommerce.com/Package&en&paypal&oscom23&payments_standard

 

As said I would ask specific questions about the paypal functions in the new thread and read the documentation

 

http://www.oscommerce.com/forums/topic/396825-testing-new-paypal-express-checkout-module/

 

 

 

PS: another good thread

 

http://www.oscommerce.com/forums/topic/339937-paypal-order-emails-not-being-sent/page__st__20

Edited by joli1811
To improve is to change; to be perfect is to change often.

 

Link to comment
Share on other sites

  • 2 weeks later...

hello I am  trying to make the discount code works but i have a problem. When i  apply the coupon  the coupon is loading and loading and it does not want to work  I am using oscommerce 2.3.3 I will be very thankful if some one can help me with  this problem 

Link to comment
Share on other sites

  • 2 weeks later...

Hi,

 

I have oSCommerce v2.3 installed and trying to work with discount coupons, and using Table Rate for Shipping but whenever i apply a coupon on the checkout_payment.php page it get redirected back to checkout_shipping.php page with some error in address bar

 

"error_message=Your+calculated+shipping+charges+have+changed."

 

What is the problem and how we can solve it?

If this is answered before then apologies please reply me with the link where it is solved.

 

Cheers,

Edited by Sanmesh
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...