Fastplayz Posted February 17, 2014 Share Posted February 17, 2014 I have googled to latest tutorials how add costum field to latest prestashop software system, sience the latest version files location and structure has changed its hard to follow those old tutorials like i have found: http://blog.arvixe.com/adding-new-tabs-and-fields-to-prestashop-products-back-office/ http://mypresta.eu/en/art/developer/new-field-product-backoffice.html http://quaelibet.wordpress.com/2013/09/11/prestashop-add-custom-field-to-product-class-or-any-other-class/ http://www.webbax.ch/2011/06/24/comment-ajouter-un-nouveau-champ-sur-la-fiche-produit-et-dans-le-back-office-prestashop/ http://strife.pl/2011/12/how-to-add-new-custom-field-in-prestashop/ http://blog.belvg.com/how-to-create-a-custom-product-tab-in-prestashop.html I have trued everythink even copy field what is in prestashow default called "Reference" but i fail every time and it wont working. I'm using latest prestashop software version 1.5.6.2, so i want add fields to that version not old outdated version of tutorials. So please i asking help thouse who have more skills and experience more than i have! Huge thanks! Link to comment Share on other sites More sharing options...
vekia Posted February 17, 2014 Share Posted February 17, 2014 my guide (mypresta) is based on prestashop 1.5.4.1, it works also in 1.5.6.2 i don't think that you even tried it. Link to comment Share on other sites More sharing options...
Fastplayz Posted February 17, 2014 Author Share Posted February 17, 2014 my guide (mypresta) is based on prestashop 1.5.4.1, it works also in 1.5.6.2 i don't think that you even tried it. Okay, do you mean that? http://mypresta.eu/en/art/developer/new-field-product-backoffice.html Link to comment Share on other sites More sharing options...
vekia Posted February 17, 2014 Share Posted February 17, 2014 yes, i mean this as i said it's based on 1.5.4.1 and it will work also in latest release of PS (tested and i can confirm that it works) Link to comment Share on other sites More sharing options...
Fastplayz Posted February 17, 2014 Author Share Posted February 17, 2014 Okay very cool, have you also code to display that in product page? Link to comment Share on other sites More sharing options...
vekia Posted February 17, 2014 Share Posted February 17, 2014 it's for product page too. after modification you can use created variable in prouct.tpl file. Link to comment Share on other sites More sharing options...
Fastplayz Posted February 17, 2014 Author Share Posted February 17, 2014 (edited) Thanks for your answer, i'm stuck at step 2 "We need also to extend object definition: add: 'internal_name' => array('type' => self::TYPE_STRING, 'validate' => 'isCleanHtml') to object definition code." i add code /** @var string Tax rate */ public $internal_name; What "We need also to extend object definition: add: 'internal_name' => array('type' => self::TYPE_STRING, 'validate' => 'isCleanHtml') to object definition code." mean? Edited February 17, 2014 by Fastplayz (see edit history) Link to comment Share on other sites More sharing options...
Fastplayz Posted February 17, 2014 Author Share Posted February 17, 2014 Okay i understand now that 'internal_name' => array('type' => self::TYPE_STRING, 'validate' => 'isCleanHtml') to object definition code." but it give blank page in admin product page? Link to comment Share on other sites More sharing options...
Fastplayz Posted February 17, 2014 Author Share Posted February 17, 2014 Its not working on v1.5.6.2! Link to comment Share on other sites More sharing options...
vekia Posted February 17, 2014 Share Posted February 17, 2014 blank page = you probably missed something or wrote something wrong. believe me, it's work in 1.5.6.2 and im using this solution on my own. Can you show me your modified file, please? Link to comment Share on other sites More sharing options...
Fastplayz Posted February 18, 2014 Author Share Posted February 18, 2014 Here those are http://fastplayz.com/files.zip Link to comment Share on other sites More sharing options...
vekia Posted February 18, 2014 Share Posted February 18, 2014 this is your code: 'id_supplier' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId'), 'reference' => array('type' => self::TYPE_STRING, 'validate' => 'isReference', 'size' => 32), 'internal_name' => array('type' => self::TYPE_STRING, 'validate' => 'isCleanHtml') 'supplier_reference' => array('type' => self::TYPE_STRING, 'validate' => 'isReference', 'size' => 32), 'location' => array('type' => self::TYPE_STRING, 'validate' => 'isReference', 'size' => 64), 'width' => array('type' => self::TYPE_FLOAT, 'validate' => 'isUnsignedFloat'), do you se what is wrong? you missed comma after 'internal_name' => array('type' => self::TYPE_STRING, 'validate' => 'isCleanHtml') Link to comment Share on other sites More sharing options...
Fastplayz Posted February 18, 2014 Author Share Posted February 18, 2014 (edited) Okay fixed that but any idea when i create or edit any prduct it give like that error An error occurred while creating an object. product Edited February 18, 2014 by Fastplayz (see edit history) Link to comment Share on other sites More sharing options...
Fastplayz Posted February 21, 2014 Author Share Posted February 21, 2014 (edited) this is your code: 'id_supplier' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId'), 'reference' => array('type' => self::TYPE_STRING, 'validate' => 'isReference', 'size' => 32), 'internal_name' => array('type' => self::TYPE_STRING, 'validate' => 'isCleanHtml') 'supplier_reference' => array('type' => self::TYPE_STRING, 'validate' => 'isReference', 'size' => 32), 'location' => array('type' => self::TYPE_STRING, 'validate' => 'isReference', 'size' => 64), 'width' => array('type' => self::TYPE_FLOAT, 'validate' => 'isUnsignedFloat'), do you se what is wrong? you missed comma after 'internal_name' => array('type' => self::TYPE_STRING, 'validate' => 'isCleanHtml') Please can you help, realy need help with that please! I'm getting now error An error occurred while creating an object. product Edited February 21, 2014 by Fastplayz (see edit history) Link to comment Share on other sites More sharing options...
Fastplayz Posted February 21, 2014 Author Share Posted February 21, 2014 I'm sorry my stupid mistake in myphpadmin, i created table internal name but it shoult be internal_name Works great, how i can change that field to like Short description box has in backend? Link to comment Share on other sites More sharing options...
vekia Posted February 21, 2014 Share Posted February 21, 2014 you mean that you want rich text editor? Link to comment Share on other sites More sharing options...
Recommended Posts