osCommerce and osCMax shopping cart software forums

Shopping Cart Software

osCommerce with teeth!

 

Product sold per Month/Year

This is a discussion on Product sold per Month/Year within the New osCommerce Contributions forums, part of the osCommerce 2.2 Forums category; Hi, I had a problem where I was always having zeros in all the results, whichever products was chosen. Added ...


Go Back   osCommerce and osCMax shopping cart software forums > osCommerce 2.2 Forums > New osCommerce Contributions

Register FAQ Members List Calendar Mark Forums Read


Free community membership! Fast easy FREE membership
Closed Thread

 

LinkBack Thread Tools
  #1  
Old 03-08-2007, 11:50 AM
michael_s's Avatar
osCMax Developer

 
Join Date: Jul 2002
Location: Phoenix, AZ
Posts: 10,329
Thanks: 68
Thanked 322 Times in 305 Posts
Rep Power: 10
michael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond repute
Post Product sold per Month/Year

Hi,

I had a problem where I was always having zeros in all the results, whichever products was chosen.

Added at the beginning of the file stats_products_per_month.php (this will get the product chosen variable when you click on Submit):

if ($HTTP_GET_VARS['prod_num']) $prod_num_chosen = tep_db_prepare_input($HTTP_GET_VARS['prod_num']);

just after:
if ($jahr_end == 0) { $jahr_end = date("Y"); }

Also changed the variable:$prod_num to be $prod_num_chosen in the line:

$products_query_raw = "select op.products_id, op.products_model, op.products_name, sum(op.products_quantity) as quantitysum , sum(op.products_price*op.products_quantity)as gross FROM " . TABLE_ORDERS . " as o, " . TABLE_ORDERS_PRODUCTS . " AS op WHERE op.products_id='$prod_num_chosen' AND o.date_purchased BETWEEN '" . $start_date . "' AND '" . $end_date . " 23:59:59' AND o.orders_id = op.orders_id GROUP BY op.products_id";

Then when I choose a product and click Submit, it shows the results.

Hope this helps,

Pierre Forget

More...
__________________
Michael Sasek
osCMax Developer


  • osCMax Templates - Hundreds of premium quality templates. New designs every month!

  • xShop for osCMax - Windows Based osCMax administration. Improved workflow, security, speed and convenience.

  • osCMax Hosting - From basic hosting to High Availability, Load Balanced arrays, the most experienced osCMax host.

  • osCMax Template Tutorial - Learn how to make your own custom templates and how to use the powerful features of the osCMax template system.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Closed Thread

Thread Tools

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
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads

Thread Thread Starter Forum Replies Last Post
Product sold per Month/Year michael_s New osCommerce Contributions 0 01-14-2007 04:00 AM
Product sold per Month/Year michael_s New osCommerce Contributions 0 01-11-2007 12:55 AM
Product sold per Month/Year michael_s New osCommerce Contributions 0 01-09-2007 05:46 PM
Extra Box on Top of New Product of the Month jimmyliu osCommerce 2.2 Modification Help 0 04-14-2005 05:23 AM
Paid Subscription Product Type (1 day, 1 wk, 1 mo, 1 year) author20 osCommerce 2.2 Modification Help 0 02-24-2003 04:43 AM


All times are GMT -8. The time now is 06:34 PM.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO
http://www.oscmax.com/forums/
Copyright 2008 osCMax