Custom fields error

  • Posts: 162
  • Thank you received: 0
11 years 3 weeks ago #167871

-- HikaShop version -- : 2.3.1
-- Joomla version -- : 2.5.24
-- PHP version -- : 5.4.29
-- Browser(s) name and version -- : chrome
-- Error-message(debug-mod must be tuned on) -- : Error Saving

Hi,

After adding custom fields and assign them to a product category, I can't save the products no more. All other categories that doesn't have custom fields assigned to them, are working fine. First error that I get is: "A product with the same code already exists" . After I change the product code I get a second error: "Error Saving" and the product will not save either way. The product code is correct since if I remove the custom fields, everything works fine again.

Could you please tell me what is the problem?

Attachments:

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

  • Posts: 12953
  • Thank you received: 1778
11 years 3 weeks ago #167877

Hello,
I just tested it with a product "text" custom field, but it worked fine so can you :
- Active the Joomla debug mode ("Administration->Global configuration->System->Debug System/Language")
- Set the "error reporting" option of the Joomla configuration to "maximum"
- Test it again so that we can see if it display another error message.

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

  • Posts: 162
  • Thank you received: 0
11 years 3 weeks ago #167968

Hi,

After I've enabled debugging mode this is what I get. Please see screenshot.

Attachments:

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

  • Posts: 84301
  • Thank you received: 13697
  • MODERATOR
11 years 3 weeks ago #168002

Hi,

This indicates that the "instructor_name" custom field has been deleted from the hikashop_product table in the database.
Delete the custom field via the menu Display>Custom fields and recreate it and that should then work.

The following user(s) said Thank You: info@vesica.org

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

  • Posts: 162
  • Thank you received: 0
11 years 3 weeks ago #168174

Hi,

thanks Nicolas, that worked!

Now I have another problem.

The fields look OK in the back-end but in the front-end all I get displayed is the input that I've typed in the back-end and not a date picker and a text area where users can input data. Please see screen1.

Please see the other screenshots attached for back-end settings.

thanks!

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

  • Posts: 84301
  • Thank you received: 13697
  • MODERATOR
11 years 3 weeks ago #168178

Hi,

You created custom fields of the table "product". These allow you to enter data for the product in the backend and potentially display it on the product page on the frontend.
If you need to have the fields on the product page on the frontend, then you want instead to create custom fields of the table "item".

The following user(s) said Thank You: info@vesica.org

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

  • Posts: 162
  • Thank you received: 0
11 years 3 weeks ago #168318

Hi Nicolas,

thanks, that worked fine.

I see that custom fields can be assigned to categories. Is it possible to assign custom fields to one product for example and not to an entire category?

thanks!

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

  • Posts: 13201
  • Thank you received: 2322
11 years 2 weeks ago #168329

Hi,

No this is not directly possible. What can be done is to create one category, apply the custom field on that category and then in the product edition page add this newly created category to the product.

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

  • Posts: 162
  • Thank you received: 0
11 years 2 weeks ago #168498

Hi,

I see. I've asked since I need the fields set as required, and to do that I need to set a default value, but the value it will not be the same for all products in the category. Is there any possibility to display the required fields without a default value?

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

  • Posts: 26274
  • Thank you received: 4045
  • MODERATOR
11 years 2 weeks ago #168520

Hi,

You can do that but it require a specific "process".
First, you have to remove the "default value" and also remove the option "required".
It will allow you to save the custom field and remove the default value in the same time (because if the field is required, you can't "no set" a default value. We will fix it in a future release, it's in the TODO list).
Then you can re-set the "required" on the custom field (and let the "default" empty).

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.
The following user(s) said Thank You: info@vesica.org

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

Time to create page: 0.066 seconds
Powered by Kunena Forum