2017-09-01 18 views
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。

我错过了什么?

+0

https://stackoverflow.com/questions/44013569/prestashop-not-saving-field/44026273 – TheDrot

回答

0

定义其知名度:

public $tel; 
public $naam; 
$public $voornaam; 

CustomerThread类,定义之前。

相关问题