Customer Previous Order Statistics

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
4 anni tempo fa
Hi All,

I need to get the following customer previous order information to send to a payment gateway.  Ideally I need to grab the following customer statistics:

1. Account creation date/time
2. Total number of sales
3. Total value of sales
4. Maximum sales value
5. Total number of refunds

Can someone please point me in the right direction on this one.  Using Nop V3.90


Regards,

Paul
4 anni tempo fa
Hi!

You can use this method from Services/Orders/OrderService.cs

Use the customerId parameter to get all orders of the customer you want.


public virtual IPagedList<Order> SearchOrders(int storeId = 0,
            int vendorId = 0, int customerId = 0,
            int productId = 0, int affiliateId = 0, int warehouseId = 0,
            int billingCountryId = 0, string paymentMethodSystemName = null,
            DateTime? createdFromUtc = null, DateTime? createdToUtc = null,
            List<int> osIds = null, List<int> psIds = null, List<int> ssIds = null,
            string billingEmail = null, string billingLastName = "",
            string orderNotes = null, int pageIndex = 0, int pageSize = int.MaxValue)
4 anni tempo fa
Hi,

Much appreciated, I'll look into this one.

Regards,
Paul
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.