rl_lucian Posted September 29, 2016 Share Posted September 29, 2016 (edited) 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 give me a hand? This is what i had discovered so far: In Prestashop Admin the form is here: Admin->Catalog->Products->Quantities->Displayed text when in-stock On server the file that must be edited is: /public_html/admin/themes/default/template/controllers/products/quantities.tpl 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! Edited September 29, 2016 by rl_lucian (see edit history) Link to comment Share on other sites More sharing options...
Logical IT Posted September 29, 2016 Share Posted September 29, 2016 Hello, I think you will find the answer to your question in this thread: https://www.prestashop.com/forums/topic/259158-solved-displayed-text-when-in-stock/ 1 Link to comment Share on other sites More sharing options...
rl_lucian Posted October 4, 2016 Author Share Posted October 4, 2016 I have found the solution: 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> Link to comment Share on other sites More sharing options...
bikegeek Posted June 27, 2017 Share Posted June 27, 2017 This is what I was looking for. Thanks!Do you know how can I add the colored text box around the text? Catalin 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