Edit fields in Order Export

  • Posts: 84
  • Thank you received: 11
  • Hikashop Business
3 years 3 weeks ago #239050

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

I want to be able to use the Export button in Orders for my customer report. My client needs this as he wants to be able to specify the dates of orders for the export - NOT like mass actions which you have to set a period that is fixed.

However, the report that is generated has way too many fields that aren't needed. How can I specify which fields to show on this report?

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

  • Posts: 65706
  • Thank you received: 9590
  • MODERATOR
3 years 3 weeks ago #239067

Hi,

For the export button CSV, you have to edit the file "export" of the view "order" for your backend template via the menu Display>Views and add custom code in there in order to remove the columns you don't want.

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

  • Posts: 84
  • Thank you received: 11
  • Hikashop Business
3 years 2 weeks ago #239172

I see no arrays that show the columns just references to "$productFields".

Where are the references to the columns?

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

  • Posts: 65706
  • Thank you received: 9590
  • MODERATOR
3 years 2 weeks ago #239177

Hi,

In that file, the first row with the column titles is added with that line:
$export->writeLine($first);
And then the lines for all the orders are added with that line:
$export->writeLine($row);
So befroe these lines you need to unset the columns you don't want in these.

For example, if you don't want the thrid column and that this column is called "test" you want to add:

unset($first[2]);
and:
unset($row['test']);

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

  • Posts: 84
  • Thank you received: 11
  • Hikashop Business
3 years 2 weeks ago #239282

Gotcha. For other users this is an example of code that won't throw any errors and deletes the columns:

unset($first[0], $first[1]);
	$export->writeLine($first);

and
unset($row->user_id, $row->user_cms_id);
		$export->writeLine($row); 

The following user(s) said Thank You: nicolas, Galle43

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

Time to create page: 0.063 seconds
Powered by Kunena Forum