Jump to content

How to add the stock in the blockcart popup


Recommended Posts

Hello

 

I would like to show if a product is in stock or not on the blockcart popup and not on product-list.

 

i try this code but it doesn't work someone to help please!!

 

 

{if (!$PS_CATALOG_MODE && $PS_STOCK_MANAGEMENT && ((isset($product.show_price) && $product.show_price) || (isset($product.available_for_order) && $product.available_for_order)))}
                {if isset($product.available_for_order) && $product.available_for_order && !isset($restricted_country_mode)}
                    <span class="availability">
                        {if ($product.allow_oosp || $product.quantity > 0)}
                            <span class="label{if $product.quantity <= 0 && isset($product.allow_oosp) && !$product.allow_oosp} out-of-stock label-danger{elseif $product.quantity <= 0} label-warning available-dif{else} label-success{/if}">
                                {if $product.quantity <= 0}{if $product.allow_oosp}{if isset($product.available_later) && $product.available_later}{$product.available_later}{else}{l s='In Stock'}{/if}{else}{l s='Out of stock'}{/if}{else}{if isset($product.available_now) && $product.available_now}{$product.available_now}{else}{l s='In Stock'}{/if}{/if}
                            </span>
                        {elseif (isset($product.quantity_all_versions) && $product.quantity_all_versions > 0)}
                            <span class="available-dif label label-warning">
                                {l s='Product available with different options'}
                            </span>
                        {else}
                            <span class="out-of-stock label label-danger">
                                {l s='Out of stock'}
                            </span>
                        {/if}
                    </span>
                {/if}
            {/if}

Edited by laurul (see edit history)
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...