Dirty Butter Posted September 9, 2012 Share Posted September 9, 2012 Now that I've figured out the Google Trusted Store javascript code, I had to create a scheduled shipping feed and a cancellation feed to be uploaded daily. The problem is that the date filter works correcly in v5.1.4, BUT I can't get the Status sort to work correctly. No matter what I tried, all I get is a list of the Completed Orders in the date range I specify. The Exported file also shows only the Completed Orders. I added ship_tracking to the array in sources/reports.index.inc.php line 64, so I could export all the information that the daily Google Trusted Store shipping feed requires. (That doesn't have anything to do with Sort not working, as the other store (without any Google Trusted Store code anywhere) does not have that in the array, and Sort does not work properly there, either.) All I need for the cancellation feed they require is the order ID and their code for why it was cancelled. So a quick export of Cancelled only will be easy to modify manually, IF I can get it to filter properly so I can export that report. Quote Link to comment Share on other sites More sharing options...
bsmither Posted September 9, 2012 Share Posted September 9, 2012 In the file reports.index.inc.php, at around line 22, there is this: if(!isset($_POST['report']['status']) || !isset($_GET['report']['status'])) { This part, isset($_POST['report']['status']), is true and the ! makes it false. This part, isset($_GET['report']['status']), is false and the ! makes it true. Therefore the test is true and $report_filter['status'] is hard set to array(2,3). This is not what is wanted. Suggest this test instead: if(!isset($_POST['report']['status']) && !isset($_GET['report']['status'])) { If there is no POST status and there is no GET status, then fall back on a hard coded array. Quote Link to comment Share on other sites More sharing options...
Dirty Butter Posted September 9, 2012 Author Share Posted September 9, 2012 Thanks for the help, Bsmither. Unfortunately, if(!isset($_POST['report']['status']) && !isset($_GET['report']['status'])) { sends me back to the Dashboard, no matter what choice I make from the Status choices. NOT QUITE RIGHT - when I specify a date range I get sent back to the Dashboard. If I only choose one Status without specifying date range, the report worked properly. Quote Link to comment Share on other sites More sharing options...
bsmither Posted September 9, 2012 Share Posted September 9, 2012 Please describe exactly how you entering the 'from' and 'to' dates for the Report Filter Date Range. If you manually enter something, and it is not in this specific format: ^([0-9]){4}-([0-9]){2}-([0-9]){2}$ that is, a four digit group, a dash, a two-digit group, a dash, a two digit group with nothing preceding or following those groups, then you should be bounced back to the default Reports page. (Personally, I am having some difficulties with where I should be bouncing back to. I'm trying to figure that out.) But, I am successful in asking for a report with no dates. I also get a report with just a 'from' date entered (the default 'to' is right now). Quote Link to comment Share on other sites More sharing options...
Dirty Butter Posted September 9, 2012 Author Share Posted September 9, 2012 I chose dates from the calendar, so the format should be correct. It's bouncing me back to the main Dashboard page, not back to the Reports page, when I put an End Date in. As long as I do NOT select an End Date choice in the calendar the filter works properly. Quote Link to comment Share on other sites More sharing options...
bsmither Posted September 9, 2012 Share Posted September 9, 2012 Interesting. An end date all by itself works fine for me. Switch on debugging and see if there is a POST section. Mine shows: POST: 'report' => 'date' => 'from' => '' 'to' => '2012-09-11' 'status' => '0' => '1' '1' => '2' '2' => '3' '3' => '6' 'token' => '8dcab29161a45e46fd6ece8e5d0c1fb1' Quote Link to comment Share on other sites More sharing options...
Dirty Butter Posted September 9, 2012 Author Share Posted September 9, 2012 I'm not sure what happened, but at the moment it's working, even WITH an end date! (That's WITH your change if(!isset($_POST['report']['status']) && !isset($_GET['report']['status'])) { . Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.