Jump to content


Corporate Sponsors


Latest News: (loading..)

- - - - -

Search by Price Infobox


50 replies to this topic

#41 DunWeb

  • Community Sponsor
  • 10,423 posts
  • Real Name:Chris Dunn
  • Gender:Male
  • Location:Tecumseh, Ontario, Canada N8N 1X8

Posted 28 February 2010, 02:19

View Postraquelfr, on 27 February 2010, 21:42, said:

I installed the contribution as indicated by the installation file and select any of the ranges, I get the following error:


Fatal error: Cannot redeclare tep_show_category() (previously declared in /home/regalos/www/includes/header.php:141) in /home/regalos/www/includes/boxes/categories.php on line 55

Help me, thank


Post the code for that file.


Chris
:|: Was this post helpful ? Click the LIKE THIS button :|:

:|: Click Here to learn how I can help you with custom coding, add ons, security and templates :|:

:|: Need an Area Calculator, Pre-Paid Account, Virtual Pin, Auction or Layaway Add on ? Click Here :|:

#42 tormo3

  • Community Member
  • 8 posts
  • Real Name:Maksim
  • Gender:Male

Posted 14 March 2010, 15:55

View Poststubbsy, on 29 May 2007, 16:06, said:

Hi there,

A nice contribution. Is there any way it can be linked to show only the products in a particular price range from the category the customer is currently viewing, rather that the whole site?

Thanks

Dave

Hi,

Does anyone know how to make this? :huh:

#43 jesuisunique

  • Community Member
  • 32 posts
  • Real Name:jesuisunique
  • Gender:Female

Posted 31 May 2010, 00:34

can anyone show me this contribution in action?
"Be who you are and say what you feel, because those who matter don't mind, and those that mind, don't matter." (Theodor Seuss Geisel)

#44 graeme john

  • Community Member
  • 44 posts
  • Real Name:graeme belle

Posted 03 June 2010, 03:49

View Postjesuisunique, on 31 May 2010, 00:34, said:

can anyone show me this contribution in action?
http://www.mydollyandme.com.au (col right) been using it for a couple of years, no problems.

#45 designz4u

  • Community Member
  • 11 posts
  • Real Name:Alison Withers
  • Gender:Female
  • Location:New Zealand

Posted 02 January 2011, 06:37

Great contribution. I've added a theme to my oscommerce template, how do I get my theme to show up, instead of the blank white background, when I use the search by price feature?

#46 wijnendael

  • Community Member
  • 58 posts
  • Real Name:Tony

Posted 30 January 2011, 14:42

Hi evryone that has used this addon, can anyone tell me if it works with OSC version 2.3.1

#47 shottaz

  • Community Member
  • 1 posts
  • Real Name:khemran

Posted 09 September 2011, 22:47

[img]http://www.fatcow.com/images/blank.gif[/img]hi everyone.i have been using the shop by price contribution for sometime now however i recently installed it on a new store and everything works except when you select a price range the results page is completely messed up meaning that the header banner goes to the left and the rest of the page goes to the extreme right.any help or hint on this issue would be greatly appreciated.thanks in advance.

#48 mega01

  • Community Member
  • 10 posts
  • Real Name:Jose Antonio

Posted 14 November 2011, 17:33

I love this contribution but I have a problem. I like that when I am in a category, show the prices of those products, not the entire database. Do you know how I can do that?

#49 mega01

  • Community Member
  • 10 posts
  • Real Name:Jose Antonio

Posted 15 November 2011, 08:56

A nice contribution. Is there any way it can be linked to show only the products in a particular price range from the category the customer is currently viewing, rather that the whole site?

#50 lblanks240

  • Community Member
  • 20 posts
  • Real Name:lenard blanks

Posted 01 December 2011, 19:40

has anyone goten this to work with osc 2.3.1 yet

thanks
lenard

#51 jperezbadia

  • Community Member
  • 3 posts
  • Real Name:Joel Perez
  • Gender:Male
  • Location:Republica Dominicana

Posted 04 February 2012, 19:48

I installed the contribution as indicated by the installation file and select any of the ranges, I get the following error:

Fatal error: Cannot redeclare tep_show_category() (previously declared in /home2/jpreloje/public_html/includes/header.php:195) in/home2/jpreloje/public_html/includes/boxes/categories.php on line 59

Help me, thank

header:

