Jump to content

How to show soldout flag on product list


Tony Chill

Recommended Posts

Hello,

Here is a piece of code i built for my product list and product pages, you just need to modify it with the way you want to display the flag.
It takes into account the combinations stocks too.

You will need to do a little css too, and if you want to display it only on product-list you'll just need to hide it on product pages with css.

In Themes > name of your themes > templates > catalog > _partials > miniatures > product.tpl

Add this piece of code at the end of your file and before the </div></div>{/if} closure (please adapt it to your display needs) :
 

             {block name='product_availability'}
                  <span id="product-availability">
                    {if $product.show_availability && $product.availability_message}
                      {if $product.availability == 'available'}
                        <div class='instock'>&#9642;</div><div class='instock hover'>&#10004; {l s='En stock'}</div>
                      {elseif $product.availability == 'last_remaining_items'}
                        <div class='instock'>&#9642;</div><div class='instock hover'>&#10004; {l s='Derniers articles'}</div>
                      {else}
                        <div class='outofstock'>&#9642;</div><div class='outofstock hover'>&#10008; {l s='Hors stock'}</div>
                      {/if}

                    {/if}
                  </span>
                {/block}


Hope it'll help.
 

Link to comment
Share on other sites

  • 1 year later...
  • 5 months later...

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...