Solved

Back in stock "notify me when available" button not showing, only shows "sold out"

  • 27 August 2022
  • 7 replies
  • 843 views

Badge +4

Hi, I set up back in stock  flow for my Shopify store owner. I have updated Shopify theme.liquid with the klaviyo provided sniped code installation. But in product page not showing "notify me when available" button. only shows "SOLD OUT"

 

After code installation

 

And my client Shopify theme is "Dev working z dzine Niket[6/6]"

What is the reason for not showing "notify me when available" button, Have I missed anything? Or what to do more.

Please help me with a solution. I will be greatful to you all.

Thanks in Advance
A.Hossain

icon

Best answer by Manny Singh 27 August 2022, 16:58

View original

7 replies

Userlevel 7
Badge +38

Hi, to help troubleshoot, please share the code/html of the button on the product page and the code for the out of stock provided by Klaviyo

Badge +4
<script src="https://a.klaviyo.com/media/js/onsite/onsite.js"></script>
<script>
var klaviyo = klaviyo || [];
klaviyo.init({
account: "PUBLIC_API_KEY",
platform: "shopify"
});
klaviyo.enable("backinstock",{
trigger: {
product_page_text: "Notify Me When Available",
product_page_class: "btn",
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: "#000",
background_color: "#fff",
text_color: "#222",
button_text_color: "#fff",
button_background_color: "#439fdb",
close_button_color: "#ccc",
error_background_color: "#fcd6d7",
error_text_color: "#C72E2F",
success_background_color: "#d3efcd",
success_text_color: "#1B9500"
}
});
</script>
Badge +4

Thanks for your reply.

Userlevel 7
Badge +38

I see one line of code that needs to be udpated:

account: "PUBLIC_API_KEY"

 

Replace PUBLIC_API_KEY with the actual key, which can be found here: 

 

https://help.klaviyo.com/hc/en-us/articles/115005062267-How-to-Manage-Your-Account-s-API-Keys

 

 

Badge +4

Thanks for helping. yes, it was replaced when I installed it. but not showed notify me button.
I heard that some of Shopify's theme does not work properly, I am wondering if something like that, Or need any additional coding for the subscribe pop-up.

Badge

I have the same problem. Has anyone figured this out?

 

I’m seeing this error in the Javascript Console;

Unhandled Promise Rejection: SyntaxError: The string did not match the expected pattern.
promiseEmptyOnRejected — century:403

 

And also this

Failed to load resource: the server responded with a status of 404 (Not Found)
https://cdn.shopify.com/shopifycloud/shop-js/v1.0/client.js.map

Userlevel 7
Badge +36

Hi @peter586,

 

May I ask what Shopify theme you are using? As my colleague David mentions here, the back-in-stock snippets that we provide are only supported in Shopify’s basic free themes:

 

As for the errors, I would recommend reading through these threads as a start, since the back-in-stock button can malfunction as a result of several different things:

 

Best,

Brian

Reply