I use discount code adon for JPY.
Unfortunately discount amount was one-thousandth of the actual discount amount ,when I use offline payment.
When I try to pay with PayPal, it will not be discounted at all.
Please advise?
IITOMI AKITSUGU
What were the settings used for the discount code? Was it a flat amount or a percentage? And what was the value?
Stephen Harris
Both flat amount and percentage.
I set flat amount value 3000 JPY otherwise discount amount is 3 JPY.
In the case of percentage set 10% (Product is 40000JPY discount amount 4000 JPY) otherwise discount amount is 4 JPY.
IITOMI AKITSUGU
Thanks for reporting this bug. The bug is with the discount codes plugin, and it effects discount amounts with a value over 1000. The value of the discount is being saved to the database with a semicolon, when it’s retrieved the semicolon is treated as a decimal point.
A quick fix is to replaces line 668 and 669 of event-organiser-discount-codes.php
:
if( $discount_amount && floatval( $discount_amount ) > 0 ){
$amount = max( 0, $amount - floatval( $discount_amount ) );
with
if( $discount_amount && floatval( str_replace( ',', '', $discount_amount ) ) > 0 ){
$amount = max( 0, $amount - floatval( str_replace( ',', '', $discount_amount ) ) );
An update will be released this week to address this issue.
Stephen Harris
Thank you for your prompt reply.
And Thank you fix code.
I’m looking forward to updating plugin.
IITOMI AKITSUGU
Sorry to keep bothering you.
Discount does not work when use paypal.
Offline payment and stripe payment are noproblem.
I would be grateful if you could confirm.
-
This reply was modified 7 years ago by IITOMI AKITSUGU.
IITOMI AKITSUGU
Yes, I can confirm the above fix doesn’t fix the PayPal gateway which requires a separate fix.
The update that’ll be released later today will address the root problem and will fix it for all gateways.
Stephen Harris
I appreciate how swiftly and expertly you dealt with that matter. Thank you.
IITOMI AKITSUGU
Just in case you missed it, there’s an update that’s been released for the discount codes extension. It should fix the issues raised here. Please let me know if you have any further issues.
Stephen Harris