Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls

Exporting Order Items is slow with a Date Range
 
Reply
   X-Cart forums > X-Cart 4 > Changing and adding new features
 
Thread Tools Search this Thread
  #1  
Old 10-27-2016, 04:52 AM
  ecommweb's Avatar 
ecommweb ecommweb is online now
 

Advanced Member
  
Join Date: Nov 2008
Posts: 45
 

Default Exporting Order Items is slow with a Date Range

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).
Attached Files
File Type: diff xcart_include_export.diff (2.0 KB, 30 views)
__________________
www.ecommweb.co.uk
Custom X-Cart design and functions
eCommerce SEO

www.hubmaster.co.uk
Combine all your eCommerce channels in your existing website admin

+44 (0)1302 325 032
Reply With Quote
  #2  
Old 11-01-2016, 08:17 PM
  qualiteam's Avatar 
qualiteam qualiteam is offline
 

X-Guru
  
Join Date: Dec 2010
Posts: 6,373
 

Default Re: Exporting Order Items is slow with a Date Range

I've forwarded this information to the XC4 dev team.
Thank you!
__________________
Alex Solovev,
Qualiteam

---

User manual Video tutorials X-Cart FAQ

You are welcome to press "Thanks" button
if you find this post useful

Click here to learn how to apply patches

X-Cart Extensions
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Changing and adding new features


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 03:39 AM.

   

 
X-Cart forums © 2001-2018