craftcms / webhooks

Plugin for integrating Craft with Zapier and IFTTT.
https://plugins.craftcms.com/webhooks
MIT License
84 stars 12 forks source link

Craft Commerce #11

Closed damiengahan closed 4 years ago

damiengahan commented 5 years ago

Thanks for this plugin, it's really helpful! I'm using it to pull new order info from Commerce using craft\commerce\elements\Order as the sender class on afterCompleteOrder. This all works great but I've been having trouble working out how to pull in further order data from Commerce like "totalTax". Just wondering if this is possible? Also is it possible to bring in custom product/user fields?

Appreciate any help you can give!

brandonkelly commented 4 years ago

The data available will depend on what attributes the event sender’s class makes available. In the case of craft\commerce\elements\Order, totalTax is in fact available, as it is defined in extraAttributes():

https://github.com/craftcms/commerce/blob/06dcec2ddd364176071fcb9afb777f42a5db06a1/src/elements/Order.php#L1200