- Posts: 25
- Thank you received: 1
Custom field to accept only unique value
- nojunkgoodfood
-
Topic Author
- Offline
Less
More
10 years 9 months ago - 10 years 9 months ago #225264
by nojunkgoodfood
Custom field to accept only unique value was created by nojunkgoodfood
-- HikaShop version -- : 2.6.0
-- Joomla version -- : 3.4.8
-- PHP version -- : 5.5.26
Hi
I want to create a custom field in table "item" asking for clients to enter a "text" that must be unique.
So validation must check the database to see if the "text" value is unique to accept it or if is already there by another user to create a note pop up.
I want to use table "text" in order to use the "Regular expression check" .
Any idea how to achieve that?
Thank you
-- Joomla version -- : 3.4.8
-- PHP version -- : 5.5.26
Hi
I want to create a custom field in table "item" asking for clients to enter a "text" that must be unique.
So validation must check the database to see if the "text" value is unique to accept it or if is already there by another user to create a note pop up.
I want to use table "text" in order to use the "Regular expression check" .
Any idea how to achieve that?
Thank you
Last edit: 10 years 9 months ago by nojunkgoodfood. Reason: Better title
Please Log in or Create an account to join the conversation.
10 years 9 months ago #225294
by Xavier
Replied by Xavier on topic Custom field to accept only unique value
Hi,
There is no options by default in HikaShop for that, but this can be done by creating a new plugin, so PHP knowledges required.
The plugin can be based on the function "onBeforeCartUpdate()", in this function do the MySQL request to check that the value of the item field is not already in the database, if already in so set the "$do" to false, else let it to true.
Here is the developer documentation:
www.hikashop.com/support/documentation/6...umentation.html#cart
If you are not a developer, you can still post your request in the commercial jobs section of this forum.
There is no options by default in HikaShop for that, but this can be done by creating a new plugin, so PHP knowledges required.
The plugin can be based on the function "onBeforeCartUpdate()", in this function do the MySQL request to check that the value of the item field is not already in the database, if already in so set the "$do" to false, else let it to true.
Here is the developer documentation:
www.hikashop.com/support/documentation/6...umentation.html#cart
If you are not a developer, you can still post your request in the commercial jobs section of this forum.
The following user(s) said Thank You: nojunkgoodfood
Please Log in or Create an account to join the conversation.
- nojunkgoodfood
-
Topic Author
- Offline
Less
More
- Posts: 25
- Thank you received: 1
10 years 9 months ago #225351
by nojunkgoodfood
Replied by nojunkgoodfood on topic Custom field to accept only unique value
Thank you for your advice,
and
Happy New Year!
and
Happy New Year!
The following user(s) said Thank You: Xavier
Please Log in or Create an account to join the conversation.
Time to create page: 0.185 seconds