Fixed number of rows in file export

  • Posts: 43
  • Thank you received: 0
7 years 8 months ago #246534

-- HikaShop version -- : 2.6.3
-- Joomla version -- : 3.5.1

Hi,

Is there a way to have a fixed number of rows when exporting the order details from HikaShop? I'm using an accounting system to do all of my bookwork and I'm able to import the exported excel data from HikaShop. However, in order for this process to work, I need to have the same amount of rows each time the document gets exported because of the macro that's in place.

Currently what happens is that HikaShop exports a different number of rows based on how many products are in the order and thus each file comes out differently. I still need 1 item per row but need to have a fixed amount of rows for each document.

Is there a way to have all of the exported data files with the same amount of rows? or export the order data but with all the products I've loaded into HikaShop including the ones that have an order quantity of zero?

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

  • Posts: 81361
  • Thank you received: 13036
  • MODERATOR
7 years 7 months ago #246540

Hi,

HikaShop exports one row per order, not one row per item purchased.
So the number of rows should depend on the number of orders being exported.
If you changed the code or added a plugin to have one item per row, then you'll have one row per item per order.
But I don't see why a CSV import system can't handle a different number of rows for CSVs.
It's the principle of the CSV format that you have one row per item, and the number of items can vary in the CSV.
Are you sure that you didn't made a mistake and were actually talking about the columns of the CSV that have to have a fixed number ? That would make more sense. And in that case, you can use the CSV export of the mass actions (menu System>Mass actions) in order to select the columns that you want to export and thus get a fixed number of columns each time.

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

  • Posts: 43
  • Thank you received: 0
7 years 7 months ago #246626

Hi Nicholas,

Sorry if my post was unclear.

So the CSV document exports all of the orders from the last 24 hours and has one order per column. In this column are the shoppers details and products ordered with each entry been placed in a separate row. The problem is that the number of rows in the CSV file changes every time because each order has a different amount of items ordered and thus more or less rows are added.

The system we are using is called SAP and it has to be set up to have a fixed number of import fields. Is there a way for the CSV file that gets exported from HikaShop to always have the same amount of rows every time the mass action exports a file?

I've attached 2 examples of the data that's been exported. I've removed the email address from the document for privacy reasons but otherwise this is the kind of data I'm working with.

Attachments:
Last edit: 7 years 7 months ago by wernejo. Reason: added files

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

  • Posts: 81361
  • Thank you received: 13036
  • MODERATOR
7 years 7 months ago #246664

Hi,

I'm not able to open your CSVs: take.ms/nyHBv
Are you sure that the files you uploaded in your message are valid CSV files ?

From reading your two messages, I'm more and more thinking that you're mistaking the rows and the columns.
SAP needs a fixed number of columns, not a fixed number of rows.
In your mass action, if you don't select any columns from the "order product" selector, you will get a fixed number of columns in your CSV. So that should be fine no ?
If you need the product details (name, quantity, price, etc) in the CSV, you'll need to have a plugin which modify the rows to have one row per product instead of one row per order. We have such plugin for the normal export button of the orders listing with the format quickbooks supports:
www.hikashop.com/forum/2-general-talk-ab...tegration.html#93276

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

  • Posts: 43
  • Thank you received: 0
7 years 7 months ago #246993

Hi Nicholas,

You were right, I did get the rows and columns mixed up. Sorry about the confusion.

In the mass action, I am trying to export the following tables for each order that gets placed during the last 24 hours.

1st section
deliverydate (custom field)
order_billing_address_id
order_created
order_number
order_status

2nd section
order_product_name
order_product_quantity

4th section
sapcode (custom field)
user_email
user_id

5th section
name

As you can see I'm trying to get all the information regarding who ordered the products, what they ordered, the quantity, and their SAP billing details. But because of how SAP requires a fixed number of columns, the mass action export makes this difficult due to some orders having more products than others and thus every time the mass action is proformed, I get a CSV/XLS file with different amounts of columns each time. I downloaded and installed the plugin you recommended but am unsure of how it's changed anything.

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

  • Posts: 81361
  • Thank you received: 13036
  • MODERATOR
7 years 7 months ago #247016

Hi,

That plugin will change the way the export work to get a fixed number of columns when you click on the "export" button of the orders listing in your backend.
It won't help for mass actions.
There is no option in the mass action system to change the way the orders are exported and get a fixed number of columns.
That would require the development of a custom plugin to handle that.

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

  • Posts: 81361
  • Thank you received: 13036
  • MODERATOR
7 years 7 months ago #247044

Hi,

I've searched a bit on our end and found that we had developed a custom plugin for someone else in order to do that.
So here you go.
Install it, enable it and use the custom CSV export in your mass action and it should produce a CSV like you need.

File Attachment:

File Name: custom_ord...port.zip
File Size:5 KB

Attachments:
Last edit: 7 years 7 months ago by nicolas.

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

Time to create page: 0.052 seconds
Powered by Kunena Forum