Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Main Categories in Frontage


droddis

Recommended Posts

Is it possible to get rid of the infobox on the main categories add-on so that the categories print to the screen like the sub-categories (without the infobox!!). I am using the add-on main categories on frontpage. The code in the module is:

 

<?php
 $info_box_contents = array();
 $info_box_contents[] = array('text' => sprintf('Main Categories', strftime('%B')));

 //new contentBoxHeading($info_box_contents);


 if ( (!isset($new_products_category_id)) || ($new_products_category_id == '0') ) {
$categ_query = tep_db_query("select p.categories_id, p.categories_image, s.categories_name from " . TABLE_CATEGORIES . " p left join " . TABLE_CATEGORIES_DESCRIPTION . " s on p.categories_id = s.categories_id where parent_id = '0' and language_id = '1' order by p.sort_order limit " . MAX_DISPLAY_NEW_PRODUCTS);
 } else {
$categ_query = tep_db_query("select distinct p.categories_id, p.categories_image, s.categories_name from " . TABLE_CATEGORIES . " p left join " . TABLE_CATEGORIES_DESCRIPTION . " s on p.categories_id = s.categories_id where parent_id = '0' and language_id = '1' order by p.sort_order limit " . MAX_DISPLAY_NEW_PRODUCTS);
 }

 $row = 0;
 $col = 0;
 $info_box_contents = array();
	while ($categ = tep_db_fetch_array($categ_query)) 
{

$info_box_contents[$row][$col] = array(	'align' => 'center',
									   	'params' => 'class="smallText" width="33%" valign="top"',										   
										'text' => '<a href="' . tep_href_link(FILENAME_DEFAULT, 'cPath=' . $categ['categories_id']) . '">' . tep_image(DIR_WS_IMAGES . $categ['categories_image'], $categ['categories_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br><a href="' . tep_href_link(FILENAME_DEFAULT, 'cPath=' . $categ['categories_id']) . '">' . $categ['categories_name']);

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

 new contentBox($info_box_contents);
?>
<!-- new_products_eof //-->

 

and on the index.php i have added the lines

 

		 <tr>
	<td><?php include(DIR_WS_MODULES . 'main_categories.php'); ?></td>
	 </tr>
	 <tr>
	<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>

I guess you have to take the values from the array without using the contentBox Function in the module. But i do not know how to do this.

 

Could some one please help.

 

Thanks

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...