- Posts: 4
- Thank you received: 0
Custom field values in Product table in Order
11 years 9 months ago #183744
by acymru
Custom field values in Product table in Order was created by acymru
-- HikaShop version -- : 2.3.4
-- Joomla version -- : 3.3.6
I have a number of custom fields in the product table that I would like to also display in the backend Order>Show view and the Order>Invoice view. I've found discussions on the board, but nothing's worked so far. I'm guessing I'm missing how to jump data between tables. I've found the relevant view files and have confirmed that edits are read properly.
-- Joomla version -- : 3.3.6
I have a number of custom fields in the product table that I would like to also display in the backend Order>Show view and the Order>Invoice view. I've found discussions on the board, but nothing's worked so far. I'm guessing I'm missing how to jump data between tables. I've found the relevant view files and have confirmed that edits are read properly.
Please Log in or Create an account to join the conversation.
11 years 9 months ago #183777
by Xavier
Replied by Xavier on topic Custom field values in Product table in Order
Hi,
You will have to add custom code, for example in the view "order / show_products" add:
Before:
And:
In the desired <td> in the foreach.
You will have to add custom code, for example in the view "order / show_products" add:
Code:
$cids = array();
foreach($this->order->products as $prod){
if($prod->product_id != '0')
$cids[]=$prod->product_id;
}
$productClass = hikashop_get('class.product');
$productClass->getProducts($cids);
Code:
foreach($this->order->products as $k => $product) {
Code:
<?php
if(in_array($product->product_id,array_keys($productClass->products))){
echo $productClass->products[$product->product_id]->CUSTOMFIELD_NAME;
}
?>
Please Log in or Create an account to join the conversation.
Time to create page: 0.217 seconds