WebsiteBaker Community Forum

WebsiteBaker Support (2.8.x) => Bakery Shop => Topic started by: workflor on June 15, 2010, 10:07:31 AM

Title: Order Stats for Backery
Post by: workflor on June 15, 2010, 10:07:31 AM
Hi,

i yust thought about a little problem. i need a small order stat, that means, i need a list of all products and the numbers of orders. i need a count for a year and for a month (i want so select). i think a simple PHP-Script for CODe-Page is a soulition.

greetz
Title: Re: Order Stats for Backery
Post by: workflor on June 15, 2010, 11:44:18 AM
ok ... the statement for php

$sql = 'SELECT sku , SUM( quantity ) , order_date FROM wb_altadel_mod_bake ry_order WHERE EXTRACT( MONTH FROM order_date ) = $month AND EXTRACT( YEAR FROM order_date ) = $year GROUP BY sku LIMIT 0, 30 ; ';

it is the statement but i dont know the rest for an form ... can someone help?