Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Product cost? Is there an easy way?


wlsnoops

Recommended Posts

Hello,

I am using Oscommerce 2.3.3.4.

 

As I was adding products to my store today, I suddenly realized there is no field in admin/categories/products for the actual cost of an item.

 

I would like to know at a glance what I last paid for the items so that profit margins can be maintained.

 

Is there an easy way to do this or at least a workaround?

 

Thanks.

Link to comment
Share on other sites

yes there is: http://addons.oscommerce.com/info/6242

 

Its a 2.2 mod but it works fine on 2.3.3.4

Edited by Mort-lemur

Now running on a fully modded, Mobile Friendly 2.3.4 Store with the Excellent MTS installed - See my profile for the mods installed ..... So much thanks for all the help given along the way by forum members.

Link to comment
Share on other sites

in fact here is a screenshot of what it adds to the product entry page:

Now running on a fully modded, Mobile Friendly 2.3.4 Store with the Excellent MTS installed - See my profile for the mods installed ..... So much thanks for all the help given along the way by forum members.

Link to comment
Share on other sites

http://addons.oscommerce.com/info/8147

 

margin report - works nicely on my 2.3.3.4

I've installed this add-on and it does give me a margin report. There is one slight problem, though. When I go to the admin section, there are now two separate "Reports" boxes in the left column. The first one has the margin report in it, but the second one does not. How can I remove the second one that does not have the margin report in it?

 

I tried to retrace my steps, but haven't found anything duplicated.

 

I have some screenshots, but I don't know how to post them here.

 

Thanks.

Link to comment
Share on other sites

I would supect you have added an extra "box" by adding code to

 

\admin\includes\column_left.php

 

This will refer to a file in

 

\admin\includes\boxes\...

 

The file that shows the standard reports is

 

\admin\includes\boxes\reports.php

 

You shoulkd be able to remove the code for the extra box from \admin\includes\column_left.php and merge the code for the box contents.

 

HTH

 

G

Need help installing add ons/contributions, cleaning a hacked site or a bespoke development, check my profile

 

Virus Threat Scanner

My Contributions

Basic install answers.

Click here for Contributions / Add Ons.

UK your site.

Site Move.

Basic design info.

 

For links mentioned in old answers that are no longer here follow this link Useful Threads.

 

If this post was useful, click the Like This button over there ======>>>>>.

Link to comment
Share on other sites

I would supect you have added an extra "box" by adding code to

 

\admin\includes\column_left.php

 

This will refer to a file in

 

\admin\includes\boxes\...

 

The file that shows the standard reports is

 

\admin\includes\boxes\reports.php

 

You shoulkd be able to remove the code for the extra box from \admin\includes\column_left.php and merge the code for the box contents.

 

HTH

 

G

Hello Geoffrey,

I didn't alter the file, column_left.php, as the installation instructions never mentioned this file. The extra 'Reports' box was not there prior to my attempt at this installation. For good measure, though, I did take your suggestion and look at the column_left.php file, but didn't see (with my untrained eyes) that seemed out of whack or duplicated. My two table additions to MySQL database went smoothly and I didn't see any glaring mistakes there, either. 

Obviously, I've been staring at the files too long and have missed something. Thanks for your help, though.

...Will

Link to comment
Share on other sites

Try posting the installation instructions and mysql.

 

Otherwise no chance of seeing what it is.

 

Cheers

 

G

Need help installing add ons/contributions, cleaning a hacked site or a bespoke development, check my profile

 

Virus Threat Scanner

My Contributions

Basic install answers.

Click here for Contributions / Add Ons.

UK your site.

Site Move.

Basic design info.

 

For links mentioned in old answers that are no longer here follow this link Useful Threads.

 

If this post was useful, click the Like This button over there ======>>>>>.

Link to comment
Share on other sites

Is this what you need? Not sure what you meant what you meant by MySQL.

Thanks again.

...Will

 

