type:
integration
system:
MODx
name:
Basic Inventory Tracking
description:
A basic inventory snippet, which uses MODx TVs and chunks to display "add to cart" or "out of stock" functionality, based on available inventory.
tags:
inventory,
cms
date:
2007-10-11
version:
0.1.0
developer:
http://www.themancan.com/

MODx Inventory Snippet

This snippet is really more a proof of concept than anything else, but it'll probably turn into much more as additional requests come in.

This comes in two pieces. One piece is a simple snippet that returns one chunk (like a “buy now” link) if the inventory TV is >0, another chunk if the inventory TV =0. The other piece is a snippet that will process the XML Data Feed that FoxyCart sends your way.

Current versions are in the MODx Resource Repository:

Expanding the Inventory Snippet with MODx

Using the Inventory TV you can make a quick and easy Ditto call to filter your products based on stock level:

&hideFolders=`1` &filter=`inventory,5,4` &tpl=`iteminfo`

Adding the above line to a ditto call of your products catalog will show products that have less than 5 stock remaining. Broken up, each bit means:

<div class="stockItem">
      [+title+]<br />
      Code:[+code+] <br />
      Current stock level:[+inventory+]
</div>

This is a very basic example, but its a good start in expanding on the foxycart inventory control a little.