Skills on Display Orders of Zen-Cart.
April 3rd, 2012 — adminEspecially at the end of every month, we need to know how many orders we have. Here are 2 method you may like when you use Zen-Cart.
First, if you need to know certain latest new orders, say 2000, how to do then, you can use the following mysql command:
SELECT * FROM `orders` order by orders_id desc limit 0,2000; //show latest orders;
Second is we can use the following mysql code to show all the products with a month, say display all products within March, 2012:
SELECT date_purchased, SUM(order_total) FROM `orders` where date_purchased between “2012-03-01″ and “2012-03-30″;
If we need to know all orders in a year, say 2011, how to then? Simple:
SELECT date_purchased, SUM(order_total) FROM `orders` where date_purchased between “2011-01-01″ and “2011-12-31″;
Here we can use SUM(order_total) to caculate total value within a period.