ferramentaacasa Posted December 14, 2016 Share Posted December 14, 2016 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: This is my FO product page(this size not available): This is my FO product page(size available): This is my FO product page(in BO setted to not allow orders for not available products): 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 More sharing options...
ferramentaacasa Posted December 21, 2016 Author Share Posted December 21, 2016 Are someone here can help me? Thank you! Link to comment Share on other sites More sharing options...
ferramentaacasa Posted January 23, 2017 Author Share Posted January 23, 2017 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 1 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now