Can item inventory totals be accessed from a Category listing.

VinnyQPVinnyQP Member Posts: 1
First timer... thank you  in advance for any support or guidance you may provide.

There appears to be certain RAIN product variables that can't be accessed on every page?  

My current example - Say I have a category that displays four products and one of them is out-of-stock and I merely wish to check the stock level of an item and if less than say '1'; I would like the word 'out of stock' to appear where we see the 'new' and 'sale' tags now. (note this has nothing to do with backorder options)

I have done some testing using a demo account and got the general idea to work but has hard as I try i can't get the current inventory total for each item to appear as part of each product listing when viewing a category. 

This is making it impossible to check the stock levels of the items when they are displayed as part of a category with a twig 'for/ else' statement.  

Other product variables from the listing of RAIN product variables display as expected by not when i try to read the product variable ... product.stock.level

Using the simple code below I am able to display the current inventory level for a selected item, however this only seems to work on the Product details page - but does not appear on the Category gird listing of products when editing .... snippets/products.rain. 

I can get the product.title and etc but not others such as product.stock.level. 

{% set stockdrx = product.stock.level %} current stock= {{ stockdrx }}

Is this some kind of bug and or known limitation?  


  • sspindsspind Member Posts: 7
    edited April 2019

    Same issue .. any advice?

  • JoeyJoey Administrator, Moderator, Lightspeed Staff Posts: 221 moderator

    This is a known limitation, the collection pages (like the category page) only know about the Default variant.

    The developer toolbar will show the available variables for the page you are on. Enable it by searching tb/show in the frontend searchbar.

    eCom Support Team
    Lightspeed HQ
  • moarcandsurplusmoarcandsurplus Member Posts: 1

    Hello ! But what if i want the possibles variants of my products, (that is available in the product page itself) IN the products listing page. In my case, i want to display the possible colors -- as tile -- of my product: that is a common behaviour in many site ... any advice ? Thank you !!

Sign In or Register to comment.