Hikashop Export

  • Posts: 32
  • Thank you received: 0
10 years 7 months ago #151399

Hi,

When using the Hikashop Export system to export the products we have in our database, when we open the exported CSV file in either notepad or excel the data is slightly corrupted because some of the database fields contain carriage return/line feeds (i.e. \r\n) and so this pushes the remainder of the line onto the next line in the CSV and so excel thinks that this is a new record. I am therefore trying to create a custom plugin to fire just as the export button is pressed that will scan the database columns for each record and replace the \r\n characters if found. In order to do this i followed the instructions on the following page www.hikashop.com/support/support/documen...nBeforeProductExport . I can successfully install the plugin without any problems. However when i enable the plugin and navigate to any page on the hikashop component, the screen simply goes blank and nothing happens. I have just added the functions to the plugin without adding any code in the function and yet its still broken. I have attached my plugin to this post - perhaps someone can shed some light on why this is happening?

Thanks in advance

Attachments:

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

  • Posts: 26158
  • Thank you received: 4028
  • MODERATOR
10 years 7 months ago #151424

Hi,

If you got a blank page, please change the "PHP error reporting" level in your Joomla global configuration.
At this moment you will see the PHP error messages instead of a blank page. It will give more more details to debug your plugin.

About your main problem, You totally can have some carriage return in a CSV file without any problem.
HikaShop use the CSV rules with quotes to have some delimiter between values.
If you open your CSV file correctly, saying that only the coma is the separator, your CSV file will be open nice.

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: 32
  • Thank you received: 0
10 years 7 months ago #151462

Hi

Thanks for your response. Can you let me know if I'm going down the right track with my custom hikashop plugin I.e. will the plugin function I have written fire just before the export runs as I expect it to?

Thanks

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
10 years 7 months ago #151488

Hi,

As Jerome said, that's not necessary as Excel should be able to handle the \r\n in the CSVs as long as you import it with the correct options in Excel.
But yes, you can use that onBeforeProductExport trigger if you want to process the data before it is displayed in the CSV. You can just modify the data in the $products array in your plugin.

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

Time to create page: 0.064 seconds
Powered by Kunena Forum