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

MiniShop3 snippets

MiniShop3 provides snippets for building an online store on the frontend. All snippets work via pdoTools and support the Fenom templating engine.

Snippet overview

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

General principles

Calling snippets

All snippets can be called via Fenom:

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

Or standard MODX syntax:

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

Caching

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

return parameter

Most snippets support return to set output format:

ValueDescription
tplProcess via chunk (default)
dataReturn data array
jsonReturn JSON string
idsComma-separated IDs only

toPlaceholder parameter

Save result to a placeholder instead of direct output:

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

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

Default chunks

MiniShop3 installs a set of default chunks:

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

Override by creating your own chunks or setting the tpl parameter.