Forums / Addon Sideboxes / Adding a New Blank Box to display Categoires

Adding a New Blank Box to display Categoires

Locked

Views: 1,223

Results 1 to 1 of 1
This thread is locked. New replies are disabled.
13 Oct 2008, 1:21 AM
#1
coolcarpartsonline avatar

coolcarpartsonline

Totally Zenned

Join Date:
Feb 2008
Posts:
1,386
Plugin Contributions:
0

Adding a New Blank Box to display Categoires

Hello
Iam trying to add a new side box to display the top categories as seperate side boxes. I started the testing on one Categorie on my site https://www.coolcarpartsonline.com Categorie "Performance Parts" ID 239. I was able to get hide the category from the categories sidebox. and Now trying to add content to the New Sidebox to display the Performance parts Categorie. The code I added in the performance_sidebox (I changed the name of the blank_sidebox)

<?php
/**
 * blank sidebox - allows a blank sidebox to be added to your site
 *
 * @package templateSystem
 * @copyright 2007 Kuroi Web Design
  * @copyright Portions Copyright 2003-2007 Zen Cart Development Team
 * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
 * @version $Id: blank_sidebox.php 2007-05-26 kuroi $
 */
/*************
stuff Sami added to use more performance box
******************/
  $categories_query_ap = "select c.categories_id, cd.categories_name, c.parent_id, c.categories_image
                             from categories c, categories_description cd
                             where c.categories_id = cd.categories_id 
                             and c.categories_status = 1 
							 and c.parent_id = 239
                             order by sort_order, cd.categories_name";

	$categories_ap = $db->Execute($categories_query_ap, '', true, 150);
	
	$add_content ='';
	
	while (!$categories_ap->EOF)  {
		$id = $categories_ap->fields['categories_id'];
		$name = $categories_ap->fields['categories_name'];
	  	$add_content .= '<li><a href="index.php?main_page=index&cPath='.$id.'" class="category-top">'.$name.'</a></li>' . "\n";
		
		$categories_ap->MoveNext();
	}
	
	unset($name);
	
/****************
end of additions
********************/
  // test if box should display
  $show_performance_sidebox = true;

  if ($show_performance_sidebox == true) {
      require($template->get_template_dir('tpl_performance_sidebox.php',DIR_WS_TEMPLATE, $current_page_base,'sideboxes'). '/tpl_performance_sidebox.php');
      $title =  BOX_HEADING_PERFORMANCE_SIDEBOX;
      $title_link = false;
      require($template->get_template_dir($column_box_default, DIR_WS_TEMPLATE, $current_page_base,'common') . '/' . $column_box_default);
 }
?>

I edited the following files:
category_tree
tpl_categories
tpl_main_page
Plus the files that came with the blank_sidebox Mod.
The sidebox appears on the site Iam just trying to tweak the code to have the content of the Performance Parts Side Box.