Skip to main content
Jul 2, 2021 4:51 PM UTC
Solved

Slightly modify back in stock Modal styling

Hi there,

i am using Shopify and i would like to make some slight modifications to the back in stock modal, not a complete custom solution but:

  • Make the heading in bold letters
  • Gray-out the variant dropdown
  • Add letter spacing in the button
  • Change some of the font sizes
  • ideally change the size of the modal

Is this doable through some extra variables? if not what’s a good solution? I was hoping there was a designer tool like the sign up forms but it doesn't seem like. 

This topic has been closed for replies.
jallain
jallainAnswer
Klaviyo Employee
Jul 2, 2021 6:57 PM UTC

Hello @lif-ab , we have some information on how you can customize the back in stock features in this article: https://help.klaviyo.com/hc/en-us/articles/360001895651-How-to-Install-Back-in-Stock-for-Shopify

10 replies

jallain
Klaviyo Employee
jallainAnswer
Klaviyo Employee
Jul 2, 2021 6:57 PM UTC

Hello @lif-ab , we have some information on how you can customize the back in stock features in this article: https://help.klaviyo.com/hc/en-us/articles/360001895651-How-to-Install-Back-in-Stock-for-Shopify

Jul 2, 2021 7:23 PM UTC

Hello @lif-ab , we have some information on how you can customize the back in stock features in this article: https://help.klaviyo.com/hc/en-us/articles/360001895651-How-to-Install-Back-in-Stock-for-Shopify

 

Hi @jallain thanks, but actually that is clear to me. That document shows how to change names and colors but I would like to change font sizes, formatting and ideally gray out the dropdown.

Contributor II
Sep 22, 2022 7:44 PM UTC

@lif-ab 

 

Hello! In order to provide custom styling, the issue is the Klaviyo BIS is wrapped in an Iframe, and the Iframe gets overridden with the Config settings you pass into the Klaviyo object every time the “Notify me when back in stock” button is clicked. In order to achieve custom styling you can do the following:

 

1.) Create a css Stylesheet in your Assets Folder within Shopify.

 

2.) Update the “additional_styles” property found within the “klaviyo” variable under “modal” “klaviyo.modal.additional_styles”

<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('{{ 'klaviyo-bis-modal.css' | asset_url }}');",
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>

 

3.) Put the “CSS” styles you desire in the “klaviyo-bis-modal.css” file.

 

When the user clicks the “Notify me when back in stock” Klaviyo will then reach out and grab that Stylesheet from Shopify and then inject those styles into the Iframe, styling the BIS Modal how you require.

 

Hope this helps!

Contributor I
Jan 31, 2023 10:59 PM UTC

THANK YOU for this! I had no idea we could import custom CSS sheets. This is exactly what I needed (and a game changer)!

Contributor II
Apr 2, 2023 3:39 PM UTC

I’m glad it helped!

 

I finally got around to creating a more indepth tutorial on it, may be found here if anyone needs in the future!

 

https://firenetdesigns.ca/post/customizing-klaviyo-modal-styling-in-shopify

 

 

 

Contributor I
May 1, 2023 9:15 AM UTC

Hi there,

i am using Shopify and i would like to make some slight modifications to the back in stock modal, not a complete custom solution but:

  • Make the heading in bold letters
  • Gray-out the variant dropdown
  • Add letter spacing in the button
  • Change some of the font sizes
  • ideally change the size of the modal

Is this doable through some extra variables? if not what’s a good solution? I was hoping there was a designer tool like the sign up forms but it doesn't seem like. 

Are you comfortable with writing and editing CSS and HTML code? If not, do you have a developer or designer who can assist you with making these modifications?

Contributor II
May 1, 2023 11:42 PM UTC

Hi there KaisonAndy I am yes! I’ll shoot you a message and see what you’re looking for

Contributor I
Jun 11, 2023 10:40 AM UTC

The desired modifications to the back-in-stock modal in Shopify can be achieved by directly editing the relevant CSS styles within the theme files. While Shopify doesn't offer a dedicated designer tool for customizing the modal, with some CSS and HTML knowledge, you can make these adjustments to enhance the modal's appearance and user experience.

Remember to create a backup or duplicate of your theme before making any changes.

Contributor II
Jun 12, 2023 5:58 AM UTC

To slightly modify the styling of a back-in-stock modal, you'll typically need to make changes to the CSS (Cascading Style Sheets) that govern the appearance of the modal. Here's a general approach you can follow:

  1. Identify the modal element: Inspect the HTML of the back-in-stock modal to identify here https://validwords.com/ the specific HTML element(s) that make up the modal. Look for classes or IDs that uniquely identify the modal container.

  2. Target the modal with CSS: Once you've identified the modal element(s), you can target them using CSS selectors. This allows you to apply styling rules specifically to the modal.

  3. Modify the styling: Write CSS rules to modify the styling of the modal. Here are some common modifications you can make:

    • Adjust the background color, border, or box-shadow properties to change the overall appearance of the modal.
    • Modify the font size, color, or typography properties to adjust the text inside the modal.
Contributor I
Mar 17, 2024 8:43 AM UTC

Did you found solution or not.?