Jump to content

Custom field in product add page - unique validation


antost

Recommended Posts

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

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

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...