<?php
/*
  $Id: header.php,v 1.42 2003/06/10 18:20:38 hpdl Exp $
  osCommerce, Open Source E-Commerce Solutions
  http://www.oscommerce.com
  Copyright (c) 2003 osCommerce
  Released under the GNU General Public License
*/
// check if the 'install' directory exists, and warn of its existence
  if (WARN_INSTALL_EXISTENCE == 'true') {
    if (file_exists(dirname($HTTP_SERVER_VARS['SCRIPT_FILENAME']) . '/install')) {
	  $messageStack->add('header', WARNING_INSTALL_DIRECTORY_EXISTS, 'warning');
    }
  }
// check if the configure.php file is writeable
  if (WARN_CONFIG_WRITEABLE == 'true') {
    if ( (file_exists(dirname($HTTP_SERVER_VARS['SCRIPT_FILENAME']) . '/includes/configure.php')) && (is_writeable(dirname($HTTP_SERVER_VARS['SCRIPT_FILENAME']) . '/includes/configure.php')) ) {
	  $messageStack->add('header', WARNING_CONFIG_FILE_WRITEABLE, 'warning');
    }
  }
// check if the session folder is writeable
  if (WARN_SESSION_DIRECTORY_NOT_WRITEABLE == 'true') {
    if (STORE_SESSIONS == '') {
	  if (!is_dir(tep_session_save_path())) {
	    $messageStack->add('header', WARNING_SESSION_DIRECTORY_NON_EXISTENT, 'warning');
	  } elseif (!is_writeable(tep_session_save_path())) {
	    $messageStack->add('header', WARNING_SESSION_DIRECTORY_NOT_WRITEABLE, 'warning');
	  }
    }
  }
// check session.auto_start is disabled
  if ( (function_exists('ini_get')) && (WARN_SESSION_AUTO_START == 'true') ) {
    if (ini_get('session.auto_start') == '1') {
	  $messageStack->add('header', WARNING_SESSION_AUTO_START, 'warning');
    }
  }
  if ( (WARN_DOWNLOAD_DIRECTORY_NOT_READABLE == 'true') && (DOWNLOAD_ENABLED == 'true') ) {
    if (!is_dir(DIR_FS_DOWNLOAD)) {
	  $messageStack->add('header', WARNING_DOWNLOAD_DIRECTORY_NON_EXISTENT, 'warning');
    }
  }
  if ($messageStack->size('header') > 0) {
    echo $messageStack->output('header');
  }
?>
<style type="text/css">
<!--
.style2 {
font-size: 14px;
font-weight: bold;
}
-->
</style>
  <table cellspacing=0 cellpadding=0 width=735 align=center>
   <tr><td>
	    <table cellspacing=0 cellpadding=0>
		 <tr><td><img src=../images/m29.gif width=735 height=22></td></tr>
	    </table>
	    <table cellspacing=0 cellpadding=0>
		 <tr><td><a href=<?=tep_href_link('index.php')?>><img src=../images/m01.gif width=308 height=109 border=0></a></td>
			 <td width=1></td>
			 <td width=143 bgcolor=#EDEEF2>
			  <table cellspacing=0 cellpadding=0 align=center width=113>
			   <tr><td><span class=ml>Selecciona<br>tu lenguaje:</span><br></td></tr>
			   <tr><td height=2></td></tr>
			   <tr><td>
<? // LANGUAGES
  if (!isset($lng) || (isset($lng) && !is_object($lng))) {
    include(DIR_WS_CLASSES . 'language.php');
    $lng = new language;
  }
  $languages_string = '';
  reset($lng->catalog_languages);
  while (list($key, $value) = each($lng->catalog_languages)) {
    $languages_string .= ' <a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('language', 'currency')) . 'language=' . $key, $request_type) . '">' . tep_image(DIR_WS_LANGUAGES .  $value['directory'] . '/images/' . $value['image'], $value['name']) . '</a> ';
  }
  echo $languages_string;
?>						  
			   </td></tr>
			   <tr><td height=3></td></tr>
			   <tr><td><img src=../images/m011.gif width=113 height=1></td></tr>
			   <tr><td height=3></td></tr>
			   <tr><td><span class=ml>Monedas:</span><br><br class=px2></td></tr>
			   <tr><td>
