Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3

...

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
themeDJango
titleMain 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
themeDJango
titleCondition 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
themeDJango
titleCondition 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
themeDJango
titleOutput of Quantity in stock
        Quantity in Stock: $item.getAvailableQuantity()
    #end
#end