Export to csv - every unique product on one line

  • Posts: 75
  • Thank you received: 1
10 years 7 months ago #186742

-- HikaShop version -- : 2.3.5
-- Joomla version -- : 3.3.6
-- Browser(s) name and version -- : latest IE, FF and Chrome

Hello,

I am busy with export to csv after an order has been confirmed.
I am wondering if it is possible to have one line per unique ordered product.now all the unique products are on the same line with item1_order_product... as head and the following item1_order_product...

In the new situation you would have item_order_product... and on every line a unique product starting with the same order number. The name, address should also be on every line for that order.



Kind regards,

Wilfried

Attachments:

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

  • Posts: 26264
  • Thank you received: 4043
  • MODERATOR
10 years 7 months ago #186746

Hi,

Yes it is possible using a custom plugin using the trigger "onBeforeOrderExport".
www.hikashop.com/support/support/documen...#onBeforeOrderExport
Thanks to that, you can filter the columns and you can also create one line per item ; I already made a custom plugin with similar requirements one or two years ago.

Regards,


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

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

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

  • Posts: 75
  • Thank you received: 1
10 years 7 months ago #186796

Hello Jerome,

Thanks for your quick answer.
Where can I find that plugin you made?

Kind regards, Wilfried

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

  • Posts: 26264
  • Thank you received: 4043
  • MODERATOR
10 years 7 months ago #186901

Hi,

I checked my custom plugins and I saw that I got the "quickbooks" export plugin which gives one line per product.
This plugin has been release under open-source licence.

Please see this thread: www.hikashop.com/forum/2-general-talk-ab...tegration.html#93276

Regards,


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

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

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

  • Posts: 75
  • Thank you received: 1
10 years 7 months ago #186922

Hi Jerome,

I installed the plugin, but it gives one line per order but so far as I can see it doesn't give one line per product as I described.

Kind regards Wilfried

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

  • Posts: 26264
  • Thank you received: 4043
  • MODERATOR
10 years 7 months ago #186947

Hi,

Did you checked the configuration of the plugin in the Joomla plugin manager (and that the plugin right published) ?

The plugin would override the classical HikaShop export, you can activate or deactivate the plugin by unpublishing it or changing the internal option.


Regards,


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

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

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

  • Posts: 75
  • Thank you received: 1
10 years 7 months ago #187022

Yes I had published the plugin and had "Activate export system set to Yes.

Should I use this plugin only with the manual export function in the orders section? That could be the misunderstanding then.

I want the csv to be automaticly created with the massaction export to csv functions
So a csv file with one line for every unique product automaticle created in the path underneath the upload directory.

Is that possible?

kind regards WIlfried

Last edit: 10 years 7 months ago by wilfried.

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

  • Posts: 26264
  • Thank you received: 4043
  • MODERATOR
10 years 7 months ago #187028

Hi,

The plugin just override the "order export" feature ; it does not do anything with the mass actions (when I wrote it, the mass action didn't exists).
If you want to use the mass-action for that, just let us know and I will let Xavier answer you.
For what I know about the mass-action I don't think that it will be possible using the regular features ; it might require a special plugin too.

Regards,


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

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

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

  • Posts: 75
  • Thank you received: 1
10 years 6 months ago #188326

Hello Jerome or Xavier,

Would it be possible to change the massaction routine so that the products are exported to the csv file on one line as described above?

Kind regards,

Wilfried Rutjes

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

  • Posts: 26264
  • Thank you received: 4043
  • MODERATOR
10 years 6 months ago #188377

Hi,

The mass action can perform actions on "order" and on "product" but there is no "order product".
I think that the best to export such kind of CSV using mass action will be to make an export of "order products", at this moment the "one line per product" will be directly made by the kind of the export ; and it could be possible to also display data of the orders (because an order product is linked with an order).

Regards,


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

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

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

  • Posts: 75
  • Thank you received: 1
10 years 6 months ago #190623

Hello,

A colleague of mine has written a routine for me to achieve what I asked in this post.
"to adapt HikaShop to facilitate a CSV export where each product in an order is on a separate line, instead of on one line."

It works like a charm. :)

Are you interested in that routine?

The function _exportCSV is replaced by a new function exportCSVOrderCustom in massaction_order.php
He also adds a manual to add the 2 functions to massactionorder.php

Always handy when a new version of hikashop is being released.

Just let me know if you or anybody else is interested. If that is the case I\ll post the code and the manual to implement the code in this forum.

Kind regard, Wilfried

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

  • Posts: 84220
  • Thank you received: 13673
  • MODERATOR
10 years 6 months ago #190663

Hi,

I think that the best would be to add an option to the "export CSV file" action for the "order" data so that the exported CSV would be rearranged like you say.

The modified code might be useful but we'll probably have to arrange it or do our own stuff in order to have the option to activate/deactivate it in the mass action options.
Still, it could also be useful to others in the mean time, so it's great if you can post the changes.

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

  • Posts: 75
  • Thank you received: 1
10 years 6 months ago #190674

Have a look at it, see the attachments

Kind regards, Wilfried

Attachments:
Last edit: 10 years 6 months ago by wilfried.

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

Time to create page: 0.091 seconds
Powered by Kunena Forum