You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Create a new discount code. Type = percentage; amount = 50b. (Or any random letter thrown in.) Save.
After saving, it will appear in the UI as just 50, but in the database it's actually saved as 50b.
Add an item to your cart, proceed to checkout, and apply this discount code.
PHP notice is logged.
Information (if a specific version is affected):
PHP Version:
EDD Version (or branch): 2.9.x
WordPress Version:
Any other relevant information:
I have confirmed that in EDD3 you are unable to save a non-numeric discount code amount. So that part of the issue is fixed. However, we can patch this part in EDD 2.9.x, and when we do amount calculations in the EDD_Discount::get_discounted_amount() method we can cast the values to floats to avoid this notice.
The text was updated successfully, but these errors were encountered:
Bug Report
Expected behavior
I should not be able to save a non-numeric discount code amount, such as
50b
.Actual behavior
When I create a discount code with the amount
50b
, then use this discount on checkout, the following notice is logged:Steps to reproduce the behavior
50b
. (Or any random letter thrown in.) Save.50
, but in the database it's actually saved as50b
.Information (if a specific version is affected):
PHP Version:
EDD Version (or branch): 2.9.x
WordPress Version:
Any other relevant information:
I have confirmed that in EDD3 you are unable to save a non-numeric discount code amount. So that part of the issue is fixed. However, we can patch this part in EDD 2.9.x, and when we do amount calculations in the
EDD_Discount::get_discounted_amount()
method we can cast the values to floats to avoid this notice.The text was updated successfully, but these errors were encountered: