Skip to main content
Solved

Back in Stock for Shopify Multiple Variants Out of Stock Error


Forum|alt.badge.img

I have added the back in stock code snippet to my themes.liquid page above the body as described in the instructions. The notify me button appears on out of stock items but when I test this feature and click the button the notify me is only showing for the size small and I want the notification for the 2XL. How do I fix this? The back in stock flow has been setup and is live using the the back in stock standard template with the klaviyo triggered automatically populates. My API has been replaced in the example and the list ID as well for allow the customer to opt-in to my newsletter (this is also working). 

Using the dawn theme. Website: https://thesmartwanderer.com

Product example: Oatmeal Patch Pocket Ribbed Knit Short Sleeve Sweater

Summary: I have one product with more than one size out of stock. The Klaviyo back in stock feature pop has an error only allowing notification for the first out of stock item.

<script src="https://a.klaviyo.com/media/js/onsite/onsite.js"></script>
<script>
    var klaviyo = klaviyo || [];
    klaviyo.init({
      account: "replaced",
      list: "replaced",
      platform: "shopify"
    })
    klaviyo.enable("backinstock",{ 
    trigger: {
      product_page_text: "Notify Me When Available",
      product_page_class: "button",
      product_page_text_align: "center",
      product_page_margin: "0px",
      replace_anchor: false
    },
    modal: {
     headline: "{product_name}",
     body_content: "Register to receive a notification when this item comes back in stock.",
     email_field_label: "Email",
     button_label: "Notify me when available",
     subscription_success_label: "You're in! We'll let you know when it's back.",
     footer_content: '',
     additional_styles: "@import url('https://fonts.googleapis.com/css?family=Helvetica+Neue');",
     drop_background_color: "#000000",
     background_color: "#ffffff",
     text_color: "#222222",
     button_text_color: "#ffffff",
     button_background_color: "#121212",
     close_button_color: "#cccccc",
     error_background_color: "#121212",
     error_text_color: "#DA1D1D",
     success_background_color: "#FAEDE5",
     success_text_color: "#FFFFFF"
    }
  });
</script>  

Best answer by emma.owens

Hi ​@The Smart Wanderer ! Thank you for reaching out to the Community. 

I’ve read over your post, and just have a few clarifying questions. So when I look at the example product that you included (https://thesmartwanderer.com/products/oatmeal-patch-pocket-ribbed-knit-short-sleeve-sweater), when I select the Small in Oatmeal, the button says ‘Sold Out’ but when I select the 2XL, it says ‘Unavailable’. Based on your question, it sounds like you want all of these to say ‘Sold Out’? Or would you like to show ‘Unavailable’ for the product variants that don’t exist in your inventory? 

Also, I am wondering if its possible on the backend of your site to exclude the unavailable variants from even showing as an option on the product page. That way, customers will be able to see that the product in the color/size doesn’t exist. It may be worth reaching out to Shopify to see if this is possible! 

View original
Did this topic or the replies in the thread help you find an answer to your question?

2 replies

Forum|alt.badge.img

Okay, so I figured out where the problem is coming from. The size in that color option is not offered in my inventory. Which is why it is unavailable. However, to lessen confusion to the customer, I would like to exclude the “notify when available” button from showing on products that aren’t offered in for the given selection. I see there is a code for exclusion with tags but how do I tag for a specific product that is not in my inventory. There must be some way to add code to this feature. Any help is good help!


emma.owens
Community Manager
Forum|alt.badge.img+16
  • Community Manager
  • 126 replies
  • Answer
  • March 13, 2025

Hi ​@The Smart Wanderer ! Thank you for reaching out to the Community. 

I’ve read over your post, and just have a few clarifying questions. So when I look at the example product that you included (https://thesmartwanderer.com/products/oatmeal-patch-pocket-ribbed-knit-short-sleeve-sweater), when I select the Small in Oatmeal, the button says ‘Sold Out’ but when I select the 2XL, it says ‘Unavailable’. Based on your question, it sounds like you want all of these to say ‘Sold Out’? Or would you like to show ‘Unavailable’ for the product variants that don’t exist in your inventory? 

Also, I am wondering if its possible on the backend of your site to exclude the unavailable variants from even showing as an option on the product page. That way, customers will be able to see that the product in the color/size doesn’t exist. It may be worth reaching out to Shopify to see if this is possible!