antost Posted March 6, 2014 Share Posted March 6, 2014 Hello. I just added new custom field to product. How set unique validation for this field ? In my database custom field is mark as UNIQUE and when i try add two rekords with the same value in unique field - i see database error 'Duplicate entry' How add unique conditions on custom field ? Link to comment Share on other sites More sharing options...
vekia Posted March 7, 2014 Share Posted March 7, 2014 as far as i know prestashop validation object hasn't got feature to add unique fields to database. unique fields are usually fields with auto_incerement value. it mean that these fields don't need any "unique" verifiication query. in this case, before enter you have to check db for duplicated fields on your own Link to comment Share on other sites More sharing options...
antost Posted March 7, 2014 Author Share Posted March 7, 2014 I thought so. I need have custom unique field on product page my prestashop. This field should be manually control -> not by autoincrement of database feature. Thx for reply. Link to comment Share on other sites More sharing options...
antost Posted March 7, 2014 Author Share Posted March 7, 2014 I have another question, something completely different. In this case: admin/index.php?controller=AdminProducts&token=0643fd472easd9c5c5b0&id_product=1&action=Prices&updateproduct&ajax=1&rand=139413078 Which function from the AdminProductsControllerCore (\controllers\admin\AdminProductsController.php) is called ? I've found that are called display() from inherited class (AdminController) but i don't know where comes assignment to $this->content in AdminController->display(); Sory for my english language . Link to comment Share on other sites More sharing options...
vekia Posted March 7, 2014 Share Posted March 7, 2014 when you see this url? after what action? product update? Link to comment Share on other sites More sharing options...
antost Posted March 8, 2014 Author Share Posted March 8, 2014 when you see this url? after what action? product update? Yes, after product update. It's request (one of many) from Firebug network tab. Link to comment Share on other sites More sharing options...
vekia Posted March 8, 2014 Share Posted March 8, 2014 whole product update is based on ObjectModel class 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