Default values in custom product fields.

  • Posts: 292
  • Thank you received: 5
  • Hikashop Business
13 years 7 months ago #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.

Please Log in or Create an account to join the conversation.

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
13 years 7 months ago #14761

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 or Create an account to join the conversation.

Time to create page: 0.057 seconds
Powered by Kunena Forum