In template based feed iterator template, the array for the products is named record.
I've only found one inventory related variable at the product level. That is &mvt:record:inventory; which displays the quantity of inventory available.
I have a mix of products (records), some with inventory tracking turned on and some that we do not track inventory on.
&mvt:record:inventory; contains 0 for the qty if inventory tracking for a product is turned on and qty=0
and also
&mvt:record:inventory; contains 0 for the qty if inventory tracking for a product is turned off.
That is the crux of my problem. I can't tell in the output if a product is actually tracked and has zero inventory.. or if the product just isn't tracked.
How do I find out if inventory tracking is off for that product(record)? What I am want is a super fast simple yes or no kind of response so I can do an if statement with logic like this
I've looked at the api and the documentation is unbearably sparse. So I'm guessing one of these will be what I need to find the necessary information to use in my if statement. But not sure which one is the lightest and fastest and thus the best choice. (I am creating output of thousands of products in a report type table, so the least impact on processing is the best choice to prevent timing out).
<mvt:do file="g.Module_Feature_INV_RT" name="l.success" value="Runtime_Product_InventoryFields_Read(produc t var)" />
<mvt:do file="g.Module_Feature_INV_RT" name="l.success" value="Inventory_Tokenize_Message(product var, text)" />
<mvt:do file="g.Module_Feature_INV_RT" name="l.success" value="Inventory_Check_Available(product var, quantity)" />
<mvt:do file="g.Module_Feature_INV_DB" name="l.success" value="InventoryProductCount(product_id)" />
<mvt:do file="g.Module_Feature_INV_DB" name="l.success" value="InventoryProductSettings_Read(inventoryprod uctsettings var)" />
<mvt:do file="g.Module_Feature_INV_DB" name="l.success" value="InventoryProductCount_Read(inventoryproduct count var)" />
<mvt:do file="g.Module_Library_DB" name="l.success" value="Product_Load_ID_WithRuntimeInventory(id, product var)" />
Anyone know which is the best choice for my needs?
I've only found one inventory related variable at the product level. That is &mvt:record:inventory; which displays the quantity of inventory available.
I have a mix of products (records), some with inventory tracking turned on and some that we do not track inventory on.
&mvt:record:inventory; contains 0 for the qty if inventory tracking for a product is turned on and qty=0
and also
&mvt:record:inventory; contains 0 for the qty if inventory tracking for a product is turned off.
That is the crux of my problem. I can't tell in the output if a product is actually tracked and has zero inventory.. or if the product just isn't tracked.
How do I find out if inventory tracking is off for that product(record)? What I am want is a super fast simple yes or no kind of response so I can do an if statement with logic like this
Code:
if inventory tracking is off, then output "NA" else output &mvt:record:inventory;
<mvt:do file="g.Module_Feature_INV_RT" name="l.success" value="Runtime_Product_InventoryFields_Read(produc t var)" />
<mvt:do file="g.Module_Feature_INV_RT" name="l.success" value="Inventory_Tokenize_Message(product var, text)" />
<mvt:do file="g.Module_Feature_INV_RT" name="l.success" value="Inventory_Check_Available(product var, quantity)" />
<mvt:do file="g.Module_Feature_INV_DB" name="l.success" value="InventoryProductCount(product_id)" />
<mvt:do file="g.Module_Feature_INV_DB" name="l.success" value="InventoryProductSettings_Read(inventoryprod uctsettings var)" />
<mvt:do file="g.Module_Feature_INV_DB" name="l.success" value="InventoryProductCount_Read(inventoryproduct count var)" />
<mvt:do file="g.Module_Library_DB" name="l.success" value="Product_Load_ID_WithRuntimeInventory(id, product var)" />
Anyone know which is the best choice for my needs?
Comment