Skip to main content

Custom field values in Product table in Order

More
11 years 9 months ago #183744 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.

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

More
11 years 9 months ago #183777 by Xavier
Hi,

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);
Before:
Code:
foreach($this->order->products as $k => $product) {
And:
Code:
<?php if(in_array($product->product_id,array_keys($productClass->products))){ echo $productClass->products[$product->product_id]->CUSTOMFIELD_NAME; } ?>
In the desired <td> in the foreach.

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

Time to create page: 0.217 seconds
Powered by Kunena Forum