I need to get the amount of a discount from orders to write that data into a json file (on EVENT_AFTER_COMPLETE_ORDER) which then will be consumed by an inventory management system and now am stuck with discount amounts. Currently I have:

"price": ' . $order->adjustment->one->type('discount')->amount . ',

which does not work. Could anyone help on how to do this and maybe point me to the documentation where I could read up on it?

Thanks m


Got it:

"price": ' . $order->totalDiscount . ',


| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.