Display product custom field on Order

  • Posts: 100
  • Thank you received: 1
10 years 5 months ago #162203

-- HikaShop version -- : 2.3.1
-- Joomla version -- : 3x
-- PHP version -- : x5x

Hi

I would like to display the custom field for table "product" on the Order View and Files - show and listing.

In the Show file, I have used the below to get the product details..

<?php $productclass = hikashop_get('class.product'); $data = $productclass->get($product->product_id); ?>

I use echo $data->FIELD_COLUMN_NAME;

However I would like to retrieve the custom field "Title" instead of the Value.

If I use the below, it gives all the custom field value but not related to the item in the order.

$fieldsClass = hikashop_get('class.field');
$fields = $fieldsClass->getFields('frontcomp',$this->row,'product','checkout&task=state');

Could you advise how I can retrieve the custom fields related to the product on the order only.

Thanks

Patrick

Last edit: 10 years 5 months ago by paddyrolls.
The following user(s) said Thank You: pepecortez

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

  • Posts: 82910
  • Thank you received: 13379
  • MODERATOR
10 years 5 months ago #162216

Hi,

You're almost there.
You need to do like that after the two pieces of code you gave :

echo $fieldsClass->show($fields['FIELD_COLUMN_NAME'],$data->FIELD_COLUMN_NAME);
Of course, it goes without saying that the FIELD_COLUMN_NAME need to be replaced by the column name of the field :)

The following user(s) said Thank You: pepecortez

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

Time to create page: 0.052 seconds
Powered by Kunena Forum