Transform negative values to positive

6 February, 2023 12:24:49
MariusParaschiv
Topics: 2
Messages: 3
Hello,

I have a field in woocommerce, a tax field wich is negative. Can I transform it to positive? I tried regex and replace, but it didn't work..

the field is [e2pdf-wc-order key="fee" subkey="_fee_amount" index="0" order_item_meta="true"]

Thanks!
6 February, 2023 22:31:34
MariusParaschiv
Topics: 2
Messages: 3
I solved this by using format-output

this is my solution:
[e2pdf-format-output substr="1" filter="trim,substr"][e2pdf-wc-order key="fee" subkey="_fee_amount" index="0" order_item_meta="true"][/e2pdf-format-output]

Thanks!


7 February, 2023 00:06:34
E2Pdf
Support
Topics: 7
Messages: 3163
Hi,

Thank you for letting know the solution. Another possible way that can solve it also, can be "search" and "replace" as:

[e2pdf-format-output search="-" replace=""][e2pdf-wc-order key="fee" subkey="_fee_amount" index="0" order_item_meta="true"][/e2pdf-format-output]

or

[e2pdf-format-output search="―" replace=""][e2pdf-wc-order key="fee" subkey="_fee_amount" index="0" order_item_meta="true"][/e2pdf-format-output]

We remain at your service.
We would really appreciate your feedback at WordPress.org!