plaszma Posted July 15, 2010 Share Posted July 15, 2010 Hello,I want to add a new field into catalog->info tab of the admin part of prestashop.For doing that, I must understand how it's made update for one product from php behind.I introduced those fields that interested me, but I don't know where (in which file) is made the update of product (in my case).I add those properties (the new fields) in constructor of Product class.If someone understand better the structure of Prestashop (at least admin part), please tell me how it's made updating of product but at php level.Many thanks, Link to comment Share on other sites More sharing options...
oren Posted July 26, 2010 Share Posted July 26, 2010 1. add the field to the table 'ps_product_lang'2. add the field to the form on the file 'tabs/adminproducts.php', and don't forget to name it properly e.g. technology_13. change the file 'classes/product.php' like this (my new field is called technology):4.at around line 60 add: public $techonology;5. at around line 194 add to the $fieldsValidateLang array: 'techonology' => 'isCleanHtml'6. at around line 274 add: at around line 274 add: $fields[$language['id_lang']]['techonology'] = (isset($this->techonology[$language['id_lang']])) ? Tools::htmlentitiesDecodeUTF8(pSQL($this->techonology[$language['id_lang']], true)) : ''; Link to comment Share on other sites More sharing options...
plaszma Posted July 26, 2010 Author Share Posted July 26, 2010 [sOLVED] Hello,I have found a solution for that problem and for every issue that I've been meet on developing process.The new admin interface working properly!Thanks a lot,anyhow Link to comment Share on other sites More sharing options...
rocky Posted July 26, 2010 Share Posted July 26, 2010 If your issue is resolved, please edit your first post and add [sOLVED] to the front of the title. Link to comment Share on other sites More sharing options...
ziostanko Posted July 28, 2010 Share Posted July 28, 2010 1. add the field to the table 'ps_product_lang'2. add the field to the form on the file 'tabs/adminproducts.php', and don't forget to name it properly e.g. technology_13. change the file 'classes/product.php' like this (my new field is called technology):4.at around line 60 add: public $techonology;5. at around line 194 add to the $fieldsValidateLang array: 'techonology' => 'isCleanHtml'6. at around line 274 add: at around line 274 add: $fields[$language['id_lang']]['techonology'] = (isset($this->techonology[$language['id_lang']])) ? Tools::htmlentitiesDecodeUTF8(pSQL($this->techonology[$language['id_lang']], true)) : ''; with version 1.3.1 you have to change the point number 5 into:'techonology' => 'isString'and work perfectly Thx oren Link to comment Share on other sites More sharing options...
angryopium Posted December 2, 2010 Share Posted December 2, 2010 hi, I added a field to my products but now browing them the table is larger than the page. How to resize coloumns for item fields? [sOLVED: adding the field in the AdminProduct page you can specify the width of the field to be displayed][EDIT] Another issue is that on duplicating a product, that field is left empty.Thanks Link to comment Share on other sites More sharing options...
m4ss4cr4t10n Posted December 2, 2010 Share Posted December 2, 2010 is t here a way to do this with a module? Link to comment Share on other sites More sharing options...
angryopium Posted December 2, 2010 Share Posted December 2, 2010 is t here a way to do this with a module? Actually you don't need a module to add a field, it is really simple to do it just following the few steps listed above. It works fine except for duplication. Link to comment Share on other sites More sharing options...
m4ss4cr4t10n Posted December 2, 2010 Share Posted December 2, 2010 Ok,But I need to add some fields to implement shipping custs, that will use Wide x height x depth of the product.So I'm developing a module, is it inconsistent I sell the module and ask to the user do all of this changes, don't you think?With the module, I can:1. add the field to the table ‘ps_product_lang’But I don't know how can I do that without overwrite those files.2. add the field to the form on the file ‘tabs/adminproducts.php’, and don’t forget to name it properly e.g. technology_13. change the file ‘classes/product.php’ like this (my new field is called technology):4.at around line 60 add: public $techonology;5. at around line 194 add to the $fieldsValidateLang array: ‘techonology’ => ‘isCleanHtml’6. at around line 274 add: at around line 274 add: $fields[$language[‘id_lang’]][‘techonology’] = (isset($this->techonology[$language[‘id_lang’]])) ? Tools::htmlentitiesDecodeUTF8(pSQL($this->techonology[$language[‘id_lang’]], true)) : ‘’; 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