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

#   Add fields from Payment Plugin to CSV Export

##

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

Less More

- Posts: 57
- Thank you received: 1
-
-

10 years 3 months ago [\#247119](#247119) by [tariaki](/forum/user/43507-tariaki "View tariaki's Profile")  *[Add fields from Payment Plugin to CSV Export](/forum/36-reports-statistics/885906-add-fields-from-payment-plugin-to-csv-export#247119 "-- HikaShop version -- : HikaShop Business: 2.6.3 -- Joomla version -- : 3.6 -- PHP version -- : 5.6  Hey  When using Purchase Order payment method there an input box for the order number. Also, I have added to it another inout box called The Workflow Code. I have managed to pass the values to the order, the confirmation emails and to the invoice but can't find how to add those 2 fields to the CSV Export file...  Ideas?  Thanks")* was created by *[tariaki](/forum/user/43507-tariaki "View tariaki's Profile")*

-- HikaShop version -- : HikaShop Business: 2.6.3
-- Joomla version -- : 3.6
-- PHP version -- : 5.6

Hey

When using Purchase Order payment method there an input box for the order number. Also, I have added to it another inout box called The Workflow Code. I have managed to pass the values to the order, the confirmation emails and to the invoice but can't find how to add those 2 fields to the CSV Export file...

Ideas?

Thanks

- [ ![Screen&#95;Shot&#95;2016-08-05&#95;at&#95;15&#95;34&#95;33.jpg](/forum/attachment/32937) ](/forum/attachment/32937 "...t&#95;15&#95;34&#95;33.jpg") [ ](/forum/attachment/32937?download=1 "...t&#95;15&#95;34&#95;33.jpg")

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

- **[Jerome](/forum/user/80-jerome "View Jerome's Profile")**
- [![Jerome's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar80.png)](/forum/user/80-jerome "View Jerome's Profile")
- [ Offline](/forum/user/80-jerome)
- HikaShop core developer

Less More

- Posts: 26400
- Thank you received: 4080
-
- [](http://obsi.dev)
-

10 years 3 months ago [\#247122](#247122) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[Add fields from Payment Plugin to CSV Export](/forum/36-reports-statistics/885906-add-fields-from-payment-plugin-to-csv-export#247122 "-- HikaShop version -- : HikaShop Business: 2.6.3 -- Joomla version -- : 3.6 -- PHP version -- : 5.6  Hey  When using Purchase Order payment method there an input box for the order number. Also, I have added to it another inout box called The Workflow Code. I have managed to pass the values to the order, the confirmation emails and to the invoice but can't find how to add those 2 fields to the CSV Export file...  Ideas?  Thanks")*

Hi,

The plugin "purchase order" store his data in the order history ; that data is not include in the order export.
With recent features in HikaShop, I think that the "order_payment_params" could be a better place to let that plugin store his data.

The idea would be to update the plugin and replace Code:

$history-&gt;data = JText::_('PURCHASE_ORDER_NUMBER').@$_SESSION['hikashop_purchase_order_number'];

By Code:

$history-&gt;data = JText::_('PURCHASE_ORDER_NUMBER').@$_SESSION['hikashop_purchase_order_number']; if(empty($order-&gt;order_payment_params)) $order-&gt;order_payment_params = new stdClass(); $order-&gt;order_payment_params-&gt;purchase_order = @$_SESSION['hikashop_purchase_order_number'];

And then you will also find the purchase order data in the order export (encapsulated but the information will be there).

Regards,

---

Jerome - Obsidev.com
HikaMarket &amp; HikaSerial developer / HikaShop core dev team.

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

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

Less More

- Posts: 57
- Thank you received: 1
-
-

10 years 3 months ago [\#247209](#247209) by [tariaki](/forum/user/43507-tariaki "View tariaki's Profile")  Replied by *[tariaki](/forum/user/43507-tariaki "View tariaki's Profile")* on topic *[Add fields from Payment Plugin to CSV Export](/forum/36-reports-statistics/885906-add-fields-from-payment-plugin-to-csv-export#247209 "-- HikaShop version -- : HikaShop Business: 2.6.3 -- Joomla version -- : 3.6 -- PHP version -- : 5.6  Hey  When using Purchase Order payment method there an input box for the order number. Also, I have added to it another inout box called The Workflow Code. I have managed to pass the values to the order, the confirmation emails and to the invoice but can't find how to add those 2 fields to the CSV Export file...  Ideas?  Thanks")*

Hey Jerome

Thanks for your reply.

Added the changed in the code as you suggested :
Code:

$history-&gt;data = JText::_('PURCHASE_ORDER_NUMBER').@$_SESSION['hikashop_purchase_order_number']; if(empty($order-&gt;order_payment_params)) $order-&gt;order_payment_params = new stdClass(); $order-&gt;order_payment_params-&gt;purchase_order = @$_SESSION['hikashop_purchase_order_number'] ."&lt;br&gt; The Work Flow Code : ".@$_SESSION['hikashop_account_holder_number'];

Still can't find this info in the CSV file.

Ideas?

Cheers

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzM2LXJlcG9ydHMtc3RhdGlzdGljcy84ODU5MDYtYWRkLWZpZWxkcy1mcm9tLXBheW1lbnQtcGx1Z2luLXRvLWNzdi1leHBvcnQ/dG1wbD1tYXJrZG93bg==) 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")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86555
- Thank you received: 14304
-
-

10 years 3 months ago [\#247214](#247214) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Add fields from Payment Plugin to CSV Export](/forum/36-reports-statistics/885906-add-fields-from-payment-plugin-to-csv-export#247214 "-- HikaShop version -- : HikaShop Business: 2.6.3 -- Joomla version -- : 3.6 -- PHP version -- : 5.6  Hey  When using Purchase Order payment method there an input box for the order number. Also, I have added to it another inout box called The Workflow Code. I have managed to pass the values to the order, the confirmation emails and to the invoice but can't find how to add those 2 fields to the CSV Export file...  Ideas?  Thanks")*

Hi,

You'll only see that for new orders after you did the change. For older ones, there is no easy solution besides complex custom code.

Did you try after some new orders ?
Could you provide a copy of the resulting CSV ?

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

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

Less More

- Posts: 57
- Thank you received: 1
-
-

10 years 3 months ago -  10 years 3 months ago [\#247592](#247592) by [tariaki](/forum/user/43507-tariaki "View tariaki's Profile")  Replied by *[tariaki](/forum/user/43507-tariaki "View tariaki's Profile")* on topic *[Add fields from Payment Plugin to CSV Export](/forum/36-reports-statistics/885906-add-fields-from-payment-plugin-to-csv-export#247592 "-- HikaShop version -- : HikaShop Business: 2.6.3 -- Joomla version -- : 3.6 -- PHP version -- : 5.6  Hey  When using Purchase Order payment method there an input box for the order number. Also, I have added to it another inout box called The Workflow Code. I have managed to pass the values to the order, the confirmation emails and to the invoice but can't find how to add those 2 fields to the CSV Export file...  Ideas?  Thanks")*

Hey Nicolas,

Almost there... ![;)](/media/kunena/emoticons/24.png ";)")

First, I have added a custom field to the plugin called 'The Workflow Code' - see attached.
I can see both fields on the order page in the backend and they are also being sent to the admin order creation email.

But in the report I can only see the order number field in a very strange format - see attached. And the custom field doesn't appear to be in the report at all.

My code looks like that :
Code:

function needCC(&amp;$method){ $method-&gt;custom_html='&lt;span style="margin-left:10%"&gt;'.JText::_('PURCHASE_ORDER_NUMBER'). '&lt;input type="text" class="hikashop_purchase_order_number inputbox required" name="hikashop_purchase_order_number" value="'.@$_SESSION['hikashop_purchase_order_number'].'"/&gt; *&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="margin-left:10%"&gt;'. JText::_('The Workflow Code: ').'&lt;input type="text" class="hikashop_account_holder_number inputbox required" name="hikashop_account_holder_number" value="'.@$_SESSION['hikashop_account_holder_number'].'"/&gt; *&lt;/span&gt;'; } function onPaymentSave(&amp;$cart, &amp;$rates, &amp;$payment_id) { $_SESSION['hikashop_purchase_order_number'] = JRequest::getVar('hikashop_purchase_order_number'); $_SESSION['hikashop_account_holder_number'] = JRequest::getVar('hikashop_account_holder_number');

And added your suggested code : Code:

$history-&gt;data = JText::_('PURCHASE_ORDER_NUMBER').@$_SESSION['hikashop_purchase_order_number']. "&lt;br&gt; The Workflow Code : ".@$_SESSION['hikashop_account_holder_number']; if(empty($order-&gt;order_payment_params)) $order-&gt;order_payment_params = new stdClass(); $order-&gt;order_payment_params-&gt;purchase_order = @$_SESSION['hikashop_purchase_order_number'];

Ideas?

Thanks

- [ ![Screen&#95;Shot&#95;2016-08-14&#95;at&#95;17&#95;56&#95;34.jpg](/forum/attachment/33015) ](/forum/attachment/33015 "...t&#95;17&#95;56&#95;34.jpg") [ ](/forum/attachment/33015?download=1 "...t&#95;17&#95;56&#95;34.jpg")
- [ ![Screen&#95;Shot&#95;2016-08-14&#95;at&#95;17&#95;13&#95;40&#95;2016-08-14.jpg](/forum/attachment/33016) ](/forum/attachment/33016 "...2016-08-14.jpg") [ ](/forum/attachment/33016?download=1 "...2016-08-14.jpg")
- [ ![Screen&#95;Shot&#95;2016-08-14&#95;at&#95;17&#95;57&#95;34.jpg](/forum/attachment/33017) ](/forum/attachment/33017 "...t&#95;17&#95;57&#95;34.jpg") [ ](/forum/attachment/33017?download=1 "...t&#95;17&#95;57&#95;34.jpg")
- [ ![Screen&#95;Shot&#95;2016-08-14&#95;at&#95;17&#95;57&#95;24.jpg](/forum/attachment/33018) ](/forum/attachment/33018 "...t&#95;17&#95;57&#95;24.jpg") [ ](/forum/attachment/33018?download=1 "...t&#95;17&#95;57&#95;24.jpg")

Last edit: 10 years 3 months ago by [Jerome](/forum/user/80-jerome "View Jerome's Profile"). Reason: cleaning code

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzM2LXJlcG9ydHMtc3RhdGlzdGljcy84ODU5MDYtYWRkLWZpZWxkcy1mcm9tLXBheW1lbnQtcGx1Z2luLXRvLWNzdi1leHBvcnQ/dG1wbD1tYXJrZG93bg==) 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")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86555
- Thank you received: 14304
-
-

10 years 2 months ago [\#247606](#247606) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Add fields from Payment Plugin to CSV Export](/forum/36-reports-statistics/885906-add-fields-from-payment-plugin-to-csv-export#247606 "-- HikaShop version -- : HikaShop Business: 2.6.3 -- Joomla version -- : 3.6 -- PHP version -- : 5.6  Hey  When using Purchase Order payment method there an input box for the order number. Also, I have added to it another inout box called The Workflow Code. I have managed to pass the values to the order, the confirmation emails and to the invoice but can't find how to add those 2 fields to the CSV Export file...  Ideas?  Thanks")*

Hi,

As Jerome said, the information is

> encapsulated but the information will be there

in the report.
If you want it as its own column, then create a custom field of the table "order" via the menu Display&gt;Custom fields and replace the line: Code:

$order-&gt;order_payment_params-&gt;purchase_order = @$_SESSION['hikashop_purchase_order_number'];

by: Code:

$order-&gt;XXX = @$_SESSION['hikashop_purchase_order_number'];

where XXX is the column name of your custom field.
You'll then get your value is a separate column with its title being the column name of your custom field.

The following user(s) said Thank You: [tariaki](/forum/user/43507-tariaki "View tariaki's Profile")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzM2LXJlcG9ydHMtc3RhdGlzdGljcy84ODU5MDYtYWRkLWZpZWxkcy1mcm9tLXBheW1lbnQtcGx1Z2luLXRvLWNzdi1leHBvcnQ/dG1wbD1tYXJrZG93bg==) 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.071 seconds

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