Jump to content
Sign in to follow this  
NimaP

need help to hide a box in column right

Recommended Posts

hello,

 

i'm trying to display my product accessories on the right column when someone views the product. however it still creates the info box when a product doesn't have an access. can someone look at my code and suggest how i can create an if statement that says only show this table when there's more than 0 accessories for a specific product.

 

<?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

*/

?>

 

<table width="100%" cellpadding="0" cellspacing="0" border="0">

<tr>

<td height="32" class="headerNavigation" style="background: url('images/gui/RightBarCartTop.gif') no-repeat;">

<a href="<?php echo tep_href_link(FILENAME_SHOPPING_CART); ?>" class="headerNavigation">Your Cart</a>

</td>

</tr>

<tr>

<td class="sideNavigation" align="center" style="background: url('images/gui/RightBarBoxBack.gif')">

<table width="119" cellpadding="0" cellspacing="0" border="0">

<tr>

<td class="rightNavigation">

<?php require(DIR_WS_BOXES . 'shopping_cart2.php'); ?>

</td>

</tr>

</table>

</td>

</tr>

<tr>

<td><img src="images/gui/RightBarBoxBottom.gif" border="0"></td>

</tr>

<tr>

<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '5'); ?></td>

</tr>

<tr>

<td height="32" class="headerNavigation" style="background: url('images/gui/RightBarBestsellerTop.gif') no-repeat;">

Bestsellers

</td>

</tr>

<tr>

<td class="sideNavigation" align="center" style="background: url('images/gui/RightBarBoxBack.gif')">

<table width="120" cellpadding="0" cellspacing="0" border="0">

<tr>

<td class="rightNavigation">

<?php require(DIR_WS_BOXES . 'best_sellers2.php'); ?>

</td>

</tr>

</table>

</td>

</tr>

<tr>

<td class="rightNavigation"><img src="images/gui/RightBarBoxBottom.gif" border="0"></td>

</tr>

<tr>

<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '5'); ?></td>

</tr>

</table>

<table width="100%" border="0" cellpadding="0" cellspacing="0">

<tr>

<td height="32" class="headerNavigation" style="background: url('images/gui/RightBarAccessoriesTop.gif') no-repeat;"> Accessories</td>

</tr>

<tr>

<td class="sideNavigation" align="center" style="background: url('images/gui/RightBarBoxBack.gif')"><table width="120" cellpadding="0" cellspacing="0" border="0">

<tr>

<td class="rightNavigation"><?php $info_box_contents = array();

$accessories = explode(',',$product_info['products_accessories']);

 

//$row = 0;

$col = 0;

 

for($i=0;$i<count($accessories);$i++)

{

$name_query = tep_get_products_name($accessories[$i]);

$image_query = tep_get_products_image($accessories[$i]);

$info_box_contents[$col] = array('align' => 'center',

'params' => 'class="smallText" width="33%" valign="top"',

'text' => '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $accessories[$i]) . '">' . tep_image(DIR_WS_IMAGES . $image_query, $name_query, 50, 50,'style="border:1px solid #666666;"') . '</a><br><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $accessories[$i]) . '">' . $name_query . '</a>');

 

$col ++;

if ($col > 9) {

$col = 0;

$row ++;

}

 

}

new contentBox($info_box_contents);

 

 

?>

</td>

</tr>

</table></td>

</tr>

<tr>

<td class="rightNavigation"><img src="images/gui/RightBarBoxBottom.gif" border="0" /></td>

</tr>

<tr>

<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '5'); ?></td>

</tr>

</table>

<?php

require (DIR_WS_BOXES . 'Ads.php');

/*

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');

}

*/

?>

 

here's the page with accessories.

http://www.safetygears.net/alcomate-prestige-p-198.html

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×