sequence columns of csv

  • Posts: 75
  • Thank you received: 1
9 years 9 months ago #191375

-- url of the page with the problem -- : www.light-swing.com
-- HikaShop version -- : 2.3.5
-- Joomla version -- : 3.3.6
-- Browser(s) name and version -- : latest IE, FF and Chrome

Hello,

I have an hourly export from the order data of my orders. I transfer that csv to the packing company and they do the shipping for the client.

Yestarday we had a client who had a different shipping address then the billing address and then the sequence or order of the columns of the csv is also changed.
Where normally the line starts with shipping_address data and after that the shipping_address data it now starts with the billing_address data.
Unfortunatly the packing company doesn't read the order fiields with the firts line with the fieldnames but they read the sequence and so when the shipping address is different then the billing address it is read the wrong way.

Ant way I can change the order ?

Kind regards, Wilfried

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
9 years 9 months ago #191392

Hi,

How did you configure your CSV export ?
Normally, the order of the columns in a CSV is irrelevant. For example, with the CSV import of HikaShop, you can order the columns any way you want and it will work the same. Is that what you're talking about ?

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

  • Posts: 75
  • Thank you received: 1
9 years 9 months ago #191670

I agree that the order shouldn't be relevant but my client uses a packing company who reads the fileds in de csv in the order they are presented and they don't use the first line :-(

kind regards Wilfried

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
9 years 9 months ago #191676

Hi,

So how did you configure your CSV export ?
Could you do a screenshot of the settings ?

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

  • Posts: 75
  • Thank you received: 1
9 years 9 months ago #191715

I have sent you credentials for the test environment.

kind regards Wilfried

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

  • Posts: 13201
  • Thank you received: 2322
9 years 9 months ago #191767

Hi,

I have edited the file "administrator/components/com_hikashop/classes/massaction.php" function "organizeExportColumn()" in order to force the order of the addresses. Now the addresses columns are always starting by the billing one in the csv file.

You can reverse the order if you want, I added a comment in the code for that.

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

  • Posts: 75
  • Thank you received: 1
9 years 9 months ago #191861

Thanks Xavier.

I did some testing and billing address comes first all the time.
I changed the order of these two lines to get the shipping address first, or is that not what you mean?

// Reverse the order of these elements to have the shipping address first
if(!isset($action)) $action = array();
if(!isset($action)) $action = array();

Do I have to change something else to change the order?

Hope to hear from you.

Kind regards, Wilfried

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

  • Posts: 13201
  • Thank you received: 2322
9 years 8 months ago #191908

Hi,

I made the change directly on your website, to put the shipping_address first.
That should do the job, if not please tell me and I will do deeper checks.

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

  • Posts: 75
  • Thank you received: 1
9 years 8 months ago #191938

Hello Xavier,

Thanks for that. I'll test this later on.

Is it possible to tell me which part you have edited so that I can copy that part to the script on the production server?
Are can I copy that whole function to be sure, or have you edited parts outside that function?

This is also handy when a new version of Hikashop arrives.

Thanks in advance.

Kind regards Wilfried

Last edit: 9 years 8 months ago by wilfried.

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

  • Posts: 75
  • Thank you received: 1
9 years 8 months ago #191981

Hello Xavier,

I am sorry, but I have tested it and billing is still the first one.
Can you have another look please?

You may also test it with the massaction "Export naar CSV (Every Hour)", it is all test.
It copies a file to /subdomains/test/media/com_hikashop/upload/confirmed_orders

Thx

Last edit: 9 years 8 months ago by wilfried.

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

  • Posts: 13201
  • Thank you received: 2322
9 years 8 months ago #192096

Hi,

I will have a look at your issue tomorrow morning.
Sorry for the delay.

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

  • Posts: 75
  • Thank you received: 1
9 years 8 months ago #192097

No Problem, Thx.

kind regards Wilfried

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

  • Posts: 13201
  • Thank you received: 2322
9 years 8 months ago #192180

Hi,

Problem solved, it was just a ridiculous mistake, I placed the code before the foreach instead of inside.
So it was trying to do a check on a not declared variable so was not taking in account the code.

The following user(s) said Thank You: wilfried

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

  • Posts: 75
  • Thank you received: 1
9 years 8 months ago #192276

Thank you very much.

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

Time to create page: 0.086 seconds
Powered by Kunena Forum