...
Here we are checking the item to see if inventory tracking has been turned on for the item. We do this to make sure that item is tracking inventory otherwise the quantity in stock is "blank" by default. which will output that the item is out of stock.
Code Block |
---|
theme | DJango |
---|
title | Main Condition |
---|
|
#if($item.isInventoryTracked()) |
This is our first condition, if the "AvailableQuantity" or Quantity in stock is 0 then we display the message below.
Code Block |
---|
theme | DJango |
---|
title | Condition statement 1 |
---|
|
#if($item.getAvailableQuantity() <= 0)
Item is currently out of stock |
This is our second condition, If theĀ "AvailableQuantity" or Quantity in stock is greater then 0, then we display the message.
Code Block |
---|
theme | DJango |
---|
title | Condition statement 2 |
---|
|
#elseif ($item.getAvailableQuantity() >= 0) |
Here we are looping thought the item to pull the Quantity in stock and then closing the conditional statements.
Code Block |
---|
theme | DJango |
---|
title | Output of Quantity in stock |
---|
|
Quantity in Stock: $item.getAvailableQuantity()
#end
#end |