<? // CURRENCIES
    echo tep_draw_form('currencies', tep_href_link(basename($PHP_SELF), '', $request_type, false), 'get');
    reset($currencies->currencies);
    $currencies_array = array();
    while (list($key, $value) = each($currencies->currencies)) {
	  $currencies_array[] = array('id' => $key, 'text' => $value['title']);
    }
    $hidden_get_variables = '';
    reset($HTTP_GET_VARS);
    while (list($key, $value) = each($HTTP_GET_VARS)) {
	  if ( ($key != 'currency') && ($key != tep_session_name()) && ($key != 'x') && ($key != 'y') ) {
	    $hidden_get_variables .= tep_draw_hidden_field($key, $value);
	  }
    }
    echo tep_draw_pull_down_menu('currency', $currencies_array, $currency, 'onChange="this.form.submit();" style="width: 100%"') . $hidden_get_variables . tep_hide_session_id();
    echo '</form>';
   
?>			  
			   </td></tr>
			  </table>								   
			 </td>
			 <td width=1></td>
			 <td width=132 bgcolor=#EDEEF2>
			  <table cellspacing=0 cellpadding=0 align=center width=113>
			   <tr><td><img src=../images/m12.gif width=2 height=3 align=absmiddle> &nbsp; <a href=<?=tep_href_link('specials.php')?> class=ml>Ofertas</a><br><br class=px2></td></tr>
			   <tr><td><img src=../images/m12.gif width=2 height=3 align=absmiddle> &nbsp; <a href=<?=tep_href_link('advanced_search.php')?> class=ml>Buscar</a><br><br class=px2></td></tr>
			   <tr><td><img src=../images/m12.gif width=2 height=3 align=absmiddle> &nbsp; <a href=<?=tep_href_link('contact_us.php')?> class=ml>Cont&aacute;ctenos</a><br><br class=px2></td></tr>
			   <tr><td><img src=../images/m12.gif width=2 height=3 align=absmiddle> &nbsp; <a href=<?=tep_href_link('create_account.php')?> class=ml>Crear una cuenta</a><br><br class=px2></td></tr>
	  <tr><td><img src=images/m12.gif width=2 height=3 align=absmiddle> &nbsp; <?php
	  if (!tep_session_is_registered('customer_id')) {
	   echo '<a style="font-size:10px" href="' . tep_href_link('login.php') . '" class=ml>Mi cuenta</a>' ;
	   } else {
	    echo '<a style="font-size:10px" href="' . tep_href_link('logoff.php') . '" class=ml>Salir Cuenta</a>' ;
	    }
	 ?><br></td></tr>
			  
			  </table>								  
			 </td>
			 <td width=1></td>
			 <td width=149 bgcolor=#EDEEF2>
			  <table cellspacing=0 cellpadding=0 align=center width=117>
			   <tr><td height=20 colspan=2></td></tr>
			   <tr><td rowspan=2><a href=<?=tep_href_link('shopping_cart.php')?>><img src=../images/m13.gif width=22 height=22 border=0></a></td><td>&nbsp;<span class=ml>Mi</span></td></tr>
			   <tr><td colspan=2>&nbsp;<span class=ml>Carrito</span></td></tr>
			   <tr><td height=3 colspan=2></td></tr>
			   <tr><td colspan=2>En tu carro <a href=<?=tep_href_link('shopping_cart.php')?> class=ml><font color=#9F1A37><?=$cart->count_contents()?> art&iacute;culos</font></a></td></tr>
			   <tr><td height=15 colspan=2><div align="center"><a href="http://es-la.facebook.com/people/Jp-Relojes/100002032474147"><img src="http://jprelojes.com/images/facebook.jpg" alt="facebook" width="90" height="26" border="0" /></a></div></td>
			   </tr>
			  </table>						   
		  </td></tr>
		  <tr><td colspan=7 height=5></td></tr>						
	    </table>
	    <table cellspacing=0 cellpadding=0>
		 <tr><td width=205 valign=top>
			  <table cellspacing=0 cellpadding=0>
			   <tr><td height=6 colspan=3></td></tr>
			   <tr><td width=9></td>
				   <td width=176>
				    <table cellspacing=0 cellpadding=0 width=176>
					 <tr><td><a href=<?=tep_href_link('index.php')?>><img src=../images/m14.gif width=176 height=24 border=0></a><br><br class=px2></td></tr>					
					 <tr><td align=center><img src=../images/m11.gif width=113 height=1><br><br class=px2></td></tr>
					 <tr><td><a href=<?=tep_href_link('products_new.php')?>><img src=../images/m15.gif width=176 height=24 border=0></a><br><br class=px2></td></tr>					
					 <tr><td align=center><img src=../images/m11.gif width=113 height=1><br><br class=px2></td></tr>
					 <tr><td><a href=<?=tep_href_link('account.php')?>><img src=../images/m16.gif width=176 height=24 border=0></a><br><br class=px2></td></tr>					
					 <tr><td align=center><img src=../images/m11.gif width=113 height=1><br><br class=px2></td></tr>
					 <tr><td><a href=<?=tep_href_link('shopping_cart.php')?>><img src=../images/m17.gif width=176 height=24 border=0></a><br><br class=px2></td></tr>					
					 <tr><td align=center><img src=../images/m11.gif width=113 height=1><br><br class=px2></td></tr>
					 <tr><td><a href=<?=tep_href_link('checkout_shipping.php')?>><img src=../images/m18.gif width=176 height=24 border=0></a><br><br class=px2></td></tr>					
					 <tr><td align=center><img src=../images/m11.gif width=113 height=1><br><br class=px2></td></tr>
					 <tr><td height=8></td></tr>
				    </table>
				   </td>
				   <td width=20></td></tr>
			  </table>
			  <table cellspacing=0 cellpadding=0>
			   <tr><td><img src=../images/m04.gif width=24 height=24></td>
			   <td width=181 bgcolor=#EDEEF2 class="ca"> &nbsp; &nbsp;<span class="style2">CATALOGOS</span></td>
			   </tr>
			   <tr><td colspan=2 height=3></td></tr>
			  </table>
			  <table cellspacing=0 cellpadding=0>
			   <tr><td height=2 colspan=2></td></tr>
			   <tr><td width=9></td>
				   <td width=196>
				    <table cellspacing=2 cellpadding=0>					
					
<?   // ---- CATEGORIES
[color=#FF0000]    function tep_show_category($counter) {    [/color]  [color=#ff0000]  LINE 195[/color]
    global $tree, $categories_string, $cPath_array;
   if(!$tree[$counter]['level']){
    //$categories_string .= $categories_string ? '<tr><td colspan=2><img src=images/m13.gif width=169 height=1><br><br class=px3></td></tr>' : '';			
   
    $categories_string .= '<tr><td><img src=images/m05.gif width=14 height=15></td><td class=bg><a class=ml1 href=';
   
    if ($tree[$counter]['parent'] == 0) {
	  $cPath_new = 'cPath=' . $counter;
    } else {
	  $cPath_new = 'cPath=' . $tree[$counter]['path'];
    }
    $categories_string .= tep_href_link('index.php', $cPath_new) . '>';
// display category name
    $categories_string .= $tree[$counter]['name'];
    $categories_string .= '</a></td></tr>';
   }else{
    $categories_string .= '<tr><td></td><td class=bg>';
    for($i=0;$i<$tree[$counter]['level'];$i++)
	 $categories_string .= '&nbsp;';
   
    $categories_string .= '- <a class=ml3 href=';  
    if ($tree[$counter]['parent'] == 0) {
	  $cPath_new = 'cPath=' . $counter;
    } else {
	  $cPath_new = 'cPath=' . $tree[$counter]['path'];
    }
    $categories_string .= tep_href_link('index.php', $cPath_new) . '>';
// display category name
    $categories_string .= $tree[$counter]['name'];
    $categories_string .= '</a></td></tr>';
   } 
    if ($tree[$counter]['next_id'] != false) {
	  tep_show_category($tree[$counter]['next_id']);
[color=#ff0000]    }    (LINE 59)[/color]
  }
  define(TABLE_CATEGORIES, "categories");
  define(TABLE_CATEGORIES_DESCRIPTION, "categories_description");
  $categories_string = '';
  $tree = array();
  $categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = '0' and c.categories_id = cd.categories_id and cd.language_id='" . (int)$languages_id ."' order by sort_order, cd.categories_name");
  while ($categories = tep_db_fetch_array($categories_query))  {
    $tree[$categories['categories_id']] = array('name' => $categories['categories_name'],
											    'parent' => $categories['parent_id'],
											    'level' => 0,
											    'path' => $categories['categories_id'],
											    'next_id' => false);
    if (isset($parent_id)) {
	  $tree[$parent_id]['next_id'] = $categories['categories_id'];
    }
    $parent_id = $categories['categories_id'];
    if (!isset($first_element)) {
	  $first_element = $categories['categories_id'];
    }
  }
  //------------------------
  if ($cPath) {
    $new_path = '';
    reset($cPath_array);
    while (list($key, $value) = each($cPath_array)) {
	  unset($parent_id);
	  unset($first_id);
	  $categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = '" . (int)$value . "' and c.categories_id = cd.categories_id and cd.language_id='" . (int)$languages_id ."' order by sort_order, cd.categories_name");
	  if (tep_db_num_rows($categories_query)) {
	    $new_path .= $value;
	    while ($row = tep_db_fetch_array($categories_query)) {
		  $tree[$row['categories_id']] = array('name' => $row['categories_name'],
											   'parent' => $row['parent_id'],
											   'level' => $key+1,
											   'path' => $new_path . '_' . $row['categories_id'],
											   'next_id' => false);
		  if (isset($parent_id)) {
		    $tree[$parent_id]['next_id'] = $row['categories_id'];
		  }
		  $parent_id = $row['categories_id'];
		  if (!isset($first_id)) {
		    $first_id = $row['categories_id'];
		  }
		  $last_id = $row['categories_id'];
	    }
	    $tree[$last_id]['next_id'] = $tree[$value]['next_id'];
	    $tree[$value]['next_id'] = $first_id;
	    $new_path .= '_';
	  } else {
	    break;
	  }
    }
  }
  $categories_string .=  '';
  tep_show_category($first_element);
  $categories_string .=  '';
  echo $categories_string;
?>
					
					 <tr><td colspan=2 height=5></td></tr>
				    </table>
			   </td></tr>
			  </table>
			  <table cellspacing=0 cellpadding=0>
	 <tr><td><div align="center"><a>
	    <!-- Powered by: Crafty Syntax Live Help	    http://www.craftysyntax.com/ -->
			  </a></div>
		  <div id="craftysyntax">
		   <div align="center"><a>
			 <script type="text/javascript" src="/chat/livehelp_js.php?eo=1&relative=Y&amp;department=1&amp;serversession=1&amp;pingtimes=15"></script>
			  <br />
						  <font style="font-family: verdana, helvetica, sans-serif; font-size: 8px; color: #000000;">Powered By:</font> Servicio al Cliente</a></div>
		  </div>
		 <div align="center"><a>
		    <!-- copyright 2003 - 2011 by Eric Gerdes -->
		   </a></div></td></tr>
			   <tr><td height=5></td></tr>
			   <tr><td><a href=<?=tep_href_link('conditions.php')?>><img src=../images/m06.jpg width=205 height=69 border=0></a></td></tr>
			   <tr><td height=5></td></tr>
			   <tr><td><a href=<?=tep_href_link('conditionsa.php')?>><img src=../images/m07.jpg width=205 height=69 border=0></a></td></tr>
			   <tr><td height=5></td></tr>
	  <tr><td><a href=<?=tep_href_link(FILENAME_FORMULARIO2)?>><img src=../images/m071.jpg width=205 height=69 border=0></a></td></tr>
			   <tr><td height=5></td></tr>
	  <tr><td><a href=<?=tep_href_link('conditionsc.php')?>><img src=../images/m072.jpg width=205 height=69 border=0></a></td></tr>
	  <tr><td height=5></td></tr>
	  <tr><td><? include(DIR_WS_BOXES . 'scrolling_specials.php'); ?></td></tr>
			   <tr><td height=5></td></tr>
			   <tr><td><a href=<?=tep_href_link('specials.php')?>><img src=../images/m32.jpg width=205 height=130 border=0></a></td></tr>
			   <tr><td><? include(DIR_WS_BOXES . 'shop_by_price.php'); ?></td></tr>
			  
			  </table>
			 </td>
			 <td width=15 background=images/m21.gif width=15></td>
			 <td width=530 valign=top>
			  <table cellspacing=0 cellpadding=0>
			   <tr><td>	  <object
	    classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
	    codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0"
	    id="wilson_relojes"
	    width="530" height="157"
	  >
	    <param name="movie" value="promo.swf">
	    <param name="bgcolor" value="#FFFFFF">
	    <param name="quality" value="high">
	    <param name="allowscriptaccess" value="samedomain">
	    <embed
		  type="application/x-shockwave-flash"
		  pluginspage="http://www.adobe.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"
		  name="wilson_relojes"
		  width="530" height="157"
		  src="promo.swf"
		  bgcolor="#FFFFFF"
		  quality="high"
		  allowscriptaccess="samedomain"
	    >
		  <noembed>
		  </noembed>
	    </embed></object></td></tr>
			   <tr><td height=7></td></tr>
			  </table>
			 
			 <div id="fb-root"></div>
<script>(function(d, s, id) {
  var js, fjs = d.getElementsByTagName(s)[0];
  if (d.getElementById(id)) return;
  js = d.createElement(s); js.id = id;
  js.src = "//connect.facebook.net/es_LA/all.js#xfbml=1";
  fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
<div class="fb-like-box" data-href="http://www.facebook.com/pages/JPrelojescom/325036464186260" data-width="532" data-height="169" data-show-faces="true" data-stream="false" data-header="false"></div>



CATEGORIES


<?php
/*
$Id: categories.php,v 1.25 2003/07/09 01:13:58 hpdl Exp $

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

Copyright © 2003 osCommerce

Released under the GNU General Public License
*/

function tep_show_category($counter) {
global $tree, $categories_string, $cPath_array;

for ($i=0; $i<$tree[$counter]['level']; $i++) {
$categories_string .= "&nbsp;&nbsp;";
}

$categories_string .= '<a href="';

if ($tree[$counter]['parent'] == 0) {
$cPath_new = 'cPath=' . $counter;
} else {
$cPath_new = 'cPath=' . $tree[$counter]['path'];
}

$categories_string .= tep_href_link(FILENAME_DEFAULT, $cPath_new) . '">';

if (isset($cPath_array) && in_array($counter, $cPath_array)) {
$categories_string .= '<b>';
}

// display category name
$categories_string .= $tree[$counter]['name'];

if (isset($cPath_array) && in_array($counter, $cPath_array)) {
$categories_string .= '</b>';
}

if (tep_has_category_subcategories($counter)) {
$categories_string .= '-&gt;';
}

$categories_string .= '</a>';

if (SHOW_COUNTS == 'true') {
$products_in_category = tep_count_products_in_category($counter);
if ($products_in_category > 0) {
$categories_string .= '&nbsp;(' . $products_in_category . ')';
}
}

$categories_string .= '<br>';

if ($tree[$counter]['next_id'] != false) {
tep_show_category($tree[$counter]['next_id']);
}
}
?>
<!-- categories //-->
<tr>
<td>
<?php
$info_box_contents = array();
$info_box_contents[] = array('text' => BOX_HEADING_CATEGORIES);

new infoBoxHeading($info_box_contents, true, false);

$categories_string = '';
$tree = array();

$categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = '0' and c.categories_id = cd.categories_id and cd.language_id='" . (int)$languages_id ."' order by sort_order, cd.categories_name");
while ($categories = tep_db_fetch_array($categories_query)) {
$tree[$categories['categories_id']] = array('name' => $categories['categories_name'],
'parent' => $categories['parent_id'],
'level' => 0,
'path' => $categories['categories_id'],
'next_id' => false);

if (isset($parent_id)) {
$tree[$parent_id]['next_id'] = $categories['categories_id'];
}

$parent_id = $categories['categories_id'];

if (!isset($first_element)) {
$first_element = $categories['categories_id'];
}
}

//------------------------
if (tep_not_null($cPath)) {
$new_path = '';
reset($cPath_array);
while (list($key, $value) = each($cPath_array)) {
unset($parent_id);
unset($first_id);
$categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = '" . (int)$value . "' and c.categories_id = cd.categories_id and cd.language_id='" . (int)$languages_id ."' order by sort_order, cd.categories_name");
if (tep_db_num_rows($categories_query)) {
$new_path .= $value;
while ($row = tep_db_fetch_array($categories_query)) {
$tree[$row['categories_id']] = array('name' => $row['categories_name'],
'parent' => $row['parent_id'],
'level' => $key+1,
'path' => $new_path . '_' . $row['categories_id'],
'next_id' => false);

if (isset($parent_id)) {
$tree[$parent_id]['next_id'] = $row['categories_id'];
}

$parent_id = $row['categories_id'];

if (!isset($first_id)) {
$first_id = $row['categories_id'];
}

$last_id = $row['categories_id'];
}
$tree[$last_id]['next_id'] = $tree[$value]['next_id'];
$tree[$value]['next_id'] = $first_id;
$new_path .= '_';
} else {
break;
}
}
}
tep_show_category($first_element);

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

new infoBox($info_box_contents);
?>
</td>
</tr>
<!-- categories_eof //-->