How to create several blocks of custom fields

  • Posts: 35
  • Thank you received: 3
  • Hikashop Business
4 days 21 hours ago #366666

-- HikaShop version -- : 5.1.5
-- Joomla version -- : 5.2.6
-- PHP version -- : 8.4.5

I have some questions about custom fields for the product page.

1. is there a way to create multiple blocks or sections with custom fields? Let's say I want to create three sections. Each section should contain four to five text fields (read only). These sections should be displayed as ‘separate’ sections so that the customer can read them in a structured way. I'm talking about sections like ‘Technical Data’, ‘Ingredients’ and so on.

The big problem is that all custom product fields are listed as a long list one after the other - regardless of what kind of content I want to display. How can I create individual sections?

2. is there a way to use the Joomla core custom fields to display some information? That would make it massively easier. I'm only talking about text information here, i.e. nothing would need to be calculated with these types of custom fields.

3. Or - would it be possible to create a "characteristics" table - where I could note some technical information? I do not want to create variants but have the customer to inform about several product data (in a structured way).

4. How to display specific custom fields at a specific place? In my case, I created a field "bottle deposit". This field must be displayed right after the price. But in all display types of the product page (standard, table, reversed) all custom fields are in one html structure, like ul or table. I can not exclude one specific custom field value to display it on a specific location inside the product page. Or did I oversee something to achive this?

Btw. the "view builder" does not help because even there are no way to move several blocks of custom fields to different locations.

Last edit: 4 days 20 hours ago by Rusty.

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

  • Posts: 83603
  • Thank you received: 13533
  • MODERATOR
4 days 17 hours ago #366667

Hi,

1. One easy way to go about it is to create custom fields of the type "custom text" as group separators.

2. Using Joomla custom fields is not possible. First, it's really hard to integrate. And even if that was possible to integrate them, it wouldn't help you display static information. You're much better with using custom fields of the type "custom text", they are made for this purpose.

3. Characteristics won't help. It will be better to use custom product fields. They are made for this.

4. If you want to display a field somewhere else than the normal area of the product details page, you'll have to add custom code where you want the field to appear.
The code is quite simple:

<?php echo $this->element->XXX;?>
where XXX is to be replaced by the column name of the field. Then, you can display the display setting of the field so that it doesn't also appear in the fields area where all the other fields appear.

Last edit: 4 days 17 hours ago by nicolas.
The following user(s) said Thank You: Rusty

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

  • Posts: 35
  • Thank you received: 3
  • Hikashop Business
4 days 13 hours ago #366680

nicolas wrote: 4. If you want to display a field somewhere else than the normal area of the product details page, you'll have to add custom code where you want the field to appear.
The code is quite simple:
<?php echo $this->element->XXX;?>
where XXX is to be replaced by the column name of the field. Then, you can display the display setting of the field so that it doesn't also appear in the fields area where all the other fields appear.


Thank you! This helps a lot! :cheer:

Last edit: 4 days 13 hours ago by Rusty.

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

Time to create page: 0.056 seconds
Powered by Kunena Forum