Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Code change for right column needed


Guest

Recommended Posts

I'm losing the scrolling bestsellers box after I click on any shopping page, it only shows on the default page all the time.

 

<?php

/*

$Id: column_right.php,v 1.2 2003/02/01 17:18:23 wilt Exp $

 

osCommerce, Open Source E-Commerce Solutions

http://www.oscommerce.com

 

Copyright © 2002 osCommerce

 

Released under the GNU General Public License

*/

 

require(DIR_WS_BOXES . 'loginbox.php');

require(DIR_WS_BOXES . 'shopping_cart.php');

 

//if ($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(strstr($HTTP_USER_AGENT,"MSIE"))

{

$bsellers ="best_sellers1.php";

}

else

{

$bsellers ="best_sellers.php";

}

 

if ($HTTP_GET_VARS['products_id']) {

if (session_is_registered('customer_id')) {

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

$check = tep_db_fetch_array($check_query);

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

include(DIR_WS_BOXES . $bsellers);

} else {

include(DIR_WS_BOXES . 'product_notifications.php');

}

} else {

include(DIR_WS_BOXES . 'product_notifications.php');

}

} else {

include(DIR_WS_BOXES . $bsellers);

}

 

if ($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 . 'whats_new.php');

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

require(DIR_WS_BOXES . 'information.php');

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

//include(DIR_WS_BOXES . 'languages.php');

//include(DIR_WS_BOXES . 'currencies.php');

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

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

}

include(DIR_WS_BOXES . 'customer_gv.php');//ICW ADDED FOR ORDER_TOTAL CREDIT SYSTEM

 

?>

 

Got any ideas

Link to comment
Share on other sites

Try using:

if(strstr($_SERVER['HTTP_USER_AGENT'],"MSIE")) { 

 $bsellers ="best_sellers1.php"; 

} else { 

 $bsellers ="best_sellers.php"; 

}

and let me know if that does not work better.

"Great spirits have always found violent opposition from mediocre minds. The latter cannot understand it when a man does not thoughtlessly submit to hereditary prejudices but honestly and courageously uses his intelligence." - A. Einstein

Link to comment
Share on other sites

Okay, change it to:

echo 'User agent is: ' . $_SERVER['HTTP_USER_AGENT'] . "n";

if(strstr($_SERVER['HTTP_USER_AGENT'],"MSIE")) { 

 $bsellers ="best_sellers1.php"; 

} else { 

 $bsellers ="best_sellers.php"; 

}

and let me know what user agent is reported as.

"Great spirits have always found violent opposition from mediocre minds. The latter cannot understand it when a man does not thoughtlessly submit to hereditary prejudices but honestly and courageously uses his intelligence." - A. Einstein

Link to comment
Share on other sites

Yep. :)

 

Right now we just want to know what the user agent is being reported as on the pages that you are losing the best sellers list.

"Great spirits have always found violent opposition from mediocre minds. The latter cannot understand it when a man does not thoughtlessly submit to hereditary prejudices but honestly and courageously uses his intelligence." - A. Einstein

Link to comment
Share on other sites

if you want it to appear on all the pages I would suggest taking it out of that IF statement.

 

i.e

 

if(strstr($HTTP_USER_AGENT,"MSIE")) 

{ 

$bsellers ="best_sellers1.php"; 

} 

else 

{ 

$bsellers ="best_sellers.php"; 

} 



include(DIR_WS_BOXES . $bsellers);

 

if you only want it to appear in certain circumstances can you tell us what they are and we can fix your IF statement.

 

Looking at it quickly it will only display if you are not on a product_info page or you have no notifications set -which I'm sure is not what you are after.

Link to comment
Share on other sites

I just want it to show on all pages,

 

I also have another problem you may be able to help with, trying to make a new box, rewrote english.php, column left, and add to boxes, page, but the box is a no show,

Link to comment
Share on other sites

Set the first line to

if(stristr($_SERVER['HTTP_USER_AGENT'],"msie"))

and let me know what happens.

"Great spirits have always found violent opposition from mediocre minds. The latter cannot understand it when a man does not thoughtlessly submit to hereditary prejudices but honestly and courageously uses his intelligence." - A. Einstein

Link to comment
Share on other sites

it did not scroll, I have loaded 5, with thema, and I lost it on the shopping page. I do not lose it when I 'am login.

 

Do you have any idea on my other problem?

Link to comment
Share on other sites

Okay, replace this block

  if(strstr($HTTP_USER_AGENT,"MSIE")) 

{

$bsellers ="best_sellers1.php";

} 

else 

{

$bsellers ="best_sellers.php";

}



 if ($HTTP_GET_VARS['products_id']) {

   if (session_is_registered('customer_id')) {

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

     $check = tep_db_fetch_array($check_query);

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

       include(DIR_WS_BOXES . $bsellers);

     } else {

       include(DIR_WS_BOXES . 'product_notifications.php');

     }

   } else {

     include(DIR_WS_BOXES . 'product_notifications.php');

   }

 } else {

   include(DIR_WS_BOXES . $bsellers);

 }

with this code

  if(stristr(strtolower($HTTP_USER_AGENT),"msie")) {

   $bsellers ="best_sellers1.php";

 } else {

   $bsellers ="best_sellers.php";

 }

 include(DIR_WS_BOXES . $bsellers);



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

   include(DIR_WS_BOXES . 'product_notifications.php');

 }

and let me know how it works out.

"Great spirits have always found violent opposition from mediocre minds. The latter cannot understand it when a man does not thoughtlessly submit to hereditary prejudices but honestly and courageously uses his intelligence." - A. Einstein

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...