Jump to content

Add costum field to product PrestaShop 1.5.6.2?


Recommended Posts

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

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 by Fastplayz (see edit history)
Link to comment
Share on other sites

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

 

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 by Fastplayz (see edit history)
Link to comment
Share on other sites

×
×
  • Create New...