[Skip to main content](#vessel-content)

#   Export Order

##

- **[arveni](/forum/user/33539-arveni "View arveni's Profile")**
- [![arveni's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/gallery/beer.png)](/forum/user/33539-arveni "View arveni's Profile") Topic Author
- [ Offline](/forum/user/33539-arveni)

Less More

- Posts: 79
- Thank you received: 0
-
-

11 years 6 months ago -  11 years 6 months ago [\#202953](#202953) by [arveni](/forum/user/33539-arveni "View arveni's Profile")  *[Export Order](/forum/37-import-export-csv-xls/877191-export-order#202953 "-- HikaShop version -- : 4.3.0  Hi, I wanted to export my orders to excel with the mass action function. I tried to export all datas. I downloaded the files but I noticed that datas about products are missing ( item1&#95;order&#95;product&#95;id , item1&#95;order&#95;id ,item1&#95;product&#95;id item1&#95;order&#95;product&#95;quantity, item1&#95;order&#95;product&#95;name item1&#95;order&#95;product&#95;code item1&#95;order&#95;product&#95;price item1&#95;order&#95;product&#95;tax item1&#95;order&#95;product&#95;tax&#95;info item1&#95;order&#95;product&#95;options I would need this data... What can I do?  (It's working by export via the orders webpage)")* was created by *[arveni](/forum/user/33539-arveni "View arveni's Profile")*

-- HikaShop version -- : 4.3.0

Hi,
I wanted to export my orders to excel with the mass action function. I tried to export all datas. I downloaded the files but I noticed that datas about products are missing (
item1_order_product_id , item1_order_id ,item1_product_id item1_order_product_quantity, item1_order_product_name item1_order_product_code item1_order_product_price item1_order_product_tax item1_order_product_tax_info item1_order_product_options
I would need this data...
What can I do?

(It's working by export via the orders webpage)

Last edit: 11 years 6 months ago by [arveni](/forum/user/33539-arveni "View arveni's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzM3LWltcG9ydC1leHBvcnQtY3N2LXhscy84NzcxOTEtZXhwb3J0LW9yZGVyP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Xavier](/forum/user/4105-xavier "View Xavier's Profile")**
- [![Xavier's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar4105.png)](/forum/user/4105-xavier "View Xavier's Profile")
- [ Offline](/forum/user/4105-xavier)

Less More

- Posts: 13201
- Thank you received: 2322
-
-
-
- [](http://www.kidiweb.fr)
-

11 years 6 months ago [\#202955](#202955) by [Xavier](/forum/user/4105-xavier "View Xavier's Profile")  Replied by *[Xavier](/forum/user/4105-xavier "View Xavier's Profile")* on topic *[Export Order](/forum/37-import-export-csv-xls/877191-export-order#202955 "-- HikaShop version -- : 4.3.0  Hi, I wanted to export my orders to excel with the mass action function. I tried to export all datas. I downloaded the files but I noticed that datas about products are missing ( item1&#95;order&#95;product&#95;id , item1&#95;order&#95;id ,item1&#95;product&#95;id item1&#95;order&#95;product&#95;quantity, item1&#95;order&#95;product&#95;name item1&#95;order&#95;product&#95;code item1&#95;order&#95;product&#95;price item1&#95;order&#95;product&#95;tax item1&#95;order&#95;product&#95;tax&#95;info item1&#95;order&#95;product&#95;options I would need this data... What can I do?  (It's working by export via the orders webpage)")*

Hi,

Please replace the function "organizeExportColumn()" in Administrator/components/com_hikashop/classes/massaction.php by this one: Code:

function organizeExportColumn($data,$table,&amp;$elements,&amp;$action,&amp;$types){ switch($data){ case 'product': switch($table){ case 'product': $ids = array(); $database = JFactory::getDBO(); foreach($elements as $element){ if(isset($element-&gt;product_parent_id-&gt;id)){ $ids[] = $element-&gt;product_parent_id-&gt;id; }else if($element-&gt;product_parent_id){ $ids[] = $element-&gt;product_parent_id; } } if(!empty($ids)){ $tIds = array(); foreach($ids as $id){ if(isset($id-&gt;id)) $tIds[(int)$id-&gt;id] = (int)$id-&gt;id; elseif($id != 0) $tIds[(int)$id] = (int)$id; } if(empty($tIds)) $tIds = array(0); $query = 'SELECT product_id, product_code'; $query .= ' FROM '.hikashop_table('product'); $query .= ' WHERE product_id IN ('.implode(',',$tIds).')'; $database-&gt;setQuery($query); $rows = $database-&gt;loadObjectList(); foreach($elements as &amp;$element){ $id = $element-&gt;product_parent_id; $element-&gt;product_parent_id = ''; if(!isset($types['product_parent_id'])) $types['product_parent_id'] = new stdClass(); $types['product_parent_id']-&gt;type = 'text'; foreach($rows as $row){ if(isset($id-&gt;id) &amp;&amp; $id-&gt;id != $row-&gt;product_id){continue;} $element-&gt;product_parent_id = $row-&gt;product_code; } unset($element); } } break; case 'related': $ids = array(); $database = JFactory::getDBO(); foreach($elements as $element){ $ids[] = $element-&gt;product_id; } $query = 'SELECT pr.product_id, p.product_code'; $query .= ' FROM '.hikashop_table('product').' AS p'; $query .= ' INNER JOIN '.hikashop_table('product_related').' AS pr ON pr.product_related_id = p.product_id'; $query .= ' WHERE pr.product_id IN ('.implode(',',$ids).')'; $database-&gt;setQuery($query); $rows = $database-&gt;loadObjectList(); $types['related']-&gt;type = 'text'; foreach($elements as $element){ foreach($element as $key=&gt;$related){ if($key == 'related'){ foreach($related as $product){ $product-&gt;related = ''; foreach($rows as $row){ if($element-&gt;product_id != $row-&gt;product_id){continue;} $product-&gt;related = $row-&gt;product_code; } } } } } break; case 'category': unset($action['category']); $database = JFactory::getDBO(); $ids = array(); foreach($elements as $element){ foreach($element as $key=&gt;$data){ if($key == 'category'){ foreach($data as $category){ if(isset($category-&gt;category_id)){ $ids[] = (int)$category-&gt;category_id; } } } } } if(!empty($ids)){ $query = 'SELECT DISTINCT category_name, category_id'; $query .= ' FROM '.hikashop_table('category'); $query .= ' WHERE category_id IN ('.implode(',',$ids).')'; $database-&gt;setQuery($query); $rows = $database-&gt;loadObjectList(); foreach($elements as $element){ foreach($element as $key=&gt;&amp;$data){ if($key == 'category'){ foreach($data as &amp;$category){ if(isset($category-&gt;category_id)){ $array = array(); foreach($rows as $row){ if($row-&gt;category_id == $category-&gt;category_id){ $array[] = $row-&gt;category_name; } } $category-&gt;categories = $this-&gt;separator($array,$data,$table); $types['categories'] = new stdClass(); $types['categories']-&gt;type = 'text'; $action['category']['categories'] = 'categories'; } unset($category); } } unset($data); } } } break; } break; case 'user': switch($table){ case 'address': foreach($elements as &amp;$element){ if(!isset($element-&gt;address)){continue;} foreach($element-&gt;address as $k=&gt;$address){ if($address-&gt;address_default != 1){ unset($element-&gt;address[$k]); } } unset($element); } break; } break; case 'category': //unset($action['category']); $database = JFactory::getDBO(); $ids = array(); foreach($elements as $category){ if(isset($category-&gt;category_id)){ $ids[] = (int)$category-&gt;category_id; } if(isset($category-&gt;category_parent_id)){ $ids[] = (int)$category-&gt;category_parent_id-&gt;id; } } if(!empty($ids)){ $query = 'SELECT DISTINCT category_name, category_id'; $query .= ' FROM '.hikashop_table('category'); $query .= ' WHERE category_id IN ('.implode(',',$ids).')'; $database-&gt;setQuery($query); $rows = $database-&gt;loadObjectList(); foreach($elements as &amp;$category){ if(isset($category-&gt;category_parent_id-&gt;id)){ $array = array(); foreach($rows as $row){ if($row-&gt;category_id == $category-&gt;category_parent_id-&gt;id){ $array[] = $row-&gt;category_name; } } $category-&gt;parent_category = $this-&gt;separator($array,$data,$table); if(!isset($types['parent_category']) &#124;&#124; !is_object($types['parent_category'])) $types['parent_category'] = new stdClass(); $types['parent_category']-&gt;type = 'text'; $action['category']['parent_category'] = 'parent_category'; } if(isset($category-&gt;category_id)){ $array = array(); foreach($rows as $row){ if($row-&gt;category_id == $category-&gt;category_id){ $array[] = $row-&gt;category_name; } } $category-&gt;categories = $this-&gt;separator($array,$data,$table); if(!isset($types['categories']) &#124;&#124; !is_object($types['categories'])) $types['categories'] = new stdClass(); $types['categories']-&gt;type = 'text'; //$action['category']['categories'] = 'categories'; } unset($category); } } break; case 'order': switch($table){ case 'address': if(isset($action['address'])){ foreach($elements as &amp;$element){ $element-&gt;shipping_address = array(); $element-&gt;billing_address = array(); if(!isset($element-&gt;address)){continue;} foreach($element-&gt;address as $address){ if($address-&gt;address_id === $element-&gt;order_shipping_address_id &#124;&#124; $address-&gt;address_id === $element-&gt;order_billing_address_id){ // Reverse the order of these elements to have the shipping address first if(!isset($action['shipping_address'])) $action['shipping_address'] = array(); if(!isset($action['billing_address'])) $action['billing_address'] = array(); } if($address-&gt;address_id === $element-&gt;order_shipping_address_id &amp;&amp; $address-&gt;address_id === $element-&gt;order_billing_address_id){ $object = new stdClass(); foreach($address as $column=&gt;$value){ if(!isset($action['address'][$column])){continue;} $billing_column = 'billing_'.$column; $action['billing_address'][$billing_column] = $billing_column; $object-&gt;$billing_column=$value; if(!isset($types[$billing_column])) $types[$billing_column] = new stdClass(); $types[$billing_column]-&gt;type = $types[$column]-&gt;type; $shipping_column = 'shipping_'.$column; $action['shipping_address'][$shipping_column] = $shipping_column; $object-&gt;$shipping_column=$value; if(!isset($types[$shipping_column])) $types[$shipping_column] = new stdClass(); $types[$shipping_column]-&gt;type = $types[$column]-&gt;type; } $element-&gt;billing_address[] = $object; $element-&gt;shipping_address[] = $object; }else if($address-&gt;address_id === $element-&gt;order_shipping_address_id){ $object = new stdClass(); foreach($address as $column=&gt;$value){ if(!isset($action['address'][$column])){continue;} $shipping_column = 'shipping_'.$column; $action['shipping_address'][$shipping_column] = $shipping_column; $object-&gt;$shipping_column=$value; if(!isset($types[$shipping_column])) $types[$shipping_column] = new stdClass(); $types[$shipping_column]-&gt;type = $types[$column]-&gt;type; } $element-&gt;shipping_address[] = $object; }else if($address-&gt;address_id === $element-&gt;order_billing_address_id){ $object = new stdClass(); foreach($address as $column=&gt;$value){ if(!isset($action['address'][$column])){continue;} $billing_column = 'billing_'.$column; $action['billing_address'][$billing_column] = $billing_column; $object-&gt;$billing_column = $value; if(!isset($types[$billing_column])) $types[$billing_column] = new stdClass(); $types[$billing_column]-&gt;type = $types[$column]-&gt;type; } $element-&gt;billing_address[] = $object; } } unset($element); } unset($action['address']); } break; case 'order_product': if(isset($action['order_product'])){ foreach($elements as &amp;$element){ $cpt = 1; if(!isset($element-&gt;order_product)){continue;} if(!isset($element-&gt;order_full_tax)){ $element-&gt;order_full_tax = new stdClass(); $element-&gt;order_full_tax-&gt;value = 0; // $action['order']['order_full_tax'] = 'order_full_tax'; $types['order_full_tax'] = new stdClass(); $types['order_full_tax']-&gt;type = 'price'; } if(!isset($element-&gt;order_shipping_tax-&gt;value)){ $tmpValue = (int)$element-&gt;order_shipping_tax; $element-&gt;order_shipping_tax = new stdClass(); $element-&gt;order_shipping_tax-&gt;value = $tmpValue; } if(!isset($element-&gt;order_discount_tax-&gt;value)){ $tmpValue = (int)$element-&gt;order_discount_tax; $element-&gt;order_discount_tax = new stdClass(); $element-&gt;order_discount_tax-&gt;value = $tmpValue; } $element-&gt;order_full_tax-&gt;value += (int)$element-&gt;order_shipping_tax-&gt;value - (int)$element-&gt;order_discount_tax-&gt;value; $element-&gt;order_full_tax-&gt;currency = $element-&gt;order_currency_id; foreach($element-&gt;order_product as $product){ if(isset($product-&gt;order_product_quantity) &amp;&amp; isset($product-&gt;order_product_tax)){ $element-&gt;order_full_tax-&gt;value+=round($product-&gt;order_product_quantity*$product-&gt;order_product_tax,2); } $tablename = 'product'.$cpt; $object = new stdClass(); foreach($product as $column=&gt;$value){ if(!isset($action['order_product'][$column])){continue;} $product_column = 'item'.$cpt.'_'.$column; if(!isset($action[$tablename])) $action[$tablename] = new stdClass(); $action[$tablename]-&gt;$product_column = $product_column; $object-&gt;$product_column = $value; $types[$product_column] = new stdClass(); if(isset($types[$column]-&gt;type)){ $types[$product_column]-&gt;type = $types[$column]-&gt;type; }else{ $types[$product_column]-&gt;type = ''; } } $element-&gt;$tablename = array($object); $cpt++; } unset($element); } unset($action['order_product']); } break; case 'joomla_users': if(isset($action['joomla_users']) &amp;&amp; isset($elements[0]-&gt;joomla_users)){ foreach($elements as $element){ foreach($element-&gt;joomla_users as $joomla_users){ foreach($joomla_users as $column=&gt;$value){ $types[$column] = new stdClass(); if(!isset($types[$column]-&gt;type)){ $types[$column]-&gt;type = ''; } } } } } break; } break; } }

If that is not solving your issue, a backend and a FTP access will be required, you can send them via our contact form, don't forget to give the url of that topic in the message.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzM3LWltcG9ydC1leHBvcnQtY3N2LXhscy84NzcxOTEtZXhwb3J0LW9yZGVyP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[earmaster](/forum/user/35023-earmaster "View earmaster's Profile")**
- [![earmaster's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/35023-earmaster "View earmaster's Profile")
- [ Offline](/forum/user/35023-earmaster)

Less More

- Posts: 137
- Thank you received: 2
-
-

11 years 4 months ago -  11 years 4 months ago [\#208387](#208387) by [earmaster](/forum/user/35023-earmaster "View earmaster's Profile")  Replied by *[earmaster](/forum/user/35023-earmaster "View earmaster's Profile")* on topic *[Export Order](/forum/37-import-export-csv-xls/877191-export-order#208387 "-- HikaShop version -- : 4.3.0  Hi, I wanted to export my orders to excel with the mass action function. I tried to export all datas. I downloaded the files but I noticed that datas about products are missing ( item1&#95;order&#95;product&#95;id , item1&#95;order&#95;id ,item1&#95;product&#95;id item1&#95;order&#95;product&#95;quantity, item1&#95;order&#95;product&#95;name item1&#95;order&#95;product&#95;code item1&#95;order&#95;product&#95;price item1&#95;order&#95;product&#95;tax item1&#95;order&#95;product&#95;tax&#95;info item1&#95;order&#95;product&#95;options I would need this data... What can I do?  (It's working by export via the orders webpage)")*

Hi,
We're having the exact same issue. Export from the orders page works fine, but but order_product fields are displaying duplicates of the customer names instead of product data in the CSV Export mass action.

If we use the CSV export mass action to only export product data for testing purposes (for example product_name), then the fields are empty.

Is there something we can do to solve that issue?

Last edit: 11 years 4 months ago by [earmaster](/forum/user/35023-earmaster "View earmaster's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzM3LWltcG9ydC1leHBvcnQtY3N2LXhscy84NzcxOTEtZXhwb3J0LW9yZGVyP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86593
- Thank you received: 14334
-
-

11 years 4 months ago [\#208390](#208390) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Export Order](/forum/37-import-export-csv-xls/877191-export-order#208390 "-- HikaShop version -- : 4.3.0  Hi, I wanted to export my orders to excel with the mass action function. I tried to export all datas. I downloaded the files but I noticed that datas about products are missing ( item1&#95;order&#95;product&#95;id , item1&#95;order&#95;id ,item1&#95;product&#95;id item1&#95;order&#95;product&#95;quantity, item1&#95;order&#95;product&#95;name item1&#95;order&#95;product&#95;code item1&#95;order&#95;product&#95;price item1&#95;order&#95;product&#95;tax item1&#95;order&#95;product&#95;tax&#95;info item1&#95;order&#95;product&#95;options I would need this data... What can I do?  (It's working by export via the orders webpage)")*

Hi,

Which version of HikaShop are you using ?
Could you do a screenshot of how you configured your mass action ?

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzM3LWltcG9ydC1leHBvcnQtY3N2LXhscy84NzcxOTEtZXhwb3J0LW9yZGVyP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[earmaster](/forum/user/35023-earmaster "View earmaster's Profile")**
- [![earmaster's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/35023-earmaster "View earmaster's Profile")
- [ Offline](/forum/user/35023-earmaster)

Less More

- Posts: 137
- Thank you received: 2
-
-

11 years 4 months ago [\#208448](#208448) by [earmaster](/forum/user/35023-earmaster "View earmaster's Profile")  Replied by *[earmaster](/forum/user/35023-earmaster "View earmaster's Profile")* on topic *[Export Order](/forum/37-import-export-csv-xls/877191-export-order#208448 "-- HikaShop version -- : 4.3.0  Hi, I wanted to export my orders to excel with the mass action function. I tried to export all datas. I downloaded the files but I noticed that datas about products are missing ( item1&#95;order&#95;product&#95;id , item1&#95;order&#95;id ,item1&#95;product&#95;id item1&#95;order&#95;product&#95;quantity, item1&#95;order&#95;product&#95;name item1&#95;order&#95;product&#95;code item1&#95;order&#95;product&#95;price item1&#95;order&#95;product&#95;tax item1&#95;order&#95;product&#95;tax&#95;info item1&#95;order&#95;product&#95;options I would need this data... What can I do?  (It's working by export via the orders webpage)")*

Hi, we are using 2.4.0

[ ![massactionsetup.png](/forum/attachment/25514) ](/forum/attachment/25514 "...ctionsetup.png")

- [ ![massactionsetup.png](/forum/attachment/25514) ](/forum/attachment/25514 "...ctionsetup.png") [ ](/forum/attachment/25514?download=1 "...ctionsetup.png")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzM3LWltcG9ydC1leHBvcnQtY3N2LXhscy84NzcxOTEtZXhwb3J0LW9yZGVyP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Xavier](/forum/user/4105-xavier "View Xavier's Profile")**
- [![Xavier's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar4105.png)](/forum/user/4105-xavier "View Xavier's Profile")
- [ Offline](/forum/user/4105-xavier)

Less More

- Posts: 13201
- Thank you received: 2322
-
-
-
- [](http://www.kidiweb.fr)
-

11 years 4 months ago [\#208451](#208451) by [Xavier](/forum/user/4105-xavier "View Xavier's Profile")  Replied by *[Xavier](/forum/user/4105-xavier "View Xavier's Profile")* on topic *[Export Order](/forum/37-import-export-csv-xls/877191-export-order#208451 "-- HikaShop version -- : 4.3.0  Hi, I wanted to export my orders to excel with the mass action function. I tried to export all datas. I downloaded the files but I noticed that datas about products are missing ( item1&#95;order&#95;product&#95;id , item1&#95;order&#95;id ,item1&#95;product&#95;id item1&#95;order&#95;product&#95;quantity, item1&#95;order&#95;product&#95;name item1&#95;order&#95;product&#95;code item1&#95;order&#95;product&#95;price item1&#95;order&#95;product&#95;tax item1&#95;order&#95;product&#95;tax&#95;info item1&#95;order&#95;product&#95;options I would need this data... What can I do?  (It's working by export via the orders webpage)")*

Hi,

Please update you HikaShop version, this issue has been fixed and the fix is present in the release 2.5.0 available from our website here: [ www.hikashop.com/my-account/your-subscriptions.html](http://www.hikashop.com/my-account/your-subscriptions.html)

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzM3LWltcG9ydC1leHBvcnQtY3N2LXhscy84NzcxOTEtZXhwb3J0LW9yZGVyP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

Board Categories HikaShop Install &amp; Update Product &amp; Category Display Content Creation Sales and Orders Orders management Reports &amp; Statistics Customers Checkout Payment Methods Shipping Methods Import &amp; Export (CSV, XLS…) Specific Features Affilation Taxes Wishlist Vote Carousel &amp; Slider Mass Actions Filters &amp; Search Discount &amp; Coupon Feature Request Integrations Showcase General Talk about HikaShop Development HikaShop 3.0 Beta Translation Commercial Jobs HikaShop Components HikaMarket Market: Feature requests Market: How to? Market: Bug Report HikaSerial General talk about HikaSerial Serial: Bug Report Serial: How to? Support en Français de HikaSerial (French Support) HikaSubscription HikaAuction Auction: Feature requests Auction: How to? Auction: Bug report Hikashop around the world Support en Français (French Support) Russian FAQ. Курс выживания с Hikashop. Частые вопросы и о Расширения Hikashop Наши сайты на Hikashop 日本語版サポート(Japanese Support) Thai German Archives Bug Report How to?

[](/forum/topics/feed/mode-topics?format=feed&type=rss)

Time to create page: 0.097 seconds

[Powered by](/forum/credits) [Kunena Forum](https://www.kunena.org)
