add a field in edit product page of prestashop admin

后端 未结 5 1547
旧时难觅i
旧时难觅i 2020-12-30 18:03

I have add a field \"mystock\" in product table of prestashop database. Now i want to display/edit this filed in edit product page. It also be update when product will updat

5条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-30 18:49

    This process require some work around in steps. Below i have listed them.

    1) Open classes/Product.php. Place public $mystock; in the class properties list, which you can see after the class is started.

    2) Down the file, find public static $definition = array( , it will be a long array. Find the 'fields' => array( in it, and there you will see all the database fields placed with validation, data types etc. Place your mystock there in that array as another item and place the correct validations and data types like placed for other fields.

    3) Now open adminFolder/themes/default/template/controllers/products/informations.tpl and place your field with the correct name and id in the appropriate place. Please note that the field name / id both should be same like the db field name and the one we added in the Products.php class.

    Thats it, Hope you understand the process and will make it work.

    Thank you

提交回复
热议问题