Skip to content
  1. Extras
  2. miniShop2
  3. Snippets
  4. msOrder

msOrder

Ordering snippet.

Ordering snippet

Parameters

ParameterBy defaultDescription
tpltpl.msOrderordering chunk
userFieldsAssociative array of matching order fields to user profile fields in the format "order field" => "profile field".
showLogTo show additional information on snippet operation. For authorized in "mgr" context only.

Tip

Another pdoTools general parameters may be used.

Ordering

Snippet counts on the work with chunk Fenom. It transfers 5 variables there:

  • order - order array from the user session
    • delivery - selected delivery method
    • payment - selected payment method
    • cost - total cost of the order
  • deliveries - array of available order delivery options
  • payments - array of payment methods
  • form - array with customer data. It may contain:
    • email - customer address
    • receiver - receiver name
    • phone - phone number
    • index - postcode
    • region - region
    • city - city
    • street - street
    • building - building number
    • room - room number
    • there may be another values, given by &userFields parameter
  • errors - array of the form fields, containing mistakes

Placeholders

When indicating empty chunk you will be able to see all available order placeholders:

modx
<pre>[[!msOrder?tpl=``]]</pre>

Placeholders

Order creation

It is recommended to call this snippet in junction with others on ordering page:

modx
[[!msCart]] <!-- Cart view and change, hidden after order creation -->

[[!msOrder]] <!-- Ordering form, hidden after order creation  -->

[[!msGetOrder]] <!-- Order information display, showed after order creation -->

Examples

To obtain name of authorized user not fromfullname, but from username:

modx
[[!msOrder?
  &userFields=`{"receiver":"username"}`
]]