By trial error I have found that it is possible to extract the data within an ecommerce order asset by two different keywords: %order_summary% and %order_xml%. However, neither of these seem to be appropriate for an asset listing. The summary keyword gives a long unformatted string, without even line breaks, whereas the XML keyword gives XML marked-up data that is jumbled when displayed as HTML.
Is there some way of extracting the details about an order and then using them in a customised asset listing?
Are there any other keywords associated with ecommerce orders, such as the relevant delivery details asset?
Thanks.
Hi Ben,
Along with all the regular asset keywords (%asset_name% %asset_created%, etc), below are the currently available keywords for Ecommerce Order asset:
%checkout_assetid% : Assetid of checkout form which created this order
%order_summary% : Summary of this order
%status% : Status of ecommerce order
%status_message% : Message which is related to the status
%edit_url% : URL to the page where to edit this ecommerce order
%order_xml% : XML representation of this order
%order_grand_total% : The grand total price of this Order asset
Also two of the attributes "ecom_ref_no" and "transaction_id" can be accessed with:
%asset_attribute_ecom_ref_no%: Merchant ref ID sent the Payment Gateway
%asset_attribute_transaction_id% : The ID of the payment transaction returned by the Payment Gateway
For some reasons all other Ecommerce Order asset attributes like "billing_name", "billing_addr", "delivery_name", "delivery_addr", "delivery_id", etc are not exposed to frontend and cannot be access via %asset_attribute_*%.
Chiran
Chiran,
Thanks for the details. There is some interesting stuff in there, some of which raises further questions.
It seems that I need to use either %order_summary% or %order_xml% to list the details of orders. That still leaves open the issue of how I extract the data from those.
The %order_summary% keyword gives a practically unformatted list of the answers from the Ecommerce Default Delivery Method asset. Which is not terribly useful as it is. Here's an example:
<pre>Item Quantity Price ----------------------------------------------------------------- Asperger Dictionary of Everyday Expressions 1 $39.00 ----------------------------------------------------------------- Total 1 $39.00 </pre>
First name (q9) : Xxx Last name (q10) : Xxxxxxx Email address (q3) : xxxxxxxx.xxxxxxx@xxxxxxxx.xxx.xx Contact phone (q4) : (xx) xxx xxxx Street/road address (q5) : xxx Xxxxxxxx Xx Suburb (q6) : Xxxxxxx City (q7) : Xxxxxxxxxx Optional delivery instructions (q8) :
I wouldn't know where to begin making use of the XML data produced by the %order_xml% keyword.
It would be very useful to be able to access the "billing_name", "billing_addr", "delivery_name", "delivery_addr" asset attributes that you list. However, it is not clear how these attributes would be set in the first place. As far as I understand the Ecommerce Default Delivery Method asset, it doesn't set these attributes.
I get the feeling that the ecommerce package is incomplete. It seems to work well enough up to the point of taking the orders and sending out email notifications, but it seems like the steps beyond that have not been implemented. I'm intrigued also by the %edit_url% keyword. I wasn't aware that the checkout allowed orders to be edited. That would be a potentially useful function. I have tried using this keyword, but it simply sends me to a page that says "This order is currently being edited ". There doesn't appear to be any discussion regarding this in the Matrix manuals. Is this possibly something else that hasn't yet been implemented?
One more question: Is there a keyword for an order giving the Ecommerce Default Delivery Method asset used in filling the order? This would be very useful as it would allow me to distinguish orders paid by credit card and those paid by other method.
Thanks.
[quote]
Hi Ben,
Along with all the regular asset keywords (%asset_name% %asset_created%, etc), below are the currently available keywords for Ecommerce Order asset:
%checkout_assetid% : Assetid of checkout form which created this order
%order_summary% : Summary of this order
%status% : Status of ecommerce order
%status_message% : Message which is related to the status
%edit_url% : URL to the page where to edit this ecommerce order
%order_xml% : XML representation of this order
%order_grand_total% : The grand total price of this Order asset
Also two of the attributes "ecom_ref_no" and "transaction_id" can be accessed with:
%asset_attribute_ecom_ref_no%: Merchant ref ID sent the Payment Gateway
%asset_attribute_transaction_id% : The ID of the payment transaction returned by the Payment Gateway
For some reasons all other Ecommerce Order asset attributes like "billing_name", "billing_addr", "delivery_name", "delivery_addr", "delivery_id", etc are not exposed to frontend and cannot be access via %asset_attribute_*%.
Chiran
[/quote]
[quote]
I wouldn’t know where to begin making use of the XML data produced by the %order_xml% keyword.
[/quote]
Possibly the xslt modifier? See: Keyword Modifier and Keyword Modifier
Examples of XSL can be found here:
- http://www.w3schools.com/xsl/xsl_examples.asp
[*]http://www.cs.helsinki.fi/u/hahonen/rado01/material/xsl_examples.html
[*]http://ynonperek.com/xml-xsl-examples.html
[*]http://cs.au.dk/~amoeller/XML/transformation/examples.html