Hello at all,
i’ve tried to install the recommended back in stock solution on my free template venture but it doesn’t work.
- i get the following error in the dev console:
Uncaught TypeError: klaviyo.init is not a function - i’ve tried to fix this with all related help articles, but it’s still doesn’t work.
The Button is not displayed on my product pages. I can see only the “sold out” and dynamic payment button.
I’ve checked by myself if its work, if i disable the dynamic payment buttons, but this was not successful.
I’ve tried to fix this with following recommended functions
- alternate_anchor
- display_on_policy_continue: true
- replace_anchor
Here you will see the added code:
<script src="https://a.klaviyo.com/media/js/onsite/onsite.js"></script>
<script>
var klaviyo = klaviyo || a];
klaviyo.init({
account: "REMOVED",
platform: "shopify"
});
klaviyo.enable("backinstock",{
trigger: {
product_page_text: "Notify Me When Available",
product_page_class: "btn btn--full",
product_page_text_align: "center",
product_page_margin: "0px",
alternate_anchor: "AddToCart-product-template",
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>
I am happy about hints and your help.
Thanks,
Torben