How to show custom field checkbox selected values in front-end.

  • Posts: 238
  • Thank you received: 29
  • Hikashop Business
3 years 10 months ago #332380

-- HikaShop version -- : 4.4.1
-- Joomla version -- : 3.9.25
-- PHP version -- : 7.3.27

Hi,
In back-end I have a custom field, type checkbox for product page, in witch I have 3 languages as values.


The field column name is: limba_produs
I want to show in front-end, on the product page only the 2 languages that are selected.
I want to show this filed in another position in product page, not where I have all the custom fields are visible.
Let's say that i want to display this at the bottom of the page, how can I do this?
If i do this:
echo $this->element->limba_produs
i get: 1,3 .It show the checkboxes that are selected

Attachments:
Last edit: 3 years 10 months ago by oxido. Reason: Added some extra info on the las row.

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

  • Posts: 83403
  • Thank you received: 13497
  • MODERATOR
3 years 10 months ago #332390

Hi,

You need to do it like that so that the values stored for the product are replaced by their title configured in the custom field:

$field = $this->fieldsClass->getField('limba_produs', 'product');
echo $this->fieldsClass->show($field,$this->element->limba_produs);

The following user(s) said Thank You: oxido

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

Time to create page: 0.063 seconds
Powered by Kunena Forum