Jump to content

I would like to show my products Out of stock


Recommended Posts

Hello,i have the edition Prestashop 1.5.4.1.

 

I would like your help.I would like to show my products Out of stock when i have choosen

Allow ordering of out-of-stock products : Υes in  Preferences separator_breadcrumb.png Products .

 

When i choose it,the products that i have in stock seem for example : 5 items and the products that are out of stock seem nothing..I would like to seem that the products are out of stock..

 

Thank you very much for your help..

Link to comment
Share on other sites

you have to check product settings under the "quantities" tab on product edit page

there is a field to define:

IkTATpV.png

 

make sure that you use "allow orders" or "default" - then this option will be exactly the same as option defined under preferences  > products tab

  • Like 1
Link to comment
Share on other sites

I have this choice that you told me.I don't have any problem with Add cart.The Add cart works perfect..The only problem is that doesn't appear that my product is no longer in stock..I want this to seem in my page..:)

 

I think the problem is in product.tpl.

in these lines with if states:

 

  <div id="product_stock_stat">
                            <!-- availability -->
                            <p id="availability_statut"{if ($product->quantity <= 0 && !$product->available_later && $allow_oosp) OR ($product->quantity > 0 && !$product->available_now) OR !$product->available_for_order OR $PS_CATALOG_MODE} style="display: none;"{/if}>    
                                <span id="availability_value"{if $product->quantity <= 0} class="warning_inline"{/if}>{if $product->quantity <= 0}{if $allow_oosp}{$product->available_later}{else}{l s='This product is no longer in stock'}{/if}{else}{$product->available_now}{/if}</span>                
                            </p>
                            
                            <p id="availability_date"{if ($product->quantity > 0) OR !$product->available_for_order OR $PS_CATALOG_MODE OR !isset($product->available_date) OR $product->available_date < $smarty.now|date_format:'%Y-%m-%d'} style="display: none;"{/if}>
                <span id="availability_date_label">{l s='Availability date:'}</span>
                <span id="availability_date_value">{dateFormat date=$product->available_date full=false}</span>
                            </p>                              
                                

                            <!-- number of item in stock -->
                            {if ($display_qties == 1 && !$PS_CATALOG_MODE && $product->available_for_order)}
                            <p id="pQuantityAvailable"{if $product->quantity <= 0} style="display: none;"{/if}>
                                    <span>(</span><span id="quantityAvailable">{$product->quantity|intval}</span>
                                    <span {if $product->quantity > 1} style="display: none;"{/if} id="quantityAvailableTxt">{l s='item'}<span>)</span></span>
                                    <span {if $product->quantity == 1} style="display: none;"{/if} id="quantityAvailableTxtMultiple">{l s='items'}<span>)</span></span>
                            </p>
                            {/if}

                            <p class="warning_inline" id="last_quantities"{if ($product->quantity > $last_qties OR $product->quantity <= 0) OR $allow_oosp OR !$product->available_for_order OR $PS_CATALOG_MODE} style="display: none"{/if} >{l s='Warning: Last items in stock!'}</p>
                        </div>    


                        <div id="product_reference" {if !$product->reference}style="display: none;"{/if}>
                            <label for="product_reference">{l s='Reference:'} </label>
                            <span class="editable">{$product->reference|escape:'htmlall':'UTF-8'}</span>
                        </div>


                    </div>

                    <!-- Out of stock hook -->
                    <div id="oosHook"{if $product->quantity > 0} style="display: none;"{/if}>
                        {$HOOK_PRODUCT_OOS}
                    </div>

                    {if isset($addThisRender)}
                        <!-- AddThis Social Sharing -->
                        {$addThisRender}
                    {/if}

 

Thank you very much..
 

Link to comment
Share on other sites

When i have products in stock.I see:   5 items  for example.

But when the products are out of stock i see nothing..I would like to see that:  this product is out of stock..

Why i don't see anything and how can i see it (this product is out of stock)..?

Link to comment
Share on other sites

I havent tested this, but would something like this work ?

<!-- number of item in stock -->
{if ($display_qties == 1 && !$PS_CATALOG_MODE && $product->available_for_order)}

	<p id="pQuantityAvailable">
    
    {if $product->quantity <= 0}Out Of Stock

 {else}
		<span>(</span><span id="quantityAvailable">{$product->quantity|intval}</span>
			<span {if $product->quantity > 1} style="display: none;"{/if} id="quantityAvailableTxt">{l s='item'}<span>)</span></span>
            
		<span {if $product->quantity == 1} style="display: none;"{/if} id="quantityAvailableTxtMultiple">{l s='items'}<span>)</span></span>{/if}
                            </p>


{/if}
Edited by MerseyRay (see edit history)
Link to comment
Share on other sites

I think what you want is the 2 boxes under what Vekia has said.

 

attachicon.gifoutofstock.jpg

 

Just type in there what you wish it to say.

 

Its on menu item CATALOGUE / PRODUCTS / QUANTITIES

 

EDIT: oops, thats for items in stock and back ordering.

 

Thank you..

 

This is that I want..Thank you very much..:)

Link to comment
Share on other sites

×
×
  • Create New...