- Posts: 31
- Thank you received: 3
only display custom field value on the product listing
-- Joomla version -- : 3.9.5
-- PHP version -- : 7.2
-- Browser(s) name and version -- : Firefox last version
hello,
how are you
I create a new custom field for example : name : Mobile Document & Column name : mobile_document
and set the only display to front end
how display value only the product listing
*** <?php echo $this->element->mobile_document; ?> ==== mobile_document is the column name of custom field.
code don't work in product listing , but work in the product detail
please help me to display custom field value on the product listing
thanks
Please Log in or Create an account to join the conversation.
It's inside row. Your code should look like this:
Thanks
Please Log in or Create an account to join the conversation.
I create custom field Type of Ajax file and set Front-end to : No
I use php code (<?php echo $this->row->document; ?>) to display file to product detail.
but display file name Without link
please help me to display custom field (ajax file) with php code
thanks
Please Log in or Create an account to join the conversation.
Yes, if you only use that code, it will display the raw data in that field in the database.
If you want the field system to do its magic on the raw data, you need to use such code instead:
Please Log in or Create an account to join the conversation.
nicolas wrote: Hi,
Yes, if you only use that code, it will display the raw data in that field in the database.
If you want the field system to do its magic on the raw data, you need to use such code instead:
<?php
$field = $this->fieldsClass->get(XXX);
echo $this->fieldsClass->show($field, $this->row->document);
?>
Where XXX is the id of the field : monosnap.com/file/MZgl5DbSJu0IxSlWX7vQybCk9D6NpT
Thanks Nicolas
I change code but display error
please see the image (attached)
thanks
Please Log in or Create an account to join the conversation.
It looks like your custom field is using the namekey "mobile_document" and not "document" (as your previous message).
So you should use that variable name instead.
Regards,
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Please Log in or Create an account to join the conversation.