View Single Post
  #9  
Old 12-01-2012, 06:50 AM
 
anandat anandat is offline
 

X-Adept
  
Join Date: Jan 2004
Posts: 914
 

Thumbs up Re: Order totals Statistics

Just put below code in phpmyadmin query window & it will display you stats for sales by products. very nice to see which are most sold products in your site.

Code:
SELECT p.productid, p.product, COUNT( od.orderid ) AS sales, FROM_UNIXTIME( MIN( o.date ) , '%Y %M %e' ) AS first_order, FROM_UNIXTIME( MAX( o.date ) , '%Y %M %e' ) AS last_order FROM xcart_products AS p LEFT JOIN xcart_order_details AS od ON p.productid = od.productid LEFT JOIN xcart_orders AS o ON o.orderid = od.orderid WHERE p.forsale = 'Y' GROUP BY od.productid ORDER BY sales DESC , p.productid DESC

credit to above code goes to Jon from webistecm http://www.websitecm.com/x-cart-tutorials/x-cart-code-snippets/determine-x-cart-product-sales-statistics/
__________________
X-Cart: 4.7.7 LIVE
Skin:Ultra by xcartmods.co.uk
X-cart Modules: | ACR, Rich Google Search, Customer Testimonials | Cloud Search, | Websitecm: CDSEO (2.1.9)
---------------
Server: Linux
php: 5.3
mysql: 5.0.89
----------------
Reply With Quote