Miva Merchant 5 Module FAQs » Inventory Manager 5.x
To get this functionality, use the token/item:
<mvt:item name="BROK_INVENTORY" param="define_variable" />
This will define a global variable consisting of:
g.BROK_INVENTORY:tracking
g.BROK_INVENTORY:product_id
g.BROK_INVENTORY:attr_string
g.BROK_INVENTORY:error
g.BROK_INVENTORY:count
g.BROK_INVENTORY:level
g.BROK_INVENTORY:level_name
g.BROK_INVENTORY:short_message
g.BROK_INVENTORY:long_message
g.BROK_INVENTORY:attr_message
g.BROK_INVENTORY:permit_sale
g.BROK_INVENTORY:permit_display
You can then test the variable's values such as:
<mvt:if expr="g.BROK_INVENTORY:level EQ '3'">
the level is 3
</mvt:if>
or display a value with:
&mvt:global:BROK_INVENTORY:level_name;
which will display the current level's name.
Keep in mind that you'll need to use the item
<mvt:item name="BROK_INVENTORY" param="define_variable" />
at a point in the template where an individual product's information is being displayed. For example, it won't be properly defined in the global header and footer (at least not consistently) but could be used inside the:
<mvt:foreach iterator="item" array="basket:items">
</mvt:foreach>
in the "Basket Contents" template field of the BASK screen since in that iterator a specific product is being handled.
{docurl}
I would like to conditionally display something for a product but only if the current level is '3'. How do I do this?
NOTE: in the latest versions of the module (updating is always a good idea) this is best accomplished using the values set by the module in the l.all_settings and l.settings variable (i.e. it now uses the same approach as Merchant itself). Details can be found in this FAQ on the subject:
Displaying and Controlling the Inventory Data
To get this functionality, use the token/item:
<mvt:item name="BROK_INVENTORY" param="define_variable" />
This will define a global variable consisting of:
g.BROK_INVENTORY:tracking
g.BROK_INVENTORY:product_id
g.BROK_INVENTORY:attr_string
g.BROK_INVENTORY:error
g.BROK_INVENTORY:count
g.BROK_INVENTORY:level
g.BROK_INVENTORY:level_name
g.BROK_INVENTORY:short_message
g.BROK_INVENTORY:long_message
g.BROK_INVENTORY:attr_message
g.BROK_INVENTORY:permit_sale
g.BROK_INVENTORY:permit_display
You can then test the variable's values such as:
<mvt:if expr="g.BROK_INVENTORY:level EQ '3'">
the level is 3
</mvt:if>
or display a value with:
&mvt:global:BROK_INVENTORY:level_name;
which will display the current level's name.
Keep in mind that you'll need to use the item
<mvt:item name="BROK_INVENTORY" param="define_variable" />
at a point in the template where an individual product's information is being displayed. For example, it won't be properly defined in the global header and footer (at least not consistently) but could be used inside the:
<mvt:foreach iterator="item" array="basket:items">
</mvt:foreach>
in the "Basket Contents" template field of the BASK screen since in that iterator a specific product is being handled.
Last update: 2009-07-17 11:51
Author: Thor
Revision: 1.2
You cannot comment on this entry
Records in this category
- Inventory Manager is not reducing the inventory count when customers add products to their basket. Why?
- Runtime error when performing an import: Array index must be positive integer
- How can I display an inventory "status" message in the basket (either on the BASK screen or during checkout) so that customers can see if the product is back-ordered?
- I would like to conditionally display something for a product but only if the current level is '3'. How do I do this?
- Using the module's tokens inside of the "Product Attribute Display" field
- Displaying and controlling the inventory data














