Jump to content

Always show product availability


ferramentaacasa

Recommended Posts

Hi, I set up my store to allow order also for products that quantity is <=0.

So, in Product configuration setted to show product quantities in the product page and allowed orders for out of stock products. Maybe I have a problem with my template but I can see availability of products only when are >0. I need to always show availability(2 available, 0 available, -2 available).

 

Here is my BO products configuration:

post-1008761-0-14921200-1481709902_thumb.png

 

This is my FO product page(this size not available):

post-1008761-0-13420300-1481710007_thumb.png

 

This is my FO product page(size available):

post-1008761-0-58307700-1481710043_thumb.png

 

This is my FO product page(in BO setted to not allow orders for not available products):

post-1008761-0-31623600-1481710299_thumb.png

 

As you can see, only when the product is >0 the availability is shown. I just want to ALWAYS show availability because I need to allow orders for out of stock products.

 

 

I think that I need to edit this part of product.tpl

{if ($display_qties == 1 && !$PS_CATALOG_MODE && $PS_STOCK_MANAGEMENT && $product->available_for_order)}
<!-- number of item in stock -->
<p id="pQuantityAvailable"{if $product->quantity <= 0} style="display: none;"{/if}>
<span id="quantityAvailable">{$product->quantity|intval}</span>
<span {if $product->quantity > 1} style="display: none;"{/if} id="quantityAvailableTxt">{l s='Item'}</span>
<span {if $product->quantity == 1} style="display: none;"{/if} id="quantityAvailableTxtMultiple">{l s='Items'}</span>
</p>
{/if}
{if $PS_STOCK_MANAGEMENT}
<!-- availability -->
<p id="availability_statut"{if ($product->quantity <= 0 && !$product->available_later && $allow_oosp) || ($product->quantity > 0 && !$product->available_now) || !$product->available_for_order || $PS_CATALOG_MODE}{/if}>
{*<span id="availability_label">{l s='Availability:'}</span>*}
<span id="availability_value"{if $product->quantity <= 0 && !$allow_oosp} 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>
{hook h="displayProductDeliveryTime" product=$product}
<p class="warning_inline" id="last_quantities"{if ($product->quantity > $last_qties || $product->quantity <= 0) || $allow_oosp || !$product->available_for_order || $PS_CATALOG_MODE}{/if} >{l s='Warning: Last items in stock!'}</p>
{/if}
<p id="availability_date"{if ($product->quantity > 0) || !$product->available_for_order || $PS_CATALOG_MODE || !isset($product->available_date) || $product->available_date < $smarty.now|date_format:'%Y-%m-%d'}{/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>
<!-- Out of stock hook -->
<div id="oosHook"{if $product->quantity > 0} style="display: none;"{/if}>
{$HOOK_PRODUCT_OOS}
</div>

tried different things removing some of

style="display: none;"

with no success.

 

 

I will appreciate your help.

Thank you in advance.

 

Link to comment
Share on other sites

  • 1 month later...

Hi, I tried to change the code of the first post to:

{if ($display_qties == 1 OR $product->quantity <= $last_qties && !$PS_CATALOG_MODE && $PS_STOCK_MANAGEMENT && $product->available_for_order)}
<!-- number of item in stock -->
<p id="pQuantityAvailable"{if $product->quantity <= 0} style="display: none;"{/if}>
<span id="quantityAvailable">{$product->quantity|intval}</span>
<span {if $product->quantity > 1} style="display: none;"{/if} id="quantityAvailableTxt">{l s='Item'}</span>
<span {if $product->quantity == 1} style="display: none;"{/if} id="quantityAvailableTxtMultiple">{l s='Items'}</span>
</p>
{/if}
{if $PS_STOCK_MANAGEMENT}
<!-- availability -->
<p id="availability_statut"{if ($product->quantity <= 0 && !$product->available_later && $allow_oosp) OR ($product->quantity > 0 OR !$product->available_now) OR !$product->available_for_order OR $PS_CATALOG_MODE} style="display: none;"{/if}>
{<span id="availability_label">{l s='Availability:'}</span>}
<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>
{hook h="displayProductDeliveryTime" product=$product}
<p class="warning_inline" id="last_quantities"{if ($product->quantity > $last_qties || $product->quantity <= 0) || $allow_oosp || !$product->available_for_order || $PS_CATALOG_MODE} {/if} >{l s='Warning: Last items in stock!'}</p>
{/if}
<p id="availability_date"{if ($product->quantity > 0) || !$product->available_for_order || $PS_CATALOG_MODE || !isset($product->available_date) || $product->available_date < $smarty.now|date_format:'%Y-%m-%d'} {/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>
<!-- Out of stock hook -->
<div id="oosHook"{if $product->quantity > 0}{/if}>
{$HOOK_PRODUCT_OOS}
</div>

So, I saw that the only text shown is the availability of the product or combination "1 Item" or "2+ Items" but never seen "This product is no longer in stock" or "Warning: Last items in stock!". I can't understand why!

 

Thank you

  • Like 1
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...