Eowyn_86 Posted June 5, 2013 Share Posted June 5, 2013 (edited) Hi, First of all, sorry for my english, it's a little bit bad, but I will try to explain my problem the best I can. I have a shop with a lot of products, all of them with stock 0. I don't want to change that, because my supplier doesn't provide me with that information. I only know if there is stock or not. In case of there is no stock, I have the date when product arrives. So, my intention is put "Stock / No Stock" on the box Available Now, and the date on the box Available Later. Here comes the problem. Prestashop understands that if the stock is 0, the product isn't available, for consecuence, the text on Available Now doesn't appear. Doesn't even appear the text "Availability:" on the page product. I'll show you an image: I want that in the page product appears the next: In case of stock Availability: Stock In case of no stock Availability: No Stock - Approximate date: 20/07/2013 How I can change the code of product.tpl to make that possible? Do I have to change only product.tpl or another one too? My Prestashop version is 1.4.7. Thanks in advance!! =) Edited June 5, 2013 by Eowyn_86 (see edit history) Link to comment Share on other sites More sharing options...
razaro Posted June 5, 2013 Share Posted June 5, 2013 (edited) It depends from your Prestashop version and theme.So in 1.5 in Product back office on Quantity tab you can make settings like thisso in front office on default theme it showsCode for it is in product.tpl <!-- 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_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> <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> but maybe it is removed from your theme or hidden with css. Edited October 23, 2015 by razaro (see edit history) 2 Link to comment Share on other sites More sharing options...
Eowyn_86 Posted June 5, 2013 Author Share Posted June 5, 2013 (edited) Hi razaro, thanks for answering! My Prestashop version is 1.4.7 and there is no way to make it work. Some time ago, I tried to modify the code on product.tpl, and it worked. But it was on the 1.5.3 version. I don't know if that may be the problem... This is the code: <p id="availability_statut" {if ($product->quantity <= 0 && !$product->available_later && $allow_oosp)} style="display:block;" {/if}> <span id="availability_label"> {l s='Availability:'} {$product->available_now} </span> <span id="availability_value" {if $product->quantity <= 0} class="warning_inline" {/if}> {if $product->quantity <= 0 && $allow_oosp} {if $product->available_later} {l s='Fecha aproximada: '}{$product->available_later} {/if} {else} {l s='This product is no longer in stock'} {/if} </span> </p> Any ideas? Edited June 5, 2013 by Eowyn_86 (see edit history) Link to comment Share on other sites More sharing options...
razaro Posted June 6, 2013 Share Posted June 6, 2013 (edited) OK for 1.4 version try this <!-- availability --> <p id="availability_statut" style="display:block;"> {if ($product->quantity > 0 && $product->available_now) && $product->available_for_order && !$PS_CATALOG_MODE} <span id="availability_label"> {l s='Availability:'} {$product->available_now} </span> {/if} <span id="availability_value" {if $product->quantity <= 0} class="warning_inline" {/if}> {if $product->quantity <= 0 && $allow_oosp} {if $product->available_later} {l s='Availability date:'}{$product->available_later} {/if} {elseif $product->quantity <= 0 && !$allow_oosp} {l s='This product is no longer in stock'} {/if} </span> </p> and settings for product in back office Edited October 23, 2015 by razaro (see edit history) Link to comment Share on other sites More sharing options...
Eowyn_86 Posted June 6, 2013 Author Share Posted June 6, 2013 I've done that exactly like you told me, but it doesn't work. It only appears the date, but not the label "Availability Date:". It seems to be that Prestashop ignores any code or any word or phrase that I put in there. Link to comment Share on other sites More sharing options...
razaro Posted June 6, 2013 Share Posted June 6, 2013 Can you post link to website ? Link to comment Share on other sites More sharing options...
Eowyn_86 Posted June 6, 2013 Author Share Posted June 6, 2013 It's http://elbunkerz.com And the product I'm checking is that one: http://elbunkerz.com/product.php?id_product=7 Link to comment Share on other sites More sharing options...
Kiseki Posted July 29, 2013 Share Posted July 29, 2013 Thanks for this, it works perfectly on my shop, however I would also like to use this on the product-list.tpl file but the code doesn't seem to work the same as in product.tpl. Any idea how I can get it to work on product-list.tpl as well? Thanks for your help. It depends from your Prestashop version and theme. So in 1.5 in Product back office on Quantity tab you can make settings like this so in front office on default theme it shows Code for it is in product.tpl <!-- 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_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> <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> but maybe it is removed from your theme or hidden with css. Link to comment Share on other sites More sharing options...
Eduardo Vilar Posted August 27, 2013 Share Posted August 27, 2013 Not sure I understand your problem, but in BO enable Allow purchases when the product is out of stock, it will allow the purchase and keep the warning and when available I'm sorry you already tried that and it did not work Success and good sales! It's http://elbunkerz.com And the product I'm checking is that one: http://elbunkerz.com...hp?id_product=7 Link to comment Share on other sites More sharing options...
Ron morales Posted September 17, 2013 Share Posted September 17, 2013 (edited) prestashop 1.5.4.1 I need to put a picture in stock but if I have no way of ignoring me, because they are governed by product.js know any way to do? Edited September 17, 2013 by Ron morales (see edit history) Link to comment Share on other sites More sharing options...
mouse1 Posted February 5, 2014 Share Posted February 5, 2014 Hello everyone. I would also like to have an approximate date of availability in my front office, but it only works when "Allow orders" is ticked in BO which I do not want. I'd like to have the same as in the 2nd pic in post No. 2 above, but I do not want my customers to be able to order, I just want them to have that information when the item is going to be available. Link to comment Share on other sites More sharing options...
sanl Posted June 13, 2014 Share Posted June 13, 2014 It depends from your Prestashop version and theme. So in 1.5 in Product back office on Quantity tab you can make settings like this img1.JPG so in front office on default theme it shows s2.JPG Code for it is in product.tpl <!-- 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_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> <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> but maybe it is removed from your theme or hidden with css. It works perfect for me, but what IF i would like to add icon in product-list. Its icon to see which product have availability date. I tryed this: {elseif ($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 class="pre-order_icon" title="{l s='Prekės išsiunčiamos'}{dateFormat date=$product->available_date full=false} But i just got blank page in product page. Link to comment Share on other sites More sharing options...
ferramentaacasa Posted December 21, 2016 Share Posted December 21, 2016 Hi, I have a similar issue in my shop. I explained it here. If someone knows how can I do. Thanks.. Link to comment Share on other sites More sharing options...
Tahsin_85 Posted February 7, 2017 Share Posted February 7, 2017 Same issue Link to comment Share on other sites More sharing options...
DJFearRoss Posted June 23, 2017 Share Posted June 23, 2017 I would like to know this as well. I've got version 1.6: so, whilst NOT allowing customer to order stock, display a date for that particular item. It must also work for combinations. So Red XL would be one date, Blue XL another date etc. ORJust display a 'more stock due date' based on selection, regardless of whether there are still some in stock or not. 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