How can I create an editable version of an ecommerce order - triggers or asset builder?


(Charlotte Westney) #1

Hello Matrixers,

Matrix v 5.3.4

I have a permit system, where users can see how many permits are left for a particular day, and then apply for a permit and give a whole bunch of details (name, address, car registration etc).
It uses an asset list to list products, and then a ecommerce cart and checkout and a default delivery method to capture all their details, they ‘buy’ the product but don’t have to pay so there is no payment gateway.
At the end of the process all the details they entered are stored as an ecommerce order, and we also email all the details to them and to staff, and our staff are currently using this email to then be the permit that they send out to the user.

But, the permit applicants like to change their minds. Quite a lot. Because we can’t then edit the details of the ecommerce order asset, we can’t capture these changes and keep the orders as the definitive record of the permits. Our staff are copying them out into a spreadsheet and editing them there. I know. Ugly.

So… when the ecommerce order is created, can I also capture those details and hang them as metadata on a standard page, and have my staff use these pages as the record of the permits?

I had a quick look at triggers, but I can’t see how the ‘create an asset’ event will then allow me to take details of the firing asset (the ecommerce order) and pass them to metadata fields of the newly created page.
Or do I need to create an asset builder, and then hack the code of that to be on the receipt copy of the ecommerce process, and code in the order details into the input fields for the asset builder?

Any advice or ideas very welcome!

Thanks,
Charlie.


(Bart Banda) #2

Yea the ecommerce order has limited keywords and attributes available to it.
What do you get if you print %asset_contents% on a PL for an order? Anything useful?

You could potentially potentially create metadata content on the ecommerce order with some details from the form post using the %globals_post_X% keywords perhaps?


(Charlotte Westney) #3

I can get all the bits of the order asset out, I have an asset list which shows them all using lovely keywords like this:
%order_xml^xpath:://order/delivery_method/questions/question[9]/answer%

But our problem is that the asset list shows the details the user gave when they made the order, and if they then contact us and want to change any details, we can’t get into the order asset to change anything (which I understand, orders can’t be editable). So what I’d like is to ‘clone’ all the details of each order onto some kind of asset that can be edited, so either into the body copy of a page, or into metadata fields.

If I could dump the full order details onto a standard page that would be fine - is that possible using a trigger or a nested asset builder or something?

Thanks Bart!
C.


(Bart Banda) #4

You could potentially use the %order_xml% keyword as the default value of a metadata field applied to order assets and then edit that? Or extract individual values using your xpath method to build up your own format?
Or setting it as a metadata field value using a trigger when the order is completed?