Hello, I would like to set an automatic default value to all products, in "Displayed text when in-stock" form, in quantities produtcs tab. Can someone help? This is what i had discovered so far: In Prestashop Admin the form is here: Admin->Catalog->Products->Quantities->Displayed text when in-stock Here is what it looks like in Prestashop Admin: On the server the file that must be edited is: /public_html/admin/themes/default/template/controllers/products/quantities.tpl Here is what it looks like on the server: On quantities.tpl file i need to edit line 248: "input_value=$product->available_now" {if $ps_stock_management} <div class="form-group"> <div class="col-lg-1"><span class="pull-right">{include file="controllers/products/multishop/checkbox.tpl" field="available_now" type="default" multilang="true"}</span></div> <label class="control-label col-lg-2" for="available_now_{$default_language}"> <span class="label-tooltip" data-toggle="tooltip" title="{l s='Forbidden characters:'} <>;=#{}"> {l s='Displayed text when in-stock'} </span> </label> <div class="col-lg-9"> {include file="controllers/products/input_text_lang.tpl" languages=$languages input_value=$product->available_now input_name='available_now'} </div> </div> ==================================================================== My question is: How can i edit this line: input_value=$product->available_now so the automatic default value "In stock" is set to all products in shop? PS: I have replaced input_value=$product->available_now with input_value="In stock" but in admin shop is displayed only "s" value. Thanks!
Won't the "In stock"-text show as long as the item is actually in stock? Ie, the amount of items in stock is more than 0?
Hello, If all the products that are in stock, will by default, automaticly show the value "in stock" it would be perfect. But right now, you need to manually fill the form, with the text "in stock" for every product that is in stock.
Aha. Okay, I would probably just check the database to see where that information is stored, and update the database directly (instead of using the form to fill it out for every product). That way you will have what you want, don't have to change anything on-site, and it will even show up if you go into a product later and change it to something different.
Thanks for your answer! That would be a solution, in general, but unfortunatelly, not in this case. The client is posting products every day, for a few hours a day. This will need multiple update of the database/day. That is why it will need an automatic solution. The problem is I am not so familiar whith php sintax so i can edit that fragment of code.
I'm hoping at least that the client runs this on his own server / VPS / something? If so, set up a cron-job, with a tiny PHP-script running an update on the database every... hour? "UPDATE table_name SET status_text = 'In stock' WHERE status_text = ''" (or something similar). Simple, easy, and will run in the background on the server (as long as the script works and is put into crontab)
Isn't he posting the updates to the database multiple times a day? If so why would it be so hard to retrieve the data?
The client is manually uploding products every day, so he would like that this section to be by default filled with "In stock" so that he can simplify his work.
Thanks @PoPSiCLe. If we do not find a solution, using PHP coding, your solution is the next best thing!
I have found the solution: In Prestashop 1.6 the file needed to be edited is product.tpl (/public_html/themes/YourTheme/product.tpl) 1. I deactivated the lines 207-211 <p id="availability_statut"{if !$PS_STOCK_MANAGEMENT || ($product->quantity <= 0 && !$product->available_later && $allow_oosp) || ($product->quantity > 0 && !$product->available_now) || !$product->available_for_order || $PS_CATALOG_MODE} style="display: none;"{/if}> <label id="availability_label" class="attribute_label">{l s='Availability:'}</label> <span id="availability_value" class="label{if $product->quantity <= 0 && !$allow_oosp} label-danger{elseif $product->quantity <= 0} label-warning{else} label-success{/if}">{if $product->quantity <= 0}{if $PS_STOCK_MANAGEMENT && $allow_oosp}{$product->available_later}{else}{l s='This product is no longer in stock'}{/if}{elseif $PS_STOCK_MANAGEMENT}{$product->available_now}{/if}</span></p> 2. And added this code, under the original one: <p> <label>{if $product->quantity > 0}<div class='instoc'>{l s='Disponibilitate:'} <span style="color:#41ae53">{l s='In stoc'}</span></div>{else}<div class='outofstoc'>{l s='Disponibilitate:'} <span style="color:#F13340">{l s='Produsul nu se afla momentan pe stoc'}</span></div>{/if} </label> </p> Here is what the fix looks like: Thanks for your help!