subwayside Posted December 12, 2014 Share Posted December 12, 2014 Hi, I want to make some little change in ps1.6.0.9 please help me anyone soon. When i add any product then availability for product should be disabled as default. I hope you understands, please find the image. Reply soon. Thanks! Mohit Link to comment Share on other sites More sharing options...
tuk66 Posted December 15, 2014 Share Posted December 15, 2014 I would just click on the switch and disable the product. Link to comment Share on other sites More sharing options...
Eolia Posted December 15, 2014 Share Posted December 15, 2014 Yes, in the class Product.php set the property $active to false by default (on line 165) /** @var boolean Product statuts */ public $active = false; and edit the template file admin/theme/default/template/controllers/products/information.tpl. Replace the bloc {* status informations *} (line 192) by this: {* status informations *} <div class="form-group"> <label class="control-label col-lg-3"> {include file="controllers/products/multishop/checkbox.tpl" field="active" type="radio" onclick=""} {l s='Enabled'} </label> <div class="col-lg-9"> <span class="switch prestashop-switch fixed-width-lg"> <input onclick="toggleDraftWarning(false);showOptions(true);showRedirectProductOptions(false);" type="radio" name="active" id="active_on" value="1" {if $product->active}checked="checked" {/if} /> <label for="active_on" class="radioCheck"> {l s='Yes'} </label> <input onclick="toggleDraftWarning(true);showOptions(false);showRedirectProductOptions(true);" type="radio" name="active" id="active_off" value="0" {if !$product->active}checked="checked"{/if} /> <label for="active_off" class="radioCheck"> {l s='No'} </label> <a class="slide-button btn"></a> </span> </div> </div> 1 Link to comment Share on other sites More sharing options...
subwayside Posted December 16, 2014 Author Share Posted December 16, 2014 Thanks Eolia Link to comment Share on other sites More sharing options...
Zen_j1 Posted June 17, 2015 Share Posted June 17, 2015 How can i achieve this for prestashop 1.5 I got code for Php but bit confussed with code for tpl file can someone help. Link to comment Share on other sites More sharing options...
Eolia Posted June 17, 2015 Share Posted June 17, 2015 How can i achieve this for prestashop 1.5 I got code for Php but bit confussed with code for tpl file can someone help. What do you want ? Link to comment Share on other sites More sharing options...
Zen_j1 Posted June 17, 2015 Share Posted June 17, 2015 (edited) What do you want ? I would like know what change in code of tpl file admin/theme/default/template/controllers/products/information.tpl. of prestashop 1.5 should be done, code for prestashop 1.6 look different form prestashop 1.5 I need new product added to set be disabled (red cross) automatically once added and should enabled (green tick) manually once ready to go live on site. as if now prestashop automatically enable new product added. Edited June 17, 2015 by Zen_j1 (see edit history) Link to comment Share on other sites More sharing options...
Eolia Posted June 17, 2015 Share Posted June 17, 2015 in 1.5 only change the product class: /** @var boolean Product statuts */ public $active = false; Link to comment Share on other sites More sharing options...
Zen_j1 Posted June 17, 2015 Share Posted June 17, 2015 in 1.5 only change the product class: /** @var boolean Product statuts */ public $active = false; I Just tired this it does not work. I still get green tick back office and product show up in front office. Link to comment Share on other sites More sharing options...
Eolia Posted June 17, 2015 Share Posted June 17, 2015 not for me, when i create a new product, it's disabled. (PS 1.5.6.2) Link to comment Share on other sites More sharing options...
Zen_j1 Posted June 17, 2015 Share Posted June 17, 2015 i am using prestashop 1.5.4.1 Link to comment Share on other sites More sharing options...
Zen_j1 Posted June 17, 2015 Share Posted June 17, 2015 Just want make sure path myprestshopsite/classes/product.php my presta v 1.5.4.1 Link to comment Share on other sites More sharing options...
Eolia Posted June 17, 2015 Share Posted June 17, 2015 yes When you create a product, the active property is set to false. If not, but... i don't know... Link to comment Share on other sites More sharing options...
Recommended Posts