- Posts: 100
- Thank you received: 1
Display product custom field on Order
- paddyrolls
-
Topic Author
- Offline
Less
More
12 years 3 months ago - 12 years 3 months ago #162203
by paddyrolls
Display product custom field on Order was created by paddyrolls
-- 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
-- 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: 12 years 3 months ago by paddyrolls.
The following user(s) said Thank You: pepecortez
Please Log in or Create an account to join the conversation.
12 years 3 months ago #162216
by nicolas
Replied by nicolas on topic Display product custom field on Order
Hi,
You're almost there.
You need to do like that after the two pieces of code you gave :
Of course, it goes without saying that the FIELD_COLUMN_NAME need to be replaced by the column name of the field
You're almost there.
You need to do like that after the two pieces of code you gave :
Code:
echo $fieldsClass->show($fields['FIELD_COLUMN_NAME'],$data->FIELD_COLUMN_NAME);
The following user(s) said Thank You: pepecortez
Please Log in or Create an account to join the conversation.
Time to create page: 0.228 seconds