![]() |
Do you have register_globals turned on in your version of PHP? It looks like the variables that are being POSTed are not working, which makes it seem as if register_globals is not allowing the PHP vars to be automatically assigned.
Can you confirm if register_globals is on (check your phpinfo() file)? |
Going on a hunch that your problem is with register_globals, try adding this code to the top of your php file:
Code:
/* Assign variables if register_globals = OFF */ This will assign all the variables from the _POST array. Let me know if this works. |
For those of you using 3.4.14 and below, I added a few snippets of code to keep the page secure, meaning you have to be logged in to the admin area to view the report. My concern was that AS IS, the file has no security measures.
To secure your report, save the file to your [xcart]/admin/ directory. Next go into your PHP file and add the following lines to the very top: Code:
/* Added require fields so that you must be logged in to view sales reports */ I know this works for my version of xcart, others may need to just look at another file in your /admin/ directory and see what include files they are requiring at the top of each page. In order to access this, you must be logged into your admin area. Then you can copy/paste the URL, or create a special link in your admin area. Hope this helps some of you. |
I know, I know, I wrote this MOD but I am having an issue with the speediness of my SQL query used for gathering product/order data across multiple tables. Here is my SQL query for sales reports between Aug 1 and Aug 3 (real small timespan):
Code:
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 >= 1091332800 AND tblorders.date <= 1091591999 AND tblorders.status = 'C' OR tblorders.status = 'P' GROUP BY tbldetails.productid ORDER BY total desc The problem is that if I am running a sales report for a whole month or a few months, it runs SUPER slow. Any ideas on how I can optimize this query to make it run a lot faster? Thanks! |
Reporting
Hi,
Just thought to let you all know, I created reporting, that sits in the Admin Area, and produces reports based on what you want. Totals taxes, shipping, you can hide or display any field, use it as a shipping list for completed orders.... It was developed for 3.5.x, but I think it should work for 3.4.x. Have not updated it or tested with version 4.x yet. Take a look, I have some sample images at http://www.x-cart-plus.com/au/xcart/customer/product.php?productid=6&cat=0&page= :) |
I've had some requests for updates to this script (which hasn't been updated in quite some time). I made modifications to allow for the admin to choose what order status values the report should include. Note the new "Order Status" dropdown at the top. Here's the code, let me know if you have any questions:
Code:
<? |
The new code below adds the ability to show the Product Code (SKU #) as an option. It is disabled by default; to enable it find where $show_sku = false; and change to true.
Code:
<? |
This looks like a great mod, just a quick question
1) which folder would I put this into? I have currently put it in the admin folder, but it always redirects me to the admin home page ? Thanks |
You need to put it in the [xcart]/admin/ directory. Make sure you put the following code at the top:
Code:
require "../smarty.php"; The reason it redirects you to the admin login page is because you don't have admin authentication, most likely. Let me know if that works. |
wow thanks for the fast reply...
unfortunately - i'm still getting that error even when I put it in the admin folder... It just redirects me to the home page of the admin site (not the login page, but the page after I log in) any ideas? |
All times are GMT -8. The time now is 07:09 PM. |
Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.