Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

Custom Sales Reports by Product (item total and by qty)

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions
 
Thread Tools Search this Thread
  #11  
Old 04-23-2004, 08:41 AM
  abeight's Avatar 
abeight abeight is offline
 

X-Adept
  
Join Date: Nov 2003
Location: Cleveland, OH
Posts: 479
 

Default

The link above won't work anymore since I deleted the file and moved it to a password protected area. I took lines 2-5 out, but still get the same error:

Code:
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /home/bizplate/public_html/admin/report.php on line 2 Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /home/bizplate/public_html/admin/report.php on line 2 Parse error: parse error in /home/bizplate/public_html/admin/report.php on line 2
__________________
~ Andrea Beight
Reply With Quote
  #12  
Old 04-23-2004, 09:00 AM
 
jeremye jeremye is offline
 

Senior Member
  
Join Date: Apr 2004
Location: Philadelphia, PA
Posts: 158
 

Default

Try replacing the first line with this (add just php)

Code:
<?php

I think it's a PHP setting with your server. We'll work it out...
__________________
Jeremy
X-Cart Gold v3.4.14 [Linux/Apache]
Heavily Modded
Reply With Quote
  #13  
Old 04-23-2004, 09:09 AM
 
jeremye jeremye is offline
 

Senior Member
  
Join Date: Apr 2004
Location: Philadelphia, PA
Posts: 158
 

Default

Quote:
Originally Posted by abeight
I took lines 2-5 out, but still get the same error

Anyone else want to chime in if you've seen this error before? I can only find these two links on PHP bugs, but can't really think up a solution:

http://bugs.php.net/bug.php?id=5387
http://bugs.php.net/bug.php?id=5448
__________________
Jeremy
X-Cart Gold v3.4.14 [Linux/Apache]
Heavily Modded
Reply With Quote
  #14  
Old 04-23-2004, 09:22 AM
  abeight's Avatar 
abeight abeight is offline
 

X-Adept
  
Join Date: Nov 2003
Location: Cleveland, OH
Posts: 479
 

Default

LOL... well that was a step in the right direction. Now I only get the bottom two lines of the error. Thanks for trying to figure it out. Don't kill youself over it though.
__________________
~ Andrea Beight
Reply With Quote
  #15  
Old 04-23-2004, 09:25 AM
 
jeremye jeremye is offline
 

Senior Member
  
Join Date: Apr 2004
Location: Philadelphia, PA
Posts: 158
 

Default

Try doing a search and replace:

Find "<?"
Replace with "<?php"

See if that does anything.
__________________
Jeremy
X-Cart Gold v3.4.14 [Linux/Apache]
Heavily Modded
Reply With Quote
  #16  
Old 04-23-2004, 11:16 AM
 
jeremye jeremye is offline
 

Senior Member
  
Join Date: Apr 2004
Location: Philadelphia, PA
Posts: 158
 

Default

I did some more reading and it may be that 'magic_quotes_gpc' it turned OFF in your PHP settings. Let me know if you need help finding out how to check this.
__________________
Jeremy
X-Cart Gold v3.4.14 [Linux/Apache]
Heavily Modded
Reply With Quote
  #17  
Old 04-27-2004, 07:39 AM
 
rivermarinesupply rivermarinesupply is offline
 

Advanced Member
  
Join Date: Nov 2003
Posts: 65
 

Default

This picks up failed attempts as well, (which in my case really skews the order qty) is there anyway to have it only accept processed orders?

Thanks,
Eduardo.
Reply With Quote
  #18  
Old 04-27-2004, 08:39 AM
 
jeremye jeremye is offline
 

Senior Member
  
Join Date: Apr 2004
Location: Philadelphia, PA
Posts: 158
 

Default

This can easily be accomplished by adding a few qualifying statements to the SQL query on Line 110 (or thereabouts): Delete the line where it starts with "$sql = "SELECT tblproducts..." and replace it with the following:

Code:
$sql = "SELECT tblproducts.product, tbldetails.productid, SUM(tbldetails.price*tbldetails.amount) AS total, SUM(tbldetails.amount) AS qty_purchased FROM xcart_order_details AS tbldetails, xcart_products AS tblproducts, xcart_orders AS tblorders WHERE tblproducts.productid=tbldetails.productid AND tbldetails.orderid=tblorders.orderid AND tblorders.date >= $start_date AND tblorders.date <= $end_date AND tblorders.status = 'C' OR tblorders.status = 'P' GROUP BY tbldetails.productid ORDER BY $report_type desc";

Notice that I added two statements:
Code:
AND tblorders.status = 'C' OR tblorders.status = 'P'

This makes sure it only counts orders that are Complete or Processed.

I have tested it on my side and it works fine. Let me know if this helps or not.
__________________
Jeremy
X-Cart Gold v3.4.14 [Linux/Apache]
Heavily Modded
Reply With Quote
  #19  
Old 04-27-2004, 08:43 AM
 
jeremye jeremye is offline
 

Senior Member
  
Join Date: Apr 2004
Location: Philadelphia, PA
Posts: 158
 

Default

I forgot to mention another nice feature of this report. If you noticed, the X-Cart pre-packaged orders reports shows the total gross/paid amounts for the order date range you selected. Unfortunately, it adds shipping costs as well, so you are truly not generating the amount of revenue that x-cart claims you are. This report ONLY takes into account the product prices, not shipping, so you may notice a difference between this report and the reports that x-cart generates (this statement is valid up to version 3.4.14).

Just an FYI.
__________________
Jeremy
X-Cart Gold v3.4.14 [Linux/Apache]
Heavily Modded
Reply With Quote
  #20  
Old 05-03-2004, 10:31 AM
 
deniz deniz is offline
 

Advanced Member
  
Join Date: Sep 2003
Posts: 70
 

Default

Quote:
Originally Posted by jeremye
This can easily be accomplished by adding a few qualifying statements to the SQL query on Line 110 (or thereabouts): Delete the line where it starts with "$sql = "SELECT tblproducts..." and replace it with the following:

Code:
$sql = "SELECT tblproducts.product, tbldetails.productid, SUM(tbldetails.price*tbldetails.amount) AS total, SUM(tbldetails.amount) AS qty_purchased FROM xcart_order_details AS tbldetails, xcart_products AS tblproducts, xcart_orders AS tblorders WHERE tblproducts.productid=tbldetails.productid AND tbldetails.orderid=tblorders.orderid AND tblorders.date >= $start_date AND tblorders.date <= $end_date AND tblorders.status = 'C' OR tblorders.status = 'P' GROUP BY tbldetails.productid ORDER BY $report_type desc";

Notice that I added two statements:
Code:
AND tblorders.status = 'C' OR tblorders.status = 'P'

This makes sure it only counts orders that are Complete or Processed.

I have tested it on my side and it works fine. Let me know if this helps or not.

I am using 3.3.3 and the second sql didnot work. any help idea?
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions



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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 11:50 AM.

   

 
X-Cart forums © 2001-2020