X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Dev Questions (https://forum.x-cart.com/forumdisplay.php?f=20)
-   -   Exporting Order Items is slow with a Date Range (https://forum.x-cart.com/showthread.php?t=74587)

ecommweb 10-27-2016 04:52 AM

Exporting Order Items is slow with a Date Range
1 Attachment(s)
We have an xcart 4.1.12 running on PHP5.6 MySQL 5.1.73 (soon to be upgraded)

In this xcart we can export all orders and all order items in one go, and it works. But if we add a date range by searching for orders and ticking export to csv (in this example, 1 year (10,000 orders)) it didn't work.

To be more specific, it exported the orders but when it got to order items it just stopped at "Exporting order items..."

So I've looked at the code and I found out why this was happening - for every loop of func_export_get_row, its executing a query to get the entire orders list for that date range which is slowing it down.

I've made some changes to include/export.php to solve this (diff is attached). With the change the page hangs for about 2 minutes on "Exporting order items..." and then continues.

I was hoping for some feedback on this change because this bit of code is still the same in xcart 4.7.6 (although it has moved to func.export.php).

qualiteam 11-01-2016 08:17 PM

Re: Exporting Order Items is slow with a Date Range
I've forwarded this information to the XC4 dev team.
Thank you!

All times are GMT -8. The time now is 09:22 PM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.