blueline Posted October 16, 2003 Share Posted October 16, 2003 Working hard for you guys. Trying to put out all the modules which I think are helpful. Let me know what you think. This is a module that will allow you to see a full report on the margin of all of your products. You now enter the cost of the good (in the admin) when you are entering or editing products. From there this report allows you to sort out your products, in the report, by Product name, cost, price, specials price, margin dollars, and margin percentage. Hope you like it. -Chris http://www.oscommerce.com/community/contributions,1594 Quote Chris Sullivan Link to comment Share on other sites More sharing options...
blueline Posted October 16, 2003 Author Share Posted October 16, 2003 Wow...nobody? I figured this would be helpful for EVERYONE. Quote Chris Sullivan Link to comment Share on other sites More sharing options...
wizardsandwars Posted October 16, 2003 Share Posted October 16, 2003 I've added it my 'to do list' for our website. It's currently number 3612. Quote ------------------------------------------------------------------------------------------------------------------------- NOTE: As of Oct 2006, I'm not as active in this forum as I used to be, but I still work with osC quite a bit. If you have a question about any of my posts here, your best bet is to contact me though either Email or PM in my profile, and I'll be happy to help. Link to comment Share on other sites More sharing options...
Priest Posted October 16, 2003 Share Posted October 16, 2003 Do you possible have a demo for this? ~Priest~ Quote Link to comment Share on other sites More sharing options...
blueline Posted October 16, 2003 Author Share Posted October 16, 2003 I will put up a demo tongiht. The nice thing is that it is a VERY EASY install. Quote Chris Sullivan Link to comment Share on other sites More sharing options...
blueline Posted October 17, 2003 Author Share Posted October 17, 2003 Here is a screenshot. Doesn't look as profound with a cost of $0.00 for everything, but it will be beneficial for those who take the time to populate the cost of their products. Let me know what you guys think -Chris Quote Chris Sullivan Link to comment Share on other sites More sharing options...
bulkryan Posted October 17, 2003 Share Posted October 17, 2003 Looks cool! I will give it a try thanks! Quote Link to comment Share on other sites More sharing options...
mugitty Posted October 17, 2003 Share Posted October 17, 2003 Chris; This looks like a nice additional feature to have, but a couple of questions: Does anything in the add products page get affected other than just adding a field to enter the cost? (I've got a TON of contributions and custom changes in effect that touch that file) Does it have a page split feature, search, dropdown box to select a given category, total (average) lines by whole store, category, sub-category? I'm not being critical, just trying to anticipate the types of features that would make it easier to use. Quote ... if you want to REALLY see something that doesn't set up right out of the box without some tweaking, try being a Foster Parent! Link to comment Share on other sites More sharing options...
bulkryan Posted October 17, 2003 Share Posted October 17, 2003 Got it installed and it looks great! I have over 1,500 products so it will take time to get all the costs in. 1 suggestions if I may: This mod would be much better if you could sort by category. When dealing with allot of products it is hard to find a few of the samples I did. Quote Link to comment Share on other sites More sharing options...
blueline Posted October 17, 2003 Author Share Posted October 17, 2003 I am willing to add new features as you guys decide you want them. Post your ideas and I will put them to work. Glad you like it. -Chris Quote Chris Sullivan Link to comment Share on other sites More sharing options...
Guest Posted October 17, 2003 Share Posted October 17, 2003 (edited) I've made my own version of this a couple of weeks ago, basicly the same thing , the only difference is in mine you can enter a cost, then a margin and it automaticly figures out price, or you can enter price and cost and it will automaticly calculate margin. If your interested in incorperating something like this for another realease or something, let me know and I'll send it to ya. Edited October 17, 2003 by Anacrusis Quote Link to comment Share on other sites More sharing options...
TaFfin Posted October 17, 2003 Share Posted October 17, 2003 Cool contribution Chris, works fine here. But since you asked for it, maybe it's nice to put totals in the margin_report.php. Regards, TaFfin Quote SIGnificant.....right? Link to comment Share on other sites More sharing options...
Guest Posted October 17, 2003 Share Posted October 17, 2003 (edited) Excellent mod. One think I'd like to see are some filters on the report. Things like Top XX Items by margin, Bottom XX items, Items between specified margin range, items added within a data range, items in specific category/sub-category, etc... Maybe an option to export to csv. Also make it so the item name is a link to the edit page. How's that for ideas? :) Again... great mod, I was looking for something like this for a while. Edited October 17, 2003 by Anacrusis Quote Link to comment Share on other sites More sharing options...
blueline Posted October 17, 2003 Author Share Posted October 17, 2003 Excellent mod. One think I'd like to see are some filters on the report. Things like Top XX Items by margin, Bottom XX items, Items between specified margin range, items added within a data range, items in specific category/sub-category, etc... Maybe an option to export to csv. Also make it so the item name is a link to the edit page. How's that for ideas? :) Again... great mod, I was looking for something like this for a while. Thanks for the kind words. As far as the top XX items, and bottom XX items, you can simply do that by sorting the products in ascending/descending order based on your request (margin dollars, %, cost, price, specials price, or name). The link - DONE. Selecting by Manufacturer - DONE. *Category by Manufacturer - DONE. The CSV option - I will do it. I will upload the new version after I get the CSV export set up. -Chris TaFfin - What totals are you talking about? Quote Chris Sullivan Link to comment Share on other sites More sharing options...
Guest Posted October 17, 2003 Share Posted October 17, 2003 Nice! I know that you will have a few more options to this module soon! Thanks - Good Job Justin Quote Link to comment Share on other sites More sharing options...
Guest Posted October 18, 2003 Share Posted October 18, 2003 nice mod needs some twaeking if you have other mods installed that use the categories.php I have the following mods installed header tags WYSIWYG 1.7 i added the cost control and get the NaN in the Products Price (Gross) field hunting down the problem now will post when i find the problem Quote Link to comment Share on other sites More sharing options...
helen Posted October 18, 2003 Share Posted October 18, 2003 Hey Chris, great mod! I am having a problem, however, with the Product's Cost -- I enter the cost of the product, but as soon as I preview and update, the cost goes to $0.00. I am trying to work around the WYSIWYG 1.7 and the Monthly Sales report mods. I noticed when I was changing the admin/categories.php file that I was missing or had already changed some of the pieces that I was supposed to replace, namely: } elseif ($HTTP_POST_VARS['copy_as'] == 'duplicate') { $product_query = tep_db_query("select products_quantity, products_model, products_image, products_price, products_date_available, products_weight, products_tax_class_id, manufacturers_id from " . TABLE_PRODUCTS . " where products_id = '" . (int)$products_id . "'"); $product = tep_db_fetch_array($product_query); tep_db_query("insert into " . TABLE_PRODUCTS . " (products_quantity, products_model,products_image, products_price, products_date_added, products_date_available, products_weight, products_status, products_tax_class_id, manufacturers_id) values ('" . tep_db_input($product['products_quantity']) . "', '" . tep_db_input($product['products_model']) . "', '" . tep_db_input($product['products_image']) . "', '" . tep_db_input($product['products_price']) . "', now(), '" . tep_db_input($product['products_date_available']) . "', '" . tep_db_input($product['products_weight']) . "', '0', '" . (int)$product['products_tax_class_id'] . "', '" . (int)$product['manufacturers_id'] . "')"); $dup_products_id = tep_db_insert_id(); and if ($action == 'new_product') { $parameters = array('products_name' => '', 'products_description' => '', 'products_url' => '', 'products_id' => '', 'products_quantity' => '', 'products_model' => '', 'products_image' => '', 'products_price' => '', and } elseif ($HTTP_POST_VARS['copy_as'] == 'duplicate') { $product_query = tep_db_query("select products_quantity, products_model, products_image, products_price, products_date_available, products_weight, products_tax_class_id, manufacturers_id from " . TABLE_PRODUCTS . " where products_id = '" . (int)$products_id . "'"); $product = tep_db_fetch_array($product_query); tep_db_query("insert into " . TABLE_PRODUCTS . " (products_quantity, products_model,products_image, products_price, products_date_added, products_date_available, products_weight, products_status, products_tax_class_id, manufacturers_id) values ('" . tep_db_input($product['products_quantity']) . "', '" . tep_db_input($product['products_model']) . "', '" . tep_db_input($product['products_image']) . "', '" . tep_db_input($product['products_price']) . "', now(), '" . tep_db_input($product['products_date_available']) . "', '" . tep_db_input($product['products_weight']) . "', '0', '" . (int)$product['products_tax_class_id'] . "', '" . (int)$product['manufacturers_id'] . "')"); $dup_products_id = tep_db_insert_id(); I'd be happy to send my categories.php file to you if that will help. Is this just too many mods to try to get to work together? I am also having trouble with "NaN" in the Products Price (Gross) field. Thanks again for this great mod, Chris! Quote Link to comment Share on other sites More sharing options...
Proetorian Posted October 19, 2003 Share Posted October 19, 2003 (edited) To fix the NaN problem in the Gross Price box, replace: ? ? ? ? ?<tr bgcolor="#ebebff"> <td class="main"><?php echo TEXT_PRODUCTS_PRICE_COST; ?></td> <td class="main"><?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . ' ' . tep_draw_input_field('products_price', $pInfo->products_cost, ''); ?></td> ? ? ? ? ?</tr> with: ? ? ? ? ?<tr bgcolor="#ebebff"> <td class="main"><?php echo TEXT_PRODUCTS_PRICE_COST; ?></td> <td class="main"><?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . ' ' . tep_draw_input_field('products_cost', $pInfo->products_cost, ''); ?></td> ? ? ? ? ?</tr> All you are changing is the products_price input field to products_cost Edited October 19, 2003 by Proetorian Quote Link to comment Share on other sites More sharing options...
helen Posted October 19, 2003 Share Posted October 19, 2003 Thanks, Proetorian! That fixed the "NaN" problem and the problem I was having with cost not updating, now it's working great! Thanks Chris and Proetorian! Helen Quote Link to comment Share on other sites More sharing options...
Guest Posted October 19, 2003 Share Posted October 19, 2003 thank you for the fix on NaN problem Quote Link to comment Share on other sites More sharing options...
blueline Posted October 19, 2003 Author Share Posted October 19, 2003 http://www.oscommerce.com/community/contributions,1594 V1.10 is released. -Chris Quote Chris Sullivan Link to comment Share on other sites More sharing options...
helen Posted October 19, 2003 Share Posted October 19, 2003 Thanks Chris, looks great. In order to upgrade, do I need to make any changes other than replacing admin/margin_report.php and admin/includes/languages/english/margin_report.php? Quote Link to comment Share on other sites More sharing options...
blueline Posted October 19, 2003 Author Share Posted October 19, 2003 No....only those 2 files need to be changed. Quote Chris Sullivan Link to comment Share on other sites More sharing options...
helen Posted October 19, 2003 Share Posted October 19, 2003 Thanks, Chris. It looks like in admin/margin_report.php you have FILENAME_MARGIN_REPORT instead of FILENAME_STATS_MARGIN_REPORT for all instances in this file. I'm also getting some errors: Warning: fopen("C:\margin-report.csv", "w") - Permission denied in /home/httpd/vhosts/mysite.com/httpdocs/catalog/admin/margin_report.php on line 245 Warning: fwrite(): supplied argument is not a valid File-Handle resource in /home/httpd/vhosts/mysite.com/httpdocs/catalog/admin/margin_report.php on line 246 Warning: fclose(): supplied argument is not a valid File-Handle resource in /home/httpd/vhosts/mysite.com/httpdocs/catalog/admin/margin_report.php on line 247 Your exported csv file has been saved at: C:\margin-report.csv The file also isn't saving. Thanks! Quote Link to comment Share on other sites More sharing options...
blueline Posted October 19, 2003 Author Share Posted October 19, 2003 helen- try changing the 'w' to 'r+' Let me know. Quote Chris Sullivan 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.