yourzed Posted April 29, 2016 Share Posted April 29, 2016 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 <?phpclass 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. Link to comment Share on other sites More sharing options...
tuk66 Posted May 2, 2016 Share Posted May 2, 2016 What error message? Link to comment Share on other sites More sharing options...
yourzed Posted May 2, 2016 Author Share Posted May 2, 2016 Hi, It simply says the tipical error, error while updating product. It's a little bit anoying because it saves the changes, but only shows that error. Maybe I need to do a override to the function that saves the product on the admin side? Thanks! Link to comment Share on other sites More sharing options...
vekia Posted May 2, 2016 Share Posted May 2, 2016 what error exactly? Link to comment Share on other sites More sharing options...
yourzed Posted May 2, 2016 Author Share Posted May 2, 2016 It says: An error occurred while updating customization fields. Of course it's a typical product, it doesn't have anything on the customization tab. Here a screenshot. http://postimg.org/image/8i5sj67hd/ Link to comment Share on other sites More sharing options...
vekia Posted May 3, 2016 Share Posted May 3, 2016 okay i did the same as you and i had the same message i changed variable name from lablel_tip to lab_tip its because prestashop treats label_XXXX as a variable that represents fields related to customization enjoy ! :-) Link to comment Share on other sites More sharing options...
yourzed Posted May 3, 2016 Author Share Posted May 3, 2016 Oh man! I didn't think in that. Thanks a lot for your time Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now