[Skip to main content](#vessel-content)

#   Custom field to accept only unique value

##

- **[nojunkgoodfood](/forum/user/35905-nojunkgoodfood "View nojunkgoodfood's Profile")**
- [![nojunkgoodfood's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/35905-nojunkgoodfood "View nojunkgoodfood's Profile") Topic Author
- [ Offline](/forum/user/35905-nojunkgoodfood)

Less More

- Posts: 25
- Thank you received: 1
-
-

10 years 10 months ago -  10 years 10 months ago [\#225264](#225264) by [nojunkgoodfood](/forum/user/35905-nojunkgoodfood "View nojunkgoodfood's Profile")  *[Custom field to accept only unique value](/forum/26-product-category-display/881308-custom-field-to-accept-only-unique-value#225264 "-- 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 &quot;item&quot; asking for clients to enter a &quot;text&quot; that must be unique. So validation must check the database to see if the &quot;text&quot; 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 &quot;text&quot; in order to use the &quot;Regular expression check&quot; .  Any idea how to achieve that?  Thank you")* was created by *[nojunkgoodfood](/forum/user/35905-nojunkgoodfood "View nojunkgoodfood's Profile")*

-- 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

Last edit: 10 years 10 months ago by [nojunkgoodfood](/forum/user/35905-nojunkgoodfood "View nojunkgoodfood's Profile"). Reason: Better title

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI2LXByb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS84ODEzMDgtY3VzdG9tLWZpZWxkLXRvLWFjY2VwdC1vbmx5LXVuaXF1ZS12YWx1ZT90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Xavier](/forum/user/4105-xavier "View Xavier's Profile")**
- [![Xavier's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar4105.png)](/forum/user/4105-xavier "View Xavier's Profile")
- [ Offline](/forum/user/4105-xavier)

Less More

- Posts: 13201
- Thank you received: 2322
-
-
-
- [](http://www.kidiweb.fr)
-

10 years 10 months ago [\#225294](#225294) by [Xavier](/forum/user/4105-xavier "View Xavier's Profile")  Replied by *[Xavier](/forum/user/4105-xavier "View Xavier's Profile")* on topic *[Custom field to accept only unique value](/forum/26-product-category-display/881308-custom-field-to-accept-only-unique-value#225294 "-- 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 &quot;item&quot; asking for clients to enter a &quot;text&quot; that must be unique. So validation must check the database to see if the &quot;text&quot; 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 &quot;text&quot; in order to use the &quot;Regular expression check&quot; .  Any idea how to achieve that?  Thank you")*

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](http://www.hikashop.com/support/documentation/62-hikashop-developer-documentation.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](/forum/user/35905-nojunkgoodfood "View nojunkgoodfood's Profile")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI2LXByb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS84ODEzMDgtY3VzdG9tLWZpZWxkLXRvLWFjY2VwdC1vbmx5LXVuaXF1ZS12YWx1ZT90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nojunkgoodfood](/forum/user/35905-nojunkgoodfood "View nojunkgoodfood's Profile")**
- [![nojunkgoodfood's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/35905-nojunkgoodfood "View nojunkgoodfood's Profile") Topic Author
- [ Offline](/forum/user/35905-nojunkgoodfood)

Less More

- Posts: 25
- Thank you received: 1
-
-

10 years 10 months ago [\#225351](#225351) by [nojunkgoodfood](/forum/user/35905-nojunkgoodfood "View nojunkgoodfood's Profile")  Replied by *[nojunkgoodfood](/forum/user/35905-nojunkgoodfood "View nojunkgoodfood's Profile")* on topic *[Custom field to accept only unique value](/forum/26-product-category-display/881308-custom-field-to-accept-only-unique-value#225351 "-- 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 &quot;item&quot; asking for clients to enter a &quot;text&quot; that must be unique. So validation must check the database to see if the &quot;text&quot; 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 &quot;text&quot; in order to use the &quot;Regular expression check&quot; .  Any idea how to achieve that?  Thank you")*

Thank you for your advice,
and
Happy New Year!

The following user(s) said Thank You: [Xavier](/forum/user/4105-xavier "View Xavier's Profile")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI2LXByb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS84ODEzMDgtY3VzdG9tLWZpZWxkLXRvLWFjY2VwdC1vbmx5LXVuaXF1ZS12YWx1ZT90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

Board Categories HikaShop Install &amp; Update Product &amp; Category Display Content Creation Sales and Orders Orders management Reports &amp; Statistics Customers Checkout Payment Methods Shipping Methods Import &amp; Export (CSV, XLS…) Specific Features Affilation Taxes Wishlist Vote Carousel &amp; Slider Mass Actions Filters &amp; Search Discount &amp; Coupon Feature Request Integrations Showcase General Talk about HikaShop Development HikaShop 3.0 Beta Translation Commercial Jobs HikaShop Components HikaMarket Market: Feature requests Market: How to? Market: Bug Report HikaSerial General talk about HikaSerial Serial: Bug Report Serial: How to? Support en Français de HikaSerial (French Support) HikaSubscription HikaAuction Auction: Feature requests Auction: How to? Auction: Bug report Hikashop around the world Support en Français (French Support) Russian FAQ. Курс выживания с Hikashop. Частые вопросы и о Расширения Hikashop Наши сайты на Hikashop 日本語版サポート(Japanese Support) Thai German Archives Bug Report How to?

[](/forum/topics/feed/mode-topics?format=feed&type=rss)

Time to create page: 0.052 seconds

[Powered by](/forum/credits) [Kunena Forum](https://www.kunena.org)
