Hi, I created a new input for the products. Everything works fine, It saves the field on the database, It shows the input on the admin panel, but when I save the product, it shows an error saving, but it saves it.
The prestashop version is 1.6.1.4
I created the field on the database.
I created the product.php on the override/classes
<?php class Product extends ProductCore { //ALTER TABLE `ps_product` ADD label_tip VARCHAR(256) default NULL; //ALTER TABLE `ps_product_shop` ADD label_tip VARCHAR(256) default NULL; public $label_tip; public function __construct($id_product = null, $full = false, $id_lang = null, $id_shop = null, Context $context = null) { self::$definition['fields']['label_tip'] = array('type' => ObjectModel::TYPE_STRING, 'shop' => true, 'validate' => 'isString'); //self::$definition['fields']['label_tip'] = array('type' => self::TYPE_HTML, 'validate' => 'isCleanHtml'); parent::__construct($id_product, $full, $id_lang, $id_shop, $context); } }
I deleted the class_index on the cache.
And I added the field on the informations.tpl
<div class="form-group"> <label class="control-label col-lg-3" for="label_tip"> <span class="label-tooltip" data-toggle="tooltip" title="{l s='Etiqueta img:'}"> {$bullet_common_field} {l s='Etiqueta img:'} </span> </label> <div class="col-lg-5"> <input type="text" id="label_tip" name="label_tip" value="{$product->label_tip|htmlentitiesUTF8}" /> </div> </div>
Anyone can show me how to solve this issue?
Thanks for all.