网络营销电子商务研究中心  
How to buy the best prescription safety glasses in Canada? Let's study!
Go Back   网络营销电子商务研究中心 > 网站建设 > X-Cart
User Name
Password
 
FAQ Members List Calendar Cheap Glasses

Reply
 
Thread Tools Display Modes
  #1   IP: 112.87.93.182
Old 2015-03-31, 12:32 AM
Xenia Xenia is offline
初级会员
 
Join Date: 2005-11-05
Posts: 3
Xenia 现在声名狼藉
Default Determine X-Cart Product Sales Statistics

This mysql query can be used in phpMyAdmin or as part of a PHP script to evaluate your X-Cart product database and determine the numbers of sales a product has generated along with the first and last purchase dates.

This information can be very useful for determining which products you may want to put more marketing focus on, and those which you may want to shelve altogether.

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
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Get Your Monthly Zen Cart Sales With Just One Line of Code Quail Valley ZenCart 0 2014-07-24 09:32 AM
How to Install an Zen Cart Template topvip ZenCart 0 2009-08-23 05:35 PM
X-Cart Multiple Input Validation Holes Permit SQL Injection and Cross-Site Scripting topvip X-Cart 0 2009-07-21 10:03 AM
x-cart Template Editing Guide for 4.1.x topvip X-Cart 0 2009-04-15 11:42 PM
跟我学sql:(二) Select语句选项 topvip 建站交流 0 2009-02-12 07:42 AM

Prescription-glasses.com offers prescription glasses online at discount prices.
All times are GMT +8. The time now is 02:08 AM.


Powered by vBulletin Version 3.8.7
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.