Jump to content

I have too many orders for one customer


Recommended Posts

First a little background.



I am using prestashop 1.5 as an online store, but I also make sales through other channels.

In order to manage my inventory, and sales from one place,I have been using the prestashop back office to enter each external sale, and then treating it as I would a prestashop sale.


I have one "customer" for each sales channel.

For example, sales through a local auction site called "trademe" are entered against a prestashop customer named TrademeSales, and I use the customers Trademe username as the prestashop address alias.

This saves me from having to create a separate customer account for each customer, but as many of them are repeat customers, it allows me to retain their shipping details. It is not practical to create an account per customer, firstly because it is time consuming, but more importantly, the requirement for unique email addresses.


This system has worked well for some time but now I have a problem.


The Problem


It has been taking longer and longer to load the "New Order" for my TrademeSales customer as there are close to 2k previous orders. I have started to reach the maximum time (40s) a script is allowed to run. I can't even open the customer from the customer list,  with 2k orders, nearly 900 addresses and the list of products bought.


The Questions


First question, in the short term, I would like to limit the number of previous orders that is returned to the "create new order" page. From the back office order list, I select "Add new". I then type the user name. At this point the page freezes until the list of carts, and previous orders is loaded. I figure it is this Ajax request that needs to be modified, but I don't know where to find it.


My second question is less practical and more general. Where to from here? Should I be managing my  customers and order fulfillment in a separate system? Is there a way of modifying the one account per email address rule so I can create accounts for each customer, in a separate customer group, but still allow them to create their own account later.

Any advice would be appreciated.



Link to comment
Share on other sites


Possible Temporary fix.


I have added LIMIT 10 to the end of the SQL query in


getCustomerCarts() in cart.php


getCustomerOrders() in order.php


Seems to work ok on my laptop. I have no idea what that might break though. How can I find out where else those functions are used?

Edited by NickTG (see edit history)
Link to comment
Share on other sites

  • 3 months later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Create New...