Jump to content

Display "Out of Stock" in product catalog


oliwil

Recommended Posts

Hi im using prestashop 1.7.7.3 and I'm trying to show label of "out of stock" when quantity is 0.

First picture is what I'd like it to look like and second picture is what is actually showing after I followed the steps below. But the colors aren't showing and the label of out of stock is not placed right.

 

I've followed this:

In your themefolder/templates/catalog/_partials/miniatures/product.tpm just before the the "thumbnail-container" div closes

 

{block name='product_miniature_item'}
        {if $product.quantity > 0}
            <span class="availability-list availability-list-in-stock">In Stock</span>

       {else}

            <span class="availability-list availability-list-out-of-stock">Out of Stock</span>
        {/if}
 {/block}

 

And in themefolder/assests/css/custom.css file (for example) something like

 

.availability-list{

padding: 4px;

color:white;

position: absolute;

right:0;

bottom:0;

}

.availability-list-in-stock{

background-color: green;

}

.availability-list-out-of-stock{

background-color red;

}

.thumbnail-container{

position: relative

}

Screenshot_20210918-172909_Chrome.jpg

Screenshot_20210918-172622_Chrome.jpg

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...