## Margin Report for OSCommerce v2.3.1                                                                  ###
###                                                                                                      ###
### Based on Margin Report V3.00                                                                         ###
###                                                                                                      ###
### Modifications done by Lennerd                                                                        ###
###                                                                                                      ###
############################################################################################################
###                                                                                                      ###
### Margin Report v3.00                                                                                  ###
###                                                                                                      ###
### Official Support Thread http://www.oscommerce.com/forums/index.php?showtopic=99144                       ###
###                                                                                                      ###
### If you find this contribution useful and would like to make a donation                               ###
### so that I can continue to build contributions for the community such as this one and Family Products.###
### Thanks and I hope you find this contribution useful.                                                 ###
###                                                                                                      ###
### -Chris (a.k.a. blueline) P.S.                                                                        ###
###                                                                                                      ###
### If you find this contribution useful I'd like to hear about it.                                      ###
###                                                                                                      ###
### You can email me at [email protected] and let me know what you think. Thanks again.                   ###
###                                                                                                      ###
### Margin Report v3.00 - - by mr_absinthe 2008/03/16 - www.OriginalAbsinthe.com               ###
###   percentage margin per order          ###
###   order status filter           ###
###   order number clickable to link to the order details       ###
###                                                                                        ###
###                                                                                                      ###
### Installation Instructions for OSCommerce 2.3.1                                                       ###
###                                                                                                      ###
### Files included:                                                                                      ###
###                                                                                                      ###
### /catalog/admin/margin_report.php                                                                     ###
### /catalog/admin/margin_report2.php                                                                    ###
### /catalog/admin/includes/languages/dutch/margin_report.php                                            ###
### /catalog/admin/includes/languages/dutch/images/buttons/button_export.gif    * untouched *            ###
### /catalog/admin/includes/languages/french/margin_report.php    * untouched *                          ###
### /catalog/admin/includes/languages/french/images/buttons/button_export.gif     * untouched *          ###
###                                                                                                      ###
###                                                                                                      ###
### Files to Edit:                                                                                       ###
###                                                                                                      ###
### /catalog/admin/categories.php                                                                        ###
### /catalog/admin/includes/languages/english/categories.php                                             ###
### /catalog/admin/includes/languages/english.php                                                        ###
### /catalog/admin/includes/boxes/reports.php                                                            ###
### /catalog/admin/includes/filenames.php                                                                ###
### /catalog/includes/classes/order.php                                                                  ###
### /catalog/includes/classes/shopping_cart.php                                                          ###
### /catalog/checkout_process.php                                                                        ###
###                                                                                                      ###
### SQL to Alter (see bottom of this file)                                                               ###
############################################################################################################

Installation Instructions for OSCommerce 2.3.1

These instructions are the basic modifications to be done to get it working with your OSCommerce version 2.3.1.
I did it on a quite modified shop and without any issue what so ever.

First, copy the included files to your shop via FTP.

Modifications to be done manually:

Open:
/catalog/admin/categories.php

Find:
         <tr bgcolor="#ebebff">
           <td class="main"><?php echo TEXT_PRODUCTS_PRICE_NET; ?></td>
           <td class="main"><?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . ' ' . tep_draw_input_field('products_price', $pInfo->products_price, 'onKeyUp="updateGross()"'); ?></td>
         </tr>

Replace 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>
  <tr bgcolor="#ebebff">
    <td class="main"><?php echo TEXT_PRODUCTS_PRICE_NET; ?></td>
    <td class="main"><?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . ' ' . tep_draw_input_field('products_price', $pInfo->products_price, 'onKeyUp="updateGross()"'); ?></td>
  </tr>

Find:
   if (isset($HTTP_GET_VARS['search'])) {
     $products_query = tep_db_query("select p.products_id, pd.products_name, p.products_quantity, p.products_image, p.products_price, p.products_date_added, p.products_last_modified, p.products_date_available, p.products_status, p2c.categories_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' and p.products_id = p2c.products_id and pd.products_name like '%" . tep_db_input($search) . "%' order by pd.products_name");
   } else {
     $products_query = tep_db_query("select p.products_id, pd.products_name, p.products_quantity, p.products_image, p.products_price, p.products_date_added, p.products_last_modified, p.products_date_available, p.products_status from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' and p.products_id = p2c.products_id and p2c.categories_id = '" . (int)$current_category_id . "' order by pd.products_name");
   }

Replace With:
   if (isset($HTTP_GET_VARS['search'])) {
     $products_query = tep_db_query("select p.products_id, pd.products_name, p.products_quantity, p.products_image, p.products_price, p.products_cost, p.products_date_added, p.products_last_modified, p.products_date_available, p.products_status, p2c.categories_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' and p.products_id = p2c.products_id and pd.products_name like '%" . tep_db_input($search) . "%' order by pd.products_name");
   } else {
        $products_query = tep_db_query("select p.products_id, pd.products_name, p.products_quantity, p.products_image, p.products_price, p.products_cost, p.products_date_added, p.products_last_modified, p.products_date_available, p.products_status from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' and p.products_id = p2c.products_id and p2c.categories_id = '" . (int)$current_category_id . "' order by pd.products_name");
   }
  
Find:
                      'products_price' => '',

Replace With:
                      'products_price' => '',
                      'products_cost' => '',

Find:
           $contents[] = array('text' => '<br>' . TEXT_PRODUCTS_PRICE_INFO . ' ' . $currencies->format($pInfo->products_price) . '<br>' . TEXT_PRODUCTS_QUANTITY_INFO . ' ' . $pInfo->products_quantity);

Replace With:
           $contents[] = array('text' => '<br>' . TEXT_PRODUCTS_COST_INFO . ' ' . $currencies->format($pInfo->products_cost) . '<br>' . TEXT_PRODUCTS_PRICE_INFO . ' ' . $currencies->format($pInfo->products_price) . '<br><br>' . TEXT_PRODUCTS_PROFIT_INFO . ' ' . $currencies->format($pInfo->products_price-$pInfo->products_cost) . '<br><br>' . TEXT_PRODUCTS_QUANTITY_INFO . ' ' . $pInfo->products_quantity);           
                    
Find:
                                 'products_price' => tep_db_prepare_input($HTTP_POST_VARS['products_price']),

Replace With:
                                 'products_price' => tep_db_prepare_input($HTTP_POST_VARS['products_price']),
                                 'products_cost' => tep_db_prepare_input($HTTP_POST_VARS['products_cost']),

Find:
           } 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();
                                
Replace With:
    } elseif ($HTTP_POST_VARS['copy_as'] == 'duplicate') {
    $product_query = tep_db_query("select products_quantity, products_model, products_image, products_price, products_cost, 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_cost, 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']) . "', '" . tep_db_input($product['products_cost']) . "', 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();

Find:
   if (isset($HTTP_GET_VARS['pID']) && empty($HTTP_POST_VARS)) {
     $product_query = tep_db_query("select pd.products_name, pd.products_description, pd.products_url, p.products_id, p.products_quantity, p.products_model, p.products_image, p.products_price, p.products_weight, p.products_date_added, p.products_last_modified, date_format(p.products_date_available, '%Y-%m-%d') as products_date_available, p.products_status, p.products_tax_class_id, p.manufacturers_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_id = '" . (int)$HTTP_GET_VARS['pID'] . "' and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "'");
     $product = tep_db_fetch_array($product_query);

Replace With:
   if (isset($HTTP_GET_VARS['pID']) && empty($HTTP_POST_VARS)) {
     $product_query = tep_db_query("select pd.products_name, pd.products_description, pd.products_url, p.products_id, p.products_quantity, p.products_model, p.products_image, p.products_price, p.products_cost, p.products_weight, p.products_date_added, p.products_last_modified, date_format(p.products_date_available, '%Y-%m-%d') as products_date_available, p.products_status, p.products_tax_class_id, p.manufacturers_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_id = '" . (int)$HTTP_GET_VARS['pID'] . "' and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "'");
     $product = tep_db_fetch_array($product_query);

Save and close.  Now open:
* NOTE: In the V3.00 no version of the english margin report was included, so modify the part below to your languages. *

/catalog/admin/includes/languages/english/categories.php

Add:
 define('TEXT_PRODUCTS_COST_INFO', 'Cost: ');
 define('TEXT_PRODUCTS_PROFIT_INFO', 'Profit:');
 define('TEXT_PRODUCTS_PRICE_COST', 'Products Price (Cost):');

Also add these lines to other languages you are using. 

Save and close.  Now open:

/catalog/admin/includes/languages/english.php

Find:
 define('BOX_REPORTS_ORDERS_TOTAL', 'Customer Orders-Total');
 
Replace With:
 define('BOX_REPORTS_MARGIN_REPORT', 'Margin Report');
 define('BOX_REPORTS_ORDERS_TOTAL', 'Customer Orders-Total'); 
 
Also replace these lines to other languages you are using.

Save and close.  Now open:

/catalog/admin/includes/boxes/reports.php

Find:

      array(
        'code' => FILENAME_STATS_CUSTOMERS,
        'title' => BOX_REPORTS_ORDERS_TOTAL,
        'link' => tep_href_link(FILENAME_STATS_CUSTOMERS)
      )

Before add:

      array(
  'code' => FILENAME_MARGIN_REPORT,
  'title' => BOX_REPORTS_MARGIN_REPORT,
  'link' => tep_href_link(FILENAME_MARGIN_REPORT)
   ),

Save and close.  Now open:

/catalog/admin/includes/filenames.php
Add:
 define('FILENAME_MARGIN_REPORT', 'margin_report.php');
 define('FILENAME_MARGIN_REPORT2', 'margin_report2.php'); 

Save and close.  Now open:

/catalog/includes/classes/order.php
Find:
     $orders_products_query = tep_db_query("select orders_products_id, products_id, products_name, products_model, products_price, products_tax, products_quantity, final_price from " . TABLE_ORDERS_PRODUCTS . " where orders_id = '" . (int)$order_id . "'");
     while ($orders_products = tep_db_fetch_array($orders_products_query)) {
       $this->products[$index] = array('qty' => $orders_products['products_quantity'],
                                'id' => $orders_products['products_id'],
                                       'name' => $orders_products['products_name'],
                                       'model' => $orders_products['products_model'],
                                       'tax' => $orders_products['products_tax'],
                                       'price' => $orders_products['products_price'],
                                       'final_price' => $orders_products['final_price']);

Replace With:
     $orders_products_query = tep_db_query("select orders_products_id, products_id, products_name, products_model, products_price, products_cost, products_tax, products_quantity, final_price from " . TABLE_ORDERS_PRODUCTS . " where orders_id = '" . (int)$order_id . "'");
//   $orders_products_query = tep_db_query("select orders_products_id, products_id, products_name, products_model, products_price, products_tax, products_quantity, final_price from " . TABLE_ORDERS_PRODUCTS . " where orders_id = '" . (int)$order_id . "'");
     while ($orders_products = tep_db_fetch_array($orders_products_query)) {
       $this->products[$index] = array('qty' => $orders_products['products_quantity'],
                  'id' => $orders_products['products_id'],
                  'name' => $orders_products['products_name'],
                  'model' => $orders_products['products_model'],
                  'tax' => $orders_products['products_tax'],
                  'price' => $orders_products['products_price'],
                  'cost' => $orders_products['products_cost'],
                  'final_price' => $orders_products['final_price']);

Find:
       $this->products[$index] = array('qty' => $products[$i]['quantity'],
                                       'name' => $products[$i]['name'],
                                       'model' => $products[$i]['model'],
                                       'tax' => tep_get_tax_rate($products[$i]['tax_class_id'], $tax_address['entry_country_id'], $tax_address['entry_zone_id']),
                                       'tax_description' => tep_get_tax_description($products[$i]['tax_class_id'], $tax_address['entry_country_id'], $tax_address['entry_zone_id']),
                                       'price' => $products[$i]['price'],
                                       'final_price' => $products[$i]['price'] + $cart->attributes_price($products[$i]['id']),
                                       'weight' => $products[$i]['weight'],
                                       'id' => $products[$i]['id']);

Replace With:
 $this->products[$index] = array('qty' => $products[$i]['quantity'],
           'name' => $products[$i]['name'],
           'model' => $products[$i]['model'],
           'tax' => tep_get_tax_rate($products[$i]['tax_class_id'], $tax_address['entry_country_id'], $tax_address['entry_zone_id']),
           'tax_description' => tep_get_tax_description($products[$i]['tax_class_id'], $tax_address['entry_country_id'], $tax_address['entry_zone_id']),
           'price' => $products[$i]['price'],
           'cost' => $products[$i]['cost'],
           'final_price' => $products[$i]['price'] + $cart->attributes_price($products[$i]['id']),
           'weight' => $products[$i]['weight'],
           'id' => $products[$i]['id']);

Save and close.  Now open:

/catalog/includes/classes/shopping_cart.php

Find:
// products price
       $product_query = tep_db_query("select products_id, products_price, products_tax_class_id, products_weight from " . TABLE_PRODUCTS . " where products_id = '" . (int)$products_id . "'");
       if ($product = tep_db_fetch_array($product_query)) {
         $prid = $product['products_id'];
         $products_tax = tep_get_tax_rate($product['products_tax_class_id']);
         $products_price = $product['products_price'];
         $products_weight = $product['products_weight'];

Replace With:
// products price
       $product_query = tep_db_query("select products_id, products_price, products_tax_class_id, products_weight from " . TABLE_PRODUCTS . " where products_id = '" . (int)$products_id . "'");
       if ($product = tep_db_fetch_array($product_query)) {
 $prid = $product['products_id'];
 $products_tax = tep_get_tax_rate($product['products_tax_class_id']);
 $products_price = $product['products_price'];
 $products_cost = $product['products_cost'];
 $products_weight = $product['products_weight'];
 
Find:
     while (list($products_id, ) = each($this->contents)) {
       $products_query = tep_db_query("select p.products_id, pd.products_name, p.products_model, p.products_image, p.products_price, p.products_weight, p.products_tax_class_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_id = '" . (int)$products_id . "' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "'"); 

Replace With:
     while (list($products_id, ) = each($this->contents)) {
       $products_query = tep_db_query("select p.products_id, pd.products_name, p.products_model, p.products_image, p.products_price, p.products_cost, p.products_weight, p.products_tax_class_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_id = '" . (int)$products_id . "' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "'");               

Find:
         $products_array[] = array('id' => $products_id,
                                   'name' => $products['products_name'],
                                   'model' => $products['products_model'],
                                   'image' => $products['products_image'],
                                   'price' => $products_price,
                                   'quantity' => $this->contents[$products_id]['qty'],
Replace With:
  $products_array[] = array('id' => $products_id,
         'name' => $products['products_name'],
         'model' => $products['products_model'],
         'image' => $products['products_image'],
         'price' => $products_price,
         'cost' => $products['products_cost'],
         'quantity' => $this->contents[$products_id]['qty'],

Save and close.  Now open:

/catalog/checkout_process.php

Find:
   $sql_data_array = array('orders_id' => $insert_id,
                           'products_id' => tep_get_prid($order->products[$i]['id']),
                           'products_model' => $order->products[$i]['model'],
                           'products_name' => $order->products[$i]['name'],
                           'products_price' => $order->products[$i]['price'],
                           'final_price' => $order->products[$i]['final_price'],
                           'products_tax' => $order->products[$i]['tax'],
                           'products_quantity' => $order->products[$i]['qty']);

Replace With:
   $sql_data_array = array('orders_id' => $insert_id,
          'products_id' => tep_get_prid($order->products[$i]['id']),
          'products_model' => $order->products[$i]['model'],
          'products_name' => $order->products[$i]['name'],
          'products_price' => $order->products[$i]['price'],
          'products_cost' => $order->products[$i]['cost'],
          'final_price' => $order->products[$i]['final_price'],
          'products_tax' => $order->products[$i]['tax'],
          'products_quantity' => $order->products[$i]['qty']); 
        
Save and close all files

mySQL Instructions:
Run mySQL Command by copying the code below:

ALTER TABLE `products` ADD `products_cost` DECIMAL( 15, 4 ) DEFAULT '0.0000' NOT NULL AFTER `products_price`;
ALTER TABLE `orders_products` ADD `products_cost` DECIMAL( 15, 4 ) DEFAULT '0.0000' NOT NULL AFTER `products_price`;

Done!

Link to comment
Share on other sites

This is the bit that adds a second box
 
 

Replace With:
 define('BOX_REPORTS_MARGIN_REPORT', 'Margin Report');
 define('BOX_REPORTS_ORDERS_TOTAL', 'Customer Orders-Total'); 
 
Also replace these lines to other languages you are using.[/code]
Save and close.  Now open:
/catalog/admin/includes/boxes/reports.php
Find:
      array(
        'code' => FILENAME_STATS_CUSTOMERS,
        'title' => BOX_REPORTS_ORDERS_TOTAL,
        'link' => tep_href_link(FILENAME_STATS_CUSTOMERS)
      )
Before add:
      array(
  'code' => FILENAME_MARGIN_REPORT,
  'title' => BOX_REPORTS_MARGIN_REPORT,
  'link' => tep_href_link(FILENAME_MARGIN_REPORT)
   ),

So reverse that out.

 

Now open admin/includes/boxes/margin_reports.php and copy the 2 blocks of code for the 2 report into admin/includes/boxes/reports.php. There will be 10 lines.

 

Now insert a comma just before the blocks you inserted.

 

The first block of code will look like this

array(
'code' => FILENAME_STATS_PRODUCTS_VIEWED,
'title' => BOX_REPORTS_PRODUCTS_VIEWED,
'link' => tep_href_link(FILENAME_STATS_PRODUCTS_VIEWED)
),

and the second like this

array(
'code' => FILENAME_STATS_PRODUCTS_VIEWED,
'title' => BOX_REPORTS_PRODUCTS_VIEWED,
'link' => tep_href_link(FILENAME_STATS_PRODUCTS_VIEWED)
)

note the "missing" comma.


 

This shows where you should copy it

<?php
/*
  $Id$

  osCommerce, Open Source E-Commerce Solutions
  http://www.oscommerce.com

  Copyright (c) 2010 osCommerce

  Released under the GNU General Public License
*/

  $cl_box_groups[] = array(
    'heading' => BOX_HEADING_REPORTS,
    'apps' => array(


<<<============ Insert here

      array(
        'code' => FILENAME_STATS_PRODUCTS_VIEWED,
        'title' => BOX_REPORTS_PRODUCTS_VIEWED,
        'link' => tep_href_link(FILENAME_STATS_PRODUCTS_VIEWED)
      ),
      array(
        'code' => FILENAME_STATS_PRODUCTS_PURCHASED,
        'title' => BOX_REPORTS_PRODUCTS_PURCHASED,
        'link' => tep_href_link(FILENAME_STATS_PRODUCTS_PURCHASED)
      ),
      array(
        'code' => FILENAME_STATS_CUSTOMERS,
        'title' => BOX_REPORTS_ORDERS_TOTAL,
        'link' => tep_href_link(FILENAME_STATS_CUSTOMERS)
      )
    )
  );
?>

Now add a comma after the last block you inserted.

 

That should do it.

 

HTH

 

G

Need help installing add ons/contributions, cleaning a hacked site or a bespoke development, check my profile

 

Virus Threat Scanner

My Contributions

Basic install answers.

Click here for Contributions / Add Ons.

UK your site.

Site Move.

Basic design info.

 

For links mentioned in old answers that are no longer here follow this link Useful Threads.

 

If this post was useful, click the Like This button over there ======>>>>>.

Link to comment
Share on other sites

<Solved>

 

Stupid me.

 

As I edit a particular file, I will rename the old and then upload the new one to the same directory. In the admin/includes/boxes directory, I had an additional 'reports' file with a different name which caused the apparent duplication.

 

Thanks for all your help.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...