OSCOMMERCE SUPPORT CALL 702-453-3332

 

Help - Search - Members - Calendar
Full Version: Maybe easily fixed?
osCommerce Community Support Forums > osCommerce Online Merchant v2.x > General Support
propertop
Apologies if this is a straightforward problem to solve but on certain products we're finding a fatal error that refers to 'also_purchased_products.php'

Here's an example of it 'in action'

Link

Is there any easy/quick/safe way I can stop it referring to that file?

We're developing a new site to go live in 4-6 weeks so a quick fix is required for now, rather than a complete solution.

Anyway able to help me out?
maxxxie
QUOTE (propertop @ Jan 11 2008, 10:13 AM) *
Apologies if this is a straightforward problem to solve but on certain products we're finding a fatal error that refers to 'also_purchased_products.php'

Here's an example of it 'in action'

Link

Is there any easy/quick/safe way I can stop it referring to that file?

We're developing a new site to go live in 4-6 weeks so a quick fix is required for now, rather than a complete solution.

Anyway able to help me out?


Yup. In your catalog/product_info.php file, search for :

CODE
include(DIR_WS_MODULES . FILENAME_ALSO_PURCHASED_PRODUCTS);


Replace it with:
CODE
// include(DIR_WS_MODULES . FILENAME_ALSO_PURCHASED_PRODUCTS);


It's just to comment it out. Realistically, you would like to find out what's wrong with your catalog/includes/modules/also_purchased_products.php file. The stock standard file is:

CODE
<?php
/*
  $Id: also_purchased_products.php,v 1.21 2003/02/12 23:55:58 hpdl Exp $

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

  Copyright (c) 2003 osCommerce

  Released under the GNU General Public License
*/

  if (isset($HTTP_GET_VARS['products_id'])) {
    $orders_query = tep_db_query("select p.products_id, p.products_image from " . TABLE_ORDERS_PRODUCTS . " opa, " . TABLE_ORDERS_PRODUCTS . " opb, " . TABLE_ORDERS . " o, " . TABLE_PRODUCTS . " p where opa.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and opa.orders_id = opb.orders_id and opb.products_id != '" . (int)$HTTP_GET_VARS['products_id'] . "' and opb.products_id = p.products_id and opb.orders_id = o.orders_id and p.products_status = '1' group by p.products_id order by o.date_purchased desc limit " . MAX_DISPLAY_ALSO_PURCHASED);
    $num_products_ordered = tep_db_num_rows($orders_query);
    if ($num_products_ordered >= MIN_DISPLAY_ALSO_PURCHASED) {
?>
<!-- also_purchased_products //-->
<?php
      $info_box_contents = array();
      $info_box_contents[] = array('text' => TEXT_ALSO_PURCHASED_PRODUCTS);

      new contentBoxHeading($info_box_contents);

      $row = 0;
      $col = 0;
      $info_box_contents = array();
      while ($orders = tep_db_fetch_array($orders_query)) {
        $orders['products_name'] = tep_get_products_name($orders['products_id']);
        $info_box_contents[$row][$col] = array('align' => 'center',
                                               'params' => 'class="smallText" width="33%" valign="top"',
                                               'text' => '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $orders['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $orders['products_image'], $orders['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $orders['products_id']) . '">' . $orders['products_name'] . '</a>');

        $col ++;
        if ($col > 2) {
          $col = 0;
          $row ++;
        }
      }

      new contentBox($info_box_contents);
?>
<!-- also_purchased_products_eof //-->
<?php
    }
  }
?>


Compare that to yours using a tool like ExamDiff, and with any luck you'll find the problem.

Cheers,
Max.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2008 Invision Power Services, Inc.