Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

HELP PLEASE: inserting code for


dvdpowerseller

Recommended Posts

I have done everything needed for this contribution besides the part which says insert

 

// Show the Similar Products box if we are on a product page

if (isset($_GET['products_id'])) include(DIR_WS_BOXES . 'similar_products.php');

 

were you want the box on the page (this is in the rightcolum file...

 

When I insert this it just shows an error on my website....please help....I am wanting to add it just above the notifications box...how would I do this... do I need to add in any { or else if etc etc?

 

HERE IS THE CODE:

 

require(DIR_WS_BOXES . 'shopping_cart.php');

 

if (isset($HTTP_GET_VARS['products_id'])) include(DIR_WS_BOXES . 'manufacturer_info.php');

 

if (tep_session_is_registered('customer_id')) include(DIR_WS_BOXES . 'order_history.php');

 

if (isset($HTTP_GET_VARS['products_id'])) {

if (tep_session_is_registered('customer_id')) {

$check_query = tep_db_query("select count(*) as count from " . TABLE_CUSTOMERS_INFO . " where customers_info_id = '" . (int)$customer_id . "' and global_product_notifications = '1'");

$check = tep_db_fetch_array($check_query);

if ($check['count'] > 0) {

include(DIR_WS_BOXES . 'best_sellers.php');

} else {

include(DIR_WS_BOXES . 'product_notifications.php');

}

} else {

include(DIR_WS_BOXES . 'product_notifications.php');

}

} else {

include(DIR_WS_BOXES . 'best_sellers.php');

}

 

if (isset($HTTP_GET_VARS['products_id'])) {

if (basename($PHP_SELF) != FILENAME_TELL_A_FRIEND) include(DIR_WS_BOXES . 'tell_a_friend.php');

} else {

include(DIR_WS_BOXES . 'specials.php');

}

 

require(DIR_WS_BOXES . 'reviews.php');

 

if (substr(basename($PHP_SELF), 0, 8) != 'checkout') {

include(DIR_WS_BOXES . 'languages.php');

include(DIR_WS_BOXES . 'currencies.php');

}

?>

 

 

 

Thanks in advance..... :thumbsup:

Link to comment
Share on other sites

What kind of an error is it? Parse error? Most likely it comes from the file itself. But seeing that its an included file, it should simply print the error wherever it would have included the box instead of displaying a simple error on white background and not displaying anything else.

Link to comment
Share on other sites

this is what I get..

 

Warning: main(includes/boxes/similar_products.php): failed to open stream: No such file or directory in /home/jbetton/public_html/shop/includes/column_right.php on line 17

 

Warning: main(includes/boxes/similar_products.php): failed to open stream: No such file or directory in /home/jbetton/public_html/shop/includes/column_right.php on line 17

 

Warning: main(): Failed opening 'includes/boxes/similar_products.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/jbetton/public_html/shop/includes/column_right.php on line 17

 

 

This is the code.....

 

<?php

/*

$Id: column_right.php,v 1.17 2003/06/09 22:06:41 hpdl Exp $

 

osCommerce, Open Source E-Commerce Solutions

http://www.oscommerce.com

 

Copyright © 2003 osCommerce

 

Released under the GNU General Public License

*/

 

require(DIR_WS_BOXES . 'shopping_cart.php');

 

if (isset($HTTP_GET_VARS['products_id'])) include(DIR_WS_BOXES . 'manufacturer_info.php');

 

if (isset($_GET['products_id'])) include(DIR_WS_BOXES . 'similar_products.php');

 

if (tep_session_is_registered('customer_id')) include(DIR_WS_BOXES . 'order_history.php');

 

if (isset($HTTP_GET_VARS['products_id'])) {

if (tep_session_is_registered('customer_id')) {

$check_query = tep_db_query("select count(*) as count from " . TABLE_CUSTOMERS_INFO . " where customers_info_id = '" . (int)$customer_id . "' and global_product_notifications = '1'");

$check = tep_db_fetch_array($check_query);

if ($check['count'] > 0) {

include(DIR_WS_BOXES . 'best_sellers.php');

} else {

include(DIR_WS_BOXES . 'product_notifications.php');

}

} else {

include(DIR_WS_BOXES . 'product_notifications.php');

}

} else {

include(DIR_WS_BOXES . 'best_sellers.php');

}

 

if (isset($HTTP_GET_VARS['products_id'])) {

if (basename($PHP_SELF) != FILENAME_TELL_A_FRIEND) include(DIR_WS_BOXES . 'tell_a_friend.php');

} else {

include(DIR_WS_BOXES . 'specials.php');

}

 

require(DIR_WS_BOXES . 'reviews.php');

 

if (substr(basename($PHP_SELF), 0, 8) != 'checkout') {

include(DIR_WS_BOXES . 'languages.php');

include(DIR_WS_BOXES . 'currencies.php');

}

?>

Link to comment
Share on other sites

Ok. The warning states that there is no similar_products.php file. You probably misspelled it or put it in the wrong dir. Make sure you have it in catalog/includes/boxes with the name similar_products.php

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...