Skip to content
fireproofsocks edited this page Nov 8, 2014 · 4 revisions

getProducts

Returns a list of products.

Available Placeholders

  • [[+product_id]]
  • [[+alias]]
  • [[+content]]
  • [[+name]]
  • [[+sku]]
  • [[+type]]
  • [[+track_inventory]]
  • [[+qty_inventory]]
  • [[+qty_alert]]
  • [[+price]]
  • [[+category]]
  • [[+uri]]
  • [[+is_active]]
  • [[+seq]]
  • [[+calculated_price]] -- this will intelligently show the sales price if/when the product is on sale.
  • ... any column from the products table...

Parameters

  • &outerTpl string Name of Chunk or Formatting String for the Outer Wrapper of List (Optional)
  • &innerTpl string Name of Chunk or Formatting String for the Inner Item of List
  • &is_active boolean Get all active records only
  • &log_level integer. 4 = debug. Defaults to system setting
  • &log_target mixed Defaults to system setting.
  • &limit int Limit the records to be shown (if set to 0, all records will be pulled)
  • &firstClass int set class name on the first item (Optional)

Usage

[[!getProducts? &outerTpl=`sometpl` &innerTpl=`othertpl` &limit=`0`]]

Troubleshooting

Like all the other Snippets, the use of the Formatting Strings is not ideal: nested MODX tags do not parse correctly, so use an old-school Chunk if there's any trouble