Guest Posted May 16, 2004 Share Posted May 16, 2004 When I want to sort on manufactures I am getting page not found. Wheren can I fix this? Quote Link to comment Share on other sites More sharing options...
masat Posted May 16, 2004 Share Posted May 16, 2004 Hey thanks for bringing this up. I have never sorted before so I had not noticed it not working. After I read your post I went to take a look and sure enough, when I use the drop down sort box I got a page not found. So I fixed it. Place this line in admin/includes.filenames.php define('FILENAME_MARGIN_REPORT', 'margin_report.php'); If my problem is the same as yours that should fix you up. Tim Fortune Quote How do you know when you know what you want to do for the rest of your life? Link to comment Share on other sites More sharing options...
Guest Posted May 16, 2004 Share Posted May 16, 2004 It isn't that, its in fimenames, I have got the same problem with making a csv file Quote Link to comment Share on other sites More sharing options...
masat Posted May 16, 2004 Share Posted May 16, 2004 Sorry I made a typo up above. The file is in admin/includes/filenames.php When you sort in margin report or export the CSV file the script margin_report.php is calling helper script within the same file so there is absolutly noway the file could be missing. Now take a look at the install instructions and the margin_report.php script and you will see why this occurs. In boxes reports.php the script calls the file like so: '<a href="' . tep_href_link(FILENAME_STATS_MARGIN_REPORT, '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_REPORTS_MARGIN_REPORT . '</a><br>' . and the install instructions, at the end say to put this line into filenames.php like so: /includes/filenames.php Add: // Cost Module v1.11 define('FILENAME_STATS_MARGIN_REPORT', 'margin_report.php'); Now if you look at the script margin_report.php around line 525 you will clearly see they call the export button script as such: tep_draw_form('export_to_file', FILENAME_MARGIN_REPORT, 'get', '') . but if you followed the installation the call named FILENAME_MARGIN_REPORT was never defined in the filenames.php. The install said to define it as: define('FILENAME_STATS_MARGIN_REPORT', 'margin_report.php'); see the difference. This has to be your problem. Open admin/includes/filenames.php and insert this line: define('FILENAME_MARGIN_REPORT', 'margin_report.php'); and it will work. You must define margin_report both ways: 'FILENAME_MARGIN_REPORT', 'margin_report.php'); 'FILENAME_STATS_MARGIN_REPORT', 'margin_report.php'); or change the script margin_report.php Tim Fortune Quote How do you know when you know what you want to do for the rest of your life? Link to comment Share on other sites More sharing options...
Guest Posted May 16, 2004 Share Posted May 16, 2004 So far so good but ik still can't select maufatures and when it want to create a fiel its returning: "Please enter a valid filename and check your location. " Quote Link to comment Share on other sites More sharing options...
safoo Posted May 16, 2004 Share Posted May 16, 2004 (edited) Yes...there were some install errors in the contribution. Also, to have your export work properly, you need to go into the marging_report.php file and change the $Base_folder to where you want the file to save into. Edited May 16, 2004 by safoo Quote Link to comment Share on other sites More sharing options...
Guest Posted May 16, 2004 Share Posted May 16, 2004 Here is a part of margin_report about the csv file: // Please change this to the folder you want to use. // If you are using Windows, you must use \\ instead of \. $Base_folder = "C:\\inkoop"; ////////////////////////////////////////////////////////////// $filename = $Base_folder . $HTTP_GET_VARS['file']; $file = fopen($filename, 'inkoop'); fwrite($file, $csv); fclose($file); echo 'Your exported csv file has been saved at: ' . $filename; } else { echo 'Please enter a valid filename and check your location.'; Quote Link to comment Share on other sites More sharing options...
Guest Posted May 16, 2004 Share Posted May 16, 2004 safoo: I got this option right on top Quote Link to comment Share on other sites More sharing options...
safoo Posted May 16, 2004 Share Posted May 16, 2004 (edited) Misa, To fix the problem of the error when selecting a manufacturer, go into admin/margin_report.php around line 291, find the code: tep_draw_form('filter', 'margin_report', '', 'get') and change to tep_draw_form('filter', 'margin_report.php', '', 'get') Edited May 16, 2004 by safoo Quote Link to comment Share on other sites More sharing options...
Guest Posted May 16, 2004 Share Posted May 16, 2004 Ok Safoo.....................that did it thank you very much. No still have to fix to make a csv file without getting the error: Please enter a valid filename and check your location. Quote Link to comment Share on other sites More sharing options...
safoo Posted May 16, 2004 Share Posted May 16, 2004 read what I wrote above. You need to change the variable to the folder that you want to save it into. Note that you will have to include the complete root directory path to the folder. Quote Link to comment Share on other sites More sharing options...
masat Posted May 16, 2004 Share Posted May 16, 2004 I copied and pasted your code into my file created a directory on my c drive called inkoop hit the export button and typed in inkoop.csv and the script successfully generarted my margin report and downloaded it to c://inkoop/inkoop.csv So if you are still having problems that section of code is not the problem Tim Fortune Quote How do you know when you know what you want to do for the rest of your life? Link to comment Share on other sites More sharing options...
masat Posted May 16, 2004 Share Posted May 16, 2004 oops sorry It downloaded to c:\\inkoop\inkoop.csv I often typo / and \ Tim Quote How do you know when you know what you want to do for the rest of your life? Link to comment Share on other sites More sharing options...
masat Posted May 16, 2004 Share Posted May 16, 2004 I have to make another small apology. After reading the post by safoo I recall a long while back fixing my script to reflect the file name issue and while I was in there I changed it to be defined in filenames .php hence the post I made above. Evidently I changed the original contrib file I downloaded also and I normally don't do this so I always have an original script. My most humble apologies to all. Maybe it's time to throw in the towel for the day. My typing is terrible and my questions are not getting answered. I have learned a few things today so all is not in shame. Tim Fortune Quote How do you know when you know what you want to do for the rest of your life? Link to comment Share on other sites More sharing options...
Guest Posted May 16, 2004 Share Posted May 16, 2004 Still got the csv problem.............. I created in C: a new director y called inkoop but still got the error Quote Link to comment Share on other sites More sharing options...
safoo Posted May 16, 2004 Share Posted May 16, 2004 (edited) Tim, It works for you because your OSC is hoted on a local machine. For those of us that have our OSC on remote servers (99% of the users), they will need to specify the download folder using the variable $Base_folder in margin_report.php. Still, this is a very useful report and I never even saw it before the update that was posted in the contributions section today. It will help me a lot on my site. Edited May 16, 2004 by safoo Quote Link to comment Share on other sites More sharing options...
Guest Posted May 16, 2004 Share Posted May 16, 2004 It sure is a good contibution. This is now what I got in my margin_report.php $Base_folder = "C:\\inkoop"; Do I have to put more in front or after the C:\\ ? Quote Link to comment Share on other sites More sharing options...
Guest Posted May 16, 2004 Share Posted May 16, 2004 Maybe this is saying anything more: Warning: fopen(C:\inkoop): failed to open stream: No such file or directory in /home/bruinenfit.nl/public_html/www.bruinenfit.nl/admin/margin_report.php on line 245 Warning: fwrite(): supplied argument is not a valid stream resource in /home/bruinenfit.nl/public_html/www.bruinenfit.nl/admin/margin_report.php on line 246 Warning: fclose(): supplied argument is not a valid stream resource in /home/bruinenfit.nl/public_html/www.bruinenfit.nl/admin/margin_report.php on line 247 Quote Link to comment Share on other sites More sharing options...
masat Posted May 16, 2004 Share Posted May 16, 2004 Well I think we have a functional solution I created a directory under admin called log and chmod 777 I changed $Base_folder = "log/"; and got rid of the errors and the file backed up to admin/log/ I am not happy with this though. I think it should be downloaded to my local machine. How can this be fixed? I tried several methods of defineing that $Base_folder Tim Quote How do you know when you know what you want to do for the rest of your life? Link to comment Share on other sites More sharing options...
blueline Posted May 16, 2004 Share Posted May 16, 2004 Hey all. I wrote the contribution....sorry about the inconsistency within the code and defined filenames. -Chris P.S. I am thinking about expanding the functionality of this contribution to allow reports to be made based on daily, weekly, monthly, quarterly, and annual sales. Anybody interested? Quote Chris Sullivan Link to comment Share on other sites More sharing options...
Guest Posted May 16, 2004 Share Posted May 16, 2004 Chris, Do you have a solution for my problem wrote before? Quote Link to comment Share on other sites More sharing options...
masat Posted May 16, 2004 Share Posted May 16, 2004 Hi Chris, As you can see we have been battling with this thing all morning and have resolved several issues. I just came across your original thread and posted there. We are not able to download to our local machines from the web. My store and the contrib work great on my local server but trying to download from the web fails. Could you bail us out? Thanks, Tim Quote How do you know when you know what you want to do for the rest of your life? Link to comment Share on other sites More sharing options...
masat Posted May 16, 2004 Share Posted May 16, 2004 Chris I think the added functionality would work well and allow for easier analysis of the numbers. I really liked that idea that was posted back in the original support thread about being able to plug a number into any one of the spots and have osc generate the other numbers for you. I have talked with alot of people that seem to have no concept of profit/loss, margin, markup, discount. This was the main reason I jumped on this contrib the minute I came across it. Very nice job indeed. The store owners I have built stores for really appreciate having that module available. I think it is one of the most impressive modules in the admin panel. To be able to see that info at a glance is very very cool and can be a real butt saver if you happen to make a typo and don't catch it. Your module kind of waves a flag and says "Hello we have a problem here Houston". Speaking of that maybe you could add in a color coded marker if a product is set belowa certain margin that can be defined in admin. Tim Quote How do you know when you know what you want to do for the rest of your life? Link to comment Share on other sites More sharing options...
blueline Posted May 17, 2004 Share Posted May 17, 2004 Glad everyone likes it. Tim, I'll look into that. As for the problems...I'll look into those too. Thanks, Quote Chris Sullivan Link to comment Share on other sites More sharing options...
safoo Posted May 18, 2004 Share Posted May 18, 2004 blueline, the added functionality would be great if you could tie them into sales since right now it just deals with the margins of particular products. Still, the report is very practical. masat, you can't have it directly download to your local machine since the server is remote. The way it works is to create a file on your remote server which you can then download and save to your local machine. As I mentioned earlier, you will need to go into the file and change the path from C:\ to the directory on your machine. If then you get errors about not being able to open or write to the files, try changing the chmod of the directory folder you specified. 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.