1
我添加了3個字段到\ themes \ classic \ modules \ contactform \ views \ templates \ widget \ contactform.tpl中,並且它們顯示出完美。Prestashop 1.7.2:添加3個字段聯繫我們頁面
我將這3個字段添加到數據庫表customer_thread中。
除3個新字段外,聯繫人請求保存到此表中。
我也改變了CustomerThread.php類
public static $definition = array(
'table' => 'customer_thread',
'primary' => 'id_customer_thread',
'fields' => array(
'id_lang' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId', 'required' => true),
'id_contact' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId', 'required' => true),
'id_shop' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId'),
'id_customer' =>array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId'),
'id_order' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId'),
'id_product' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId'),
'email' => array('type' => self::TYPE_STRING, 'validate' => 'isEmail', 'size' => 254),
'tel' => array('type' => self::TYPE_STRING, 'validate' => 'isString', 'size' => 254),
'naam' => array('type' => self::TYPE_STRING, 'validate' => 'isString', 'size' => 254),
'voornaam' => array('type' => self::TYPE_STRING, 'validate' => 'isString', 'size' => 254),
'token' => array('type' => self::TYPE_STRING, 'validate' => 'isGenericName', 'required' => true),
'status' => array('type' => self::TYPE_STRING),
'date_add' => array('type' => self::TYPE_DATE, 'validate' => 'isDate'),
'date_upd' => array('type' => self::TYPE_DATE, 'validate' => 'isDate'),
),
);
的3個新領域是電話,NAAM和voornaam。
我錯過了什麼?
https://stackoverflow.com/questions/44013569/prestashop-not-saving-field/44026273 – TheDrot