Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

what's wrong with this code?


Guest

Recommended Posts

Posted

So my site won't load (check out yikescomics.com/catalog)

 

I've been told that the problem may lie in includes/boxes/whats_new.php. Here's the code. Does anyone see any problems?

 

<?php
/*
 $Id: whats_new.php,v 1.31 2003/02/10 22:31:09 hpdl Exp $

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

 Copyright ? 2003 osCommerce

 Released under the GNU General Public License
*/

 if ($random_product = tep_random_select("select products_id, products_image, products_tax_class_id, products_price from " . TABLE_PRODUCTS . " where products_status = '1' order by products_date_added desc limit " . MAX_RANDOM_SELECT_NEW)) {
?>
<!-- whats_new //-->
         <tr>
           <td>
<?php
   $random_product['products_name'] = tep_get_products_name($random_product['products_id']);
   $random_product['specials_new_products_price'] = tep_get_products_special_price($random_product['products_id']);

   $info_box_contents = array();
   $info_box_contents[] = array('text' => BOX_HEADING_WHATS_NEW);

   new infoBoxHeading($info_box_contents, false, false, tep_href_link(FILENAME_PRODUCTS_NEW));

   if (tep_not_null($random_product['specials_new_products_price'])) {
     $whats_new_price = '<s>' . $currencies->display_price($random_product['products_price'], tep_get_tax_rate($random_product['products_tax_class_id'])) . '</s><br>';
     $whats_new_price .= '<span class="productSpecialPrice">' . $currencies->display_price($random_product['specials_new_products_price'], tep_get_tax_rate($random_product['products_tax_class_id'])) . '</span>';
   } else {
     $whats_new_price = $currencies->display_price($random_product['products_price'], tep_get_tax_rate($random_product['products_tax_class_id']));
   }

   $info_box_contents = array();
   $info_box_contents[] = array('align' => 'center',
                                'text' => '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $random_product['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $random_product['products_image'], $random_product['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $random_product['products_id']) . '">' . $random_product['products_name'] . '</a><br>' . $whats_new_price);

   new infoBox($info_box_contents);
?>
           </td>
         </tr>
<!-- whats_new_eof //-->
<?php
 }
?>

 

thanks in advance!

dave

Posted

Still nothing. Replaced with the original and nothing.

 

I don't think it's the includes/boxes/whats_new.php.

 

any other suggestions?

 

dave

Posted

Dave,

 

Post left_column.php.

 

ed

Posted
Dave,

 

Post left_column.php.

 

ed

 

Here you go:

 

<?php

/*

$Id: column_left.php,v 1.15 2003/07/01 14:34:54 hpdl Exp $

 

osCommerce, Open Source E-Commerce Solutions

http://www.oscommerce.com

 

Copyright © 2003 osCommerce

 

Released under the GNU General Public License

*/

 

if ((USE_CACHE == 'true') && empty($SID)) {

echo tep_cache_categories_box();

} else {

include(DIR_WS_BOXES . 'categories.php');

}

 

if ((USE_CACHE == 'true') && empty($SID)) {

echo tep_cache_manufacturers_box();

} else {

include(DIR_WS_BOXES . 'manufacturers.php');

}

 

require(DIR_WS_BOXES . 'whats_new.php');

require(DIR_WS_BOXES . 'search.php');

require(DIR_WS_BOXES . 'information.php');

?>

 

thanks for any help

dave

Posted

put a // in front of require(DIR_WS_BOXES . 'whats_new.php'); in your column_left.php. so it looks like

 

// require(DIR_WS_BOXES . 'whats_new.php');

 

You may have to search for a missing closing tag, or too many columns in a table row in the code above your call to column_left.php

 

If you still have a problem, then it is not the what's new box. Since your categories menu builds ok, includes/classes/boxes.php is okay.

GEOTEX from Houston, TX

 

(George)

Posted

Dave,

 

George's idea is a good one. I was going to suggest moving the search and information lines above what's new and seeing if more showed up on the screen.

 

The whats_new.php code is identical to stock. The other possibility is that it's something else that the code is using that is breaking the page.

 

ed

Posted

I took out the what's new box and how the main index loads to the "New Products" bar, and I can't remove that one.

 

If you click on the catagories to the left you can access some products but not all. Also, when the products show up, so does the right column blocks!

 

Catagories I went through were: toys>star wars. Click on all the different subs using the left catagory box to check out the different star wars box. Some load, some do not.

 

Something's screwy.

 

dave

 

Dave,

 

George's idea is a good one.  I was going to suggest moving the search and information lines above what's new and seeing if more showed up on the screen.

 

The whats_new.php code is identical to stock.  The other possibility is that it's something else that the code is using that is breaking the page.

 

ed

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...