How to access Product Varient Quantity in Stock?

No one helped me figure out my issue. I’m guessing they don’t give access to what I want. But yes, my code works if there is just one product (no varients). You might have to do a little studying to figure out how the coding works, but to make mine work is pretty straight forward.

  1. “Turn on Developer tools” to enable the coding (now your site editor will look a little different)
  2. Create a normal text box on your product page to display the number of remaining products (this is the red “200 remaining” text in my picture) you can type some temporary text and then change size, color, font, etc. And just drag the box to where every you want it to display.
  3. Give this text box a new name in it’s properties box “quantityRemainingText” or give it any name you want and change the code to match (anywhere you see “quantityRemainingText”)
  4. Paste my code into your store product page. (bottom of the screen on your editor)
  5. Edit the first two lines of my code to fit your needs, i.e., change the 200 in
    let productQuantityNum = 200 to the number you want, and you can change the text in
    let soldOutText = “Edition Sold Out” if you want it to say something else when the product quantity reaches 0.
    Note: Setting productQuantityNum is not particularly necessary because the number should get filled in automatically by your products inventory. Of course you will have to adjust your products’ initial inventory in the normal way in the manage products area.

Hope you can figure it out and send me a message if you get stuck.