marjanbajc Posted August 26, 2011 Share Posted August 26, 2011 Hi, I want to be able to change the date for which the product is new in BO. Or where can I make the change so instead of date_add it uses date_upd? I hope you understand. Link to comment Share on other sites More sharing options...
ilovekutchi.com Posted March 16, 2012 Share Posted March 16, 2012 Add the following lines to AdminProducts.php in the place you desire. For example I added it to line 1560, bellow the "Weight:" parameter. <tr> <td class="col-left">'.$this->l('date added:').'</td> <td style="padding-bottom:5px;"> <input onchange="updateCurrentText();" type="text" id="date_add" name="date_add" value="'.($this->getFieldValue($obj, 'date_add') ? htmlentities($this->getFieldValue($obj, 'date_add'), ENT_COMPAT, 'UTF-8') : date('Y-m-d H:i:s')).'" /> </td> I'm not a coder, I just copied this from somewhere else and modified it. It works fine for me. Link to comment Share on other sites More sharing options...
tiga Posted April 10, 2012 Share Posted April 10, 2012 Hi, I am searching for the same option. You are talking about changing the file: .../admin_presta/tabs/AdminProducts.php right? Because when I try to edit that file in line 1560 I can't see any weight parameter being defined. I am working with PrestaShop™ 1.4.6.2. Could you please paste some of the code you have before that line, just to make sure I am pasting in the right place. This is my code: line 1559 $(document).ready(function(){ 1560 $(\'#id_mvt_reason\').change(function(){ 1561 updateMvtStatus($(this).val()); Thanks in advance! Link to comment Share on other sites More sharing options...
ilovekutchi.com Posted April 10, 2012 Share Posted April 10, 2012 I'm using version 1.3.2, that's why. You can put that code anywhere it suits better to you. I have it bellow: <tr> <td class="col-left">'.$this->l('Weight:').'</td> <td style="padding-bottom:5px;"> <input size="6" maxlength="6" name="weight" type="text" value="'.htmlentities($this->getFieldValue($obj, 'weight'), ENT_COMPAT, 'UTF-8').'" onKeyUp="javascript:this.value = this.value.replace(/,/g, \'.\');" /> '.Configuration::get('PS_WEIGHT_UNIT').' </td> </tr> De nada 1 Link to comment Share on other sites More sharing options...
tiga Posted April 11, 2012 Share Posted April 11, 2012 Thanks worked great for me! For those using the same version as me, you can paste the code in line 2276. Gracias amigo! Link to comment Share on other sites More sharing options...
BD-FSPS Posted May 2, 2014 Share Posted May 2, 2014 I know it is not nice to "resurrect" ancient topics However I cannot find /admin_presta/tabs/AdminProducts.php as i am using presta 1.5.6.2 Is there any way to add the discussed above function in my version? Link to comment Share on other sites More sharing options...
ilovekutchi.com Posted May 3, 2014 Share Posted May 3, 2014 I know it is not nice to "resurrect" ancient topics However I cannot find /admin_presta/tabs/AdminProducts.php as i am using presta 1.5.6.2 Is there any way to add the discussed above function in my version? What a coincidence, I just added this functionality to my new shop (also 1.5.6.2)! The following code worked for me: <tr> <td class="col-left"><label>{$bullet_common_field} {l s='New from'}</label></td> <td style="padding-bottom:5px;"> <input type="text" id="date_add" name="date_add" value="{$product->date_add|escape:html:'UTF-8'}" /> </td> </tr> Add it to line 146 of {admin folder}\themes\default\template\controllers\products\informations.tlp 1 Link to comment Share on other sites More sharing options...
vekia Posted May 3, 2014 Share Posted May 3, 2014 What a coincidence, I just added this functionality to my new shop (also 1.5.6.2)! The following code worked for me: <tr> <td class="col-left"><label>{$bullet_common_field} {l s='New from'}</label></td> <td style="padding-bottom:5px;"> <input type="text" id="date_add" name="date_add" value="{$product->date_add|escape:html:'UTF-8'}" /> </td> </tr> Add it to line 146 of {admin folder}\themes\default\template\controllers\products\informations.tlp it's enough to create only this field? no core changes? Link to comment Share on other sites More sharing options...
ilovekutchi.com Posted May 3, 2014 Share Posted May 3, 2014 it's enough to create only this field? no core changes? For me it's working. I've tested it only a couple of times, though. Add the code and upload file (ftp), go to a product page in backoffice, change the date and save changes. An "old" product can be set as new that easily. Link to comment Share on other sites More sharing options...
BD-FSPS Posted May 3, 2014 Share Posted May 3, 2014 Impressed! It works perfectly. I will start to love Kutchi Many thanks. [solved for me] 1 Link to comment Share on other sites More sharing options...
Eusebio100 Posted February 3, 2015 Share Posted February 3, 2015 how to do it in ps 1.6.0.11, anyone know? Link to comment Share on other sites More sharing options...
Eusebio100 Posted February 4, 2015 Share Posted February 4, 2015 Adapted this functionality to ps 1.6.0.11. Add it to line 134 of: admin folder\themes\default\template\controllers\products\informations.tlp <div class="form-group"> <label class="control-label col-lg-3"></td> <span class="label-tooltip" data-toggle="tooltip" title="{l s='Change date for "product new from".'}"> {$bullet_common_field} {l s='New from'} </span> </label> <div class="col-lg-3"> <input type="text" id="date_add" name="date_add" value="{$product->date_add|escape:html:'UTF-8'}" /> </div> </div> Thank. 1 Link to comment Share on other sites More sharing options...
David Eschmeyer Posted June 10, 2016 Share Posted June 10, 2016 you can wrap that code with if to hide it when a product is actually being added new {if $product->date_add}<div class="form-group"><label class="control-label col-lg-3"></td><span class="label-tooltip" data-toggle="tooltip"title="{l s='Change date for "product new from".'}">{$bullet_common_field} {l s='New from'}</span></label><div class="col-lg-3"><input type="text" id="date_add" name="date_add" value="{$product->date_add|escape:html:'UTF-8'}" /></div></div>{/if} Link to comment Share on other sites More sharing options...
imms12 Posted June 10, 2016 Share Posted June 10, 2016 hi.. I am having some problems with my prestashop and i need some expert to help me.. for which I can pay.. not much but I will. Anyone inerested please email me on [email protected] or message me on whatsapp at +923343515883 Thanks 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