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
The best comprehensive solution in four steps is:
1) add a file Product.php to \override\classes containing:
ObjectModel::TYPE_INT, 'validate' => 'isUnsignedInt');
class Product extends ProductCore
{
public $mystock;
}
2) open adminFolder/themes/default/template/controllers/products/informations.tpl and place your field with the correct name and id in the appropriate place.
3) delete file cache/class_index.php
4) add your field to the DB, for number field:
ALTER TABLE ps_product ADD mystock INT NOT NULL;
[Thanks to Bell418 for 1) and 4) and to Altaf Hussain for 2)]