Use unformatted price in edit page #9644
Labels
type-bug
workflow-needs-replication
workflow-pending-triage
Items that need to be triaged and reviewed before they are worked on.
Bug Report
Expected behavior
When I want to edit a download custom type, price field is formatted and this creates a problem.
For my currency (for display purposes only) I divide amount by 10,
This means that if price is 100, I display 10. But you can guess what happens when you edit a download post. Price that is actually 100 will be formatted to 10, and When I save the page, price will be saved as 10 and displays as 1.
Problem is in metabox.php file,
First there's no filter or anything that I can override the price, And also it shouldn't use
edd_format_amount
for price, in fact you can see this in their definition :You should use
edd_sanitize_amount
function that doesn't put any separator in input box.The text was updated successfully, but these errors were encountered: