Skip to content
  1. Extras
  2. MiniShop3
  3. Snippets

MiniShop3 snippets

MiniShop3 provides a set of snippets for building the store frontend. All snippets work through pdoTools and support the Fenom template engine.

Snippet overview

SnippetPurpose
msProductsProduct list with filtering and sorting
msCartShopping cart display
msOrderCheckout form
msGetOrderOrder information
msGalleryProduct image gallery
msOptionsOptions for product filtering
msProductOptionsSpecific product characteristics
msCustomerCustomer account
msOrderTotalOrder total summary

General principles

Calling snippets

You can call all snippets via Fenom:

fenom
{'msProducts' | snippet : [
    'parents' => 5,
    'limit' => 10
]}

Or via standard MODX syntax:

modx
[[!msProducts?
    &parents=`5`
    &limit=`10`
]]

Caching

Snippets that use the user session (msCart, msOrder, msCustomer) must be called uncached (with !).

return parameter

Most snippets support the return parameter that defines the output format:

ValueDescription
tplProcess through a chunk (default)
dataReturn a data array
jsonReturn a JSON string
idsRecord IDs only, comma-separated

toPlaceholder parameter

Instead of direct output, you can save the result to a placeholder:

fenom
{'msProducts' | snippet : [
    'toPlaceholder' => 'products'
]}

{* Use later *}
{$_modx->getPlaceholder('products')}

Default chunks

MiniShop3 ships with a set of ready-made chunks:

SnippetDefault chunk
msProductstpl.msProducts.row
msCarttpl.msCart
msOrdertpl.msOrder
msGetOrdertpl.msGetOrder
msGallerytpl.msGallery
msOptionstpl.msOptions
msProductOptionstpl.msProductOptions

You can override chunks by creating your own or specifying another chunk in the tpl parameter.