add a field in edit product page of prestashop admin

后端 未结 5 1548
旧时难觅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:50

    this one works for me on prestashop 1.5.4

    add a file Product.php to \override\classes containing:

         ObjectModel::TYPE_INT, 'validate' => 'isUnsignedInt');
        class Product extends ProductCore 
        { 
           public $mystock; 
        } 
    

    ...supposing you need a field to enter a number.

    then 3) of altafhussain's answer

    don't forget to add your field to the DB, for number field:
    ALTER TABLE ps_product ADD mystock INT NOT NULL;

提交回复
热议问题