Custom fields in category listing

  • Posts: 5
  • Thank you received: 0
5 years 5 months ago #300169

-- HikaShop version -- : 4.0.0
-- Joomla version -- : 3.8.13
-- PHP version -- : 7.0.32

Hello,
I've created some custom fields for categories, but I'm not able to display them in custom layout for subcategories.
One of these fields is an ajax image file.
Any advice about this subject?
Thanks in advance
Giulio

Last edit: 5 years 5 months ago by giuliocrealia.

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

  • Posts: 81515
  • Thank you received: 13069
  • MODERATOR
5 years 5 months ago #300171

Hi,

Could you provide more information please ?
On which page exactly do you want to add them ?
And could you provide a link to that page, a screenshot of the settings of the custom field, and a screenshot of the settings of the category ?

The following user(s) said Thank You: giuliocrealia

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

  • Posts: 5
  • Thank you received: 0
5 years 5 months ago #300209

Hi Nicolas
I've solved my problem adding the following code on top of listing_img_description layout file in category override folder

$fieldsClass = hikashop_get('class.field');
  $fields = $fieldsClass->getFields('frontcomp', $row, 'category');
Looping the $field array I get all the custom fields of the category

Regards
Giulio

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

  • Posts: 81515
  • Thank you received: 13069
  • MODERATOR
5 years 5 months ago #300210

Hi,

Ah yes, I see what you meant now. Indeed you would have to manually load the fields like that as they aren't preloaded for each category of the categories listing since there is no display option for that place for custom category fields.

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

Time to create page: 0.057 seconds
Powered by Kunena Forum