- Posts: 75
- Thank you received: 1
sequence columns of csv
-- 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.
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.
kind regards Wilfried
Please Log in or Create an account to join the conversation.
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.
kind regards Wilfried
Please Log in or Create an account to join the conversation.
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.
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.
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.
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
Please Log in or Create an account to join the conversation.
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
Please Log in or Create an account to join the conversation.
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.
kind regards Wilfried
Please Log in or Create an account to join the conversation.
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.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.