Message display depending of inventory quantity - Minimal Theme

Shopify Partner
2 0 2

Hi everybody,

 

I've just change theme (I was using Debut)

I've setup some javascript code in order to show to the customer if can be dilvered instantly or not (I'm selling digital)

But it's not working anymore, the "livraison-inst" is displaying, the other one doesn't

Here is the code

<p class = "livraison-inst" style="display:none;font-size:24;" align="center"><i><b> Livraison instantanée </b></i></p>
<p class = "livraison-48h" style="display:none;font-size:24;" align="center"><i><b> Livraison sous 48 heures </b></i></p>

<span class="variant_inventory_quantity">
{% if variant.inventory_quantity > 0 %}            
<style>
  .livraison-inst
  {
    display:block!important;
    border:3px solid grey;
  }
  </style>
  {% else %}
  <style>
.Livraison-48h
{
  display:block!important;
  border:3px solid grey;
}
        </style>
{% endif %}
          </span>
1 Like
Shopify Partner
50 10 21

Hey Julien,

 

Class names are case sensitive in CSS (for example, check this jsfiddle). Try changing the L to an l and see if that works.

 

hope that helps!

Code 402 Inc - Ecommerce Consulting in Kitchener, Ontario, Canada
0 Likes