Ecommerce - Trigger order details


(Tim Trodd) #1

We would like to have a trigger fire off a REST call resource that will send data from within the order to sugarCRM.

So far I have the trigger setup like so:

Event: ‘Order submitted’

Condition: Tree location (where the payment form is)

Action: Send email trigger + call REST resource.

The trigger correctly works when an order is submitted and I can get the users name using %globals_user_attribute_first_name% etc. but how do I get the order details? Main one being the price as we would like to then update a field in sugar with the price paid.

Ive tried using %response_xxx% keywords and %order_summary% etc. but none of them bring back any info.

%asset_name% brings back “Order - xxxx” so its definitely selected the order asset itself.

Any ideas? Perhaps something different to order submitted as the event?

Cheers,

Tim


(Bart Banda) #2

You could try on asset created event instead and doing at the order asset is created, but I’m not sure if there are keywords that let you extract form submission fields against the order asset in a nice way, I think you can only get the XML data… been a while since I’ve played with order assets.

ALternatively, try using %globals_post_X% keywords to access information about the order as the form submission values might be part of the form request POST when the event gets fired?


(Tim Trodd) #3

Thanks Bart. I couldn’t seem to get any of the order details out of the order asset itself.

So instead went about it a different way so rather than using a trigger, I just nested in a REST asset into the receipt page so that it posts the response values straight from the form itself to Sugar. Then used the normal email option of the ecommerce asset for that part.

Seems to be working well so far!

Tim


(Bart Banda) #4

Interesting solution! Maybe would be worth trying to use the Call REST Form Submission action instead on the Custom Form? https://matrix.squiz.net/manuals/custom-form/chapters/submission-actions-screen#call-rest-resource


(Tim Trodd) #5

Would love to use that but sadly the ecommerce asset seems to only have a SOAP call submission action unlike the custom form which has REST etc. I think it may already be in the roadmap but it would be great to have the REST submission action added to the list along with SOAP in the future.


(Bart Banda) #6

Ah damn, of course. Yea Trigger or nested REST asset I guess will have to do for now!