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

#   Default values in custom product fields.

##

- **[brainforge](/forum/user/423-brainforge "View brainforge's Profile")**
- [![brainforge's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar423.jpg)](/forum/user/423-brainforge "View brainforge's Profile") Topic Author
- [ Offline](/forum/user/423-brainforge)

Less More

- Posts: 298
- Thank you received: 5
-
-
-
- [](https://brainforge.co.uk)
-

15 years 6 months ago [\#14738](#14738) by [brainforge](/forum/user/423-brainforge "View brainforge's Profile")  *[Default values in custom product fields.](/forum/2-general-talk-about-hikashop/14738-default-values-in-custom-product-fields#14738 "I have a select list custom product field with values of 1 and 2 - with 1 as the default.  Set the field to required.  (a) When the custom product field is created could the existing products be populated with the default value please.  (b) Also if the field is disabled in the Back-end Form it defaults to NULL when a product is created. Again could it be pre-populated with the default value please.")* was created by *[brainforge](/forum/user/423-brainforge "View brainforge's Profile")*

I have a select list custom product field with values of 1 and 2 - with 1 as the default.

Set the field to required.

(a) When the custom product field is created could the existing products be populated with the default value please.

(b) Also if the field is disabled in the Back-end Form it defaults to NULL when a product is created.
Again could it be pre-populated with the default value please.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzItZ2VuZXJhbC10YWxrLWFib3V0LWhpa2FzaG9wLzE0NzM4LWRlZmF1bHQtdmFsdWVzLWluLWN1c3RvbS1wcm9kdWN0LWZpZWxkcz90bXBsPW1hcmtkb3du) or [Create an account](/register) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86322
- Thank you received: 14281
-
-

15 years 6 months ago [\#14761](#14761) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Re: Default values in custom product fields.](/forum/2-general-talk-about-hikashop/14738-default-values-in-custom-product-fields#14761 "I have a select list custom product field with values of 1 and 2 - with 1 as the default.  Set the field to required.  (a) When the custom product field is created could the existing products be populated with the default value please.  (b) Also if the field is disabled in the Back-end Form it defaults to NULL when a product is created. Again could it be pre-populated with the default value please.")*

a. Not really. When you save a custom field, we don't know if the elements on which the custom field applies have nothing because it's a new field and the element were there before, or because the user who created these elements decided to enter an empty value (not writing in the text area, or select an option of a dropdown with the value being empty). If we would set the default value at that point, users could loose some of their previous data. You can easily run a MySQL query via phpmyadmin on your end to set the fields automatically:
UPDATE jos_hikashop_product SET custom_field=1;

b. We will add that to next release.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzItZ2VuZXJhbC10YWxrLWFib3V0LWhpa2FzaG9wLzE0NzM4LWRlZmF1bHQtdmFsdWVzLWluLWN1c3RvbS1wcm9kdWN0LWZpZWxkcz90bXBsPW1hcmtkb3du) or [Create an account](/register) 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.051 seconds

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