Solved

Back in Stock Button Not Working

  • 4 June 2021
  • 7 replies
  • 157 views

Badge

Hello,

Is there anyone out there that might be able to help me out with this issue?

Problem: When selecting a product that is sold out - #1 the notify me when back in stock button is not showing up. #2 But, when the product page is refreshed it does show up - #3 however it will show up even for products that are in stock (right under the add to cart button)

I attached a few screen shots of the code and what the buttons looks like. 1,2,3

If someone has experienced this and can help me out it would be super helpful. Thanks in advance!

 

icon

Best answer by klaviyojad 4 June 2021, 18:40

@TOMWOLFE thanks for the reply.  So you are saying that the page only displays “Selected Variant” once when the page is loaded and that it doesnt print anything new when you keep changing variants?

So after page loads, change to a different variant and then to another different variant, no new output from Klaviyo?

This would be an indication that the Backbone JS application is not recognizing the variant changes  

View original

7 replies

Userlevel 1
Badge

@TOMWOLFE may we ask what Shopify theme you are using?  While it is difficult to solve this without opening the product page directly and interacting with it,  could you perhaps share what you see in the javascript console:

  1.  upon first opening a product page
  2.  when you switch to a variant that is out of stock
  3.  when you switch to a variant that is available

Klaviyo will be printing the variant ids.  Please indicate if they reflect the ID of the variant selected.

Could it be that the Back in Stock widgets are always one step behind the real situation?

If so we might have a solution that may require adding additional Javascript to your theme

Badge

Thanks for the reply!

 

The variant selected doesn't change from what it was set to on page load, here it's 37597785981081 - which is the variant that is sold out, if you change it in the dropdown while looking at the log here in the console, it doesn't change, so that's why it's not updating the button.

 

Userlevel 1
Badge

@TOMWOLFE thanks for the reply.  So you are saying that the page only displays “Selected Variant” once when the page is loaded and that it doesnt print anything new when you keep changing variants?

So after page loads, change to a different variant and then to another different variant, no new output from Klaviyo?

This would be an indication that the Backbone JS application is not recognizing the variant changes  

I have a similar issue, however my URL does change when a variant is clicked.  The klaviyo back in stock signup popups up pre-selected to the default variant but does not update when the variant is changed even though the URL changes also.

Product Page URL: https://bleusalt.com/products/the-turtleneck (or look for an item in which a color/size combo is out of stock.

@klaviyojad is there a solution to get Klaviyo to trigger when variants are changed?

Userlevel 1
Badge

@Nicholas you are asking a generic question.  This functionality works for basic shopify themes.  You would need to work with a Klaviyo Product Expert to investigate product pages for your store to make any determination.  For that you would need to file a support ticket.

I am just asking if there is a solution to the problem asked in this thread?

Reply