Forums / All Other Contributions/Addons / Simple Category Tree

Simple Category Tree

Views: 97,118

Results 201 to 220 of 249
10 Mar 2009, 12:53 PM
#201
heathenmagic avatar

heathenmagic

Totally Zenned

Join Date:
May 2005
Location:
England
Posts:
733
Plugin Contributions:
0

Simple Category Tree

Hello yellow1912

I would be interested in this new version please. I am trying to achieve a flyout header (which I managed with your over version). And also a sidebox which gets the cpath and display the subcategories under that cpath / master category. I struggled on that, but I know it was my PHP knowledge that failed. lol.

Thanks,

Heathenmagic :smile:

11 Mar 2009, 1:16 AM
#202
yellow1912 avatar

yellow1912

Totally Zenned

Join Date:
Oct 2006
Posts:
5,422
Plugin Contributions:
0

Re: Simple Category Tree

HeathenMagic:

Hello yellow1912

I would be interested in this new version please. I am trying to achieve a flyout header (which I managed with your over version). And also a sidebox which gets the cpath and display the subcategories under that cpath / master category. I struggled on that, but I know it was my PHP knowledge that failed. lol.

Thanks,

Heathenmagic :smile:
Here you go. Warning: I have changed class function/method names a bit, so peek into the class for more info.

I no longer provide installation support on forum for all my modules. However, if there are real bugs with the modules please feel free to contact me

26 Mar 2009, 9:33 PM
#203
limelites avatar

limelites

Totally Zenned

Join Date:
Jan 2009
Posts:
2,085
Plugin Contributions:
0

Re: Simple Category Tree

Just writing to say a big thank you for the "all_sub_cats_products" mod. I just installed it and it worked an absolute treat, first time around with zero glitches. PERFECTO!!

Why isn't this available to download in the main downloads area?! It's too useful not to be!!

24 Apr 2009, 3:30 PM
#204
ryska avatar

ryska

New Zenner

Join Date:
Apr 2005
Location:
Louny, Czech Republic
Posts:
50
Plugin Contributions:
0

Re: Simple Category Tree

Hi yellow1912, nice module. But in center column not showing navigation (name sub-category or image) for others subcategories. Is possibility their display?

JardaR

2 May 2009, 5:13 PM
#205
neboztik avatar

neboztik

New Zenner

Join Date:
Jan 2009
Location:
Czech Republic
Posts:
59
Plugin Contributions:
0

Re: Simple Category Tree

ryska:

Hi yellow1912, nice module. But in center column not showing navigation (name sub-category or image) for others subcategories. Is possibility their display?
In file "/includes/templates/YOURTEMPLATE/templates/tpl_index_product_list.php" find this line:

<?php } // categories_description ?>

BELOW this line, paste the following code :

<!-- BOF: Display grid of available sub-categories, if any -->
<?php
  if (PRODUCT_LIST_CATEGORY_ROW_STATUS == 0) {
    // do nothing
  } else {
    // display subcategories
/**
 * require the code to display the sub-categories-grid, if any exist
 */
   require($template->get_template_dir('tpl_modules_category_row.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_modules_category_row.php');
  }
?>
<!-- EOF: Display grid of available sub-categories -->

In file "/includes/modules/pages/index/main_template_vars.php" find this line:
$tpl_page_body = 'tpl_index_product_list.php';
ABOVE this line, paste the following code :

	/* ---------------- BOF - THIS MAKES SUB-CATS WORK -------------------- */
	  $sql = "SELECT cd.categories_name, c.categories_image
	          FROM   " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd
	          WHERE      c.categories_id = :categoriesID
	          AND        cd.categories_id = :categoriesID
	          AND        cd.language_id = :languagesID
	          AND        c.categories_status= '1'";
	
	  $sql = $db->bindVars($sql, ':categoriesID', $current_category_id, 'integer'); 
	  $sql = $db->bindVars($sql, ':languagesID', $_SESSION['languages_id'], 'integer'); 
	  $category = $db->Execute($sql);
	
	  if (isset($cPath) && strpos($cPath, '_'))
	  {
	    // check to see if there are deeper categories within the current category
	    $category_links = array_reverse($cPath_array);
	    for($i=0, $n=sizeof($category_links); $i<$n; $i++)
	    {
	      $sql = "SELECT count(*) AS total
	              FROM   " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd
	              WHERE      c.parent_id = :parentID 
	              AND        c.categories_id = cd.categories_id
	              AND        cd.language_id = :languagesID
	              AND        c.categories_status= '1'";
	
	      $sql = $db->bindVars($sql, ':parentID', $category_links[$i], 'integer'); 
	      $sql = $db->bindVars($sql, ':languagesID', $_SESSION['languages_id'], 'integer'); 
	      $categories = $db->Execute($sql);
	
	      if ($categories->fields['total'] < 1)
	      {
	        // do nothing, go through the loop
	      } else {
	        $categories_query = "SELECT c.categories_id, cd.categories_name, c.categories_image, c.parent_id
	                             FROM   " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd
	                             WHERE      c.parent_id = :parentID
	                             AND        c.categories_id = cd.categories_id 
	                             AND        cd.language_id = :languagesID 
	                             AND        c.categories_status= '1' 
	                             ORDER BY   sort_order, cd.categories_name";
	
	        $categories_query = $db->bindVars($categories_query, ':parentID', $category_links[$i], 'integer');
	        $categories_query = $db->bindVars($categories_query, ':languagesID', $_SESSION['languages_id'], 'integer'); 
	        break; // we've found the deepest category the customer is in
	      }
	    }
	  } else {
	    $categories_query = "SELECT c.categories_id, cd.categories_name, c.categories_image, c.parent_id
	                         FROM   " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd
	                         WHERE      c.parent_id = :parentID
	                         AND        c.categories_id = cd.categories_id
	                         AND        cd.language_id = :languagesID
	                         AND        c.categories_status= '1'
	                         ORDER BY   sort_order, cd.categories_name";
	
	    $categories_query = $db->bindVars($categories_query, ':parentID', $current_category_id, 'integer');
	    $categories_query = $db->bindVars($categories_query, ':languagesID', $_SESSION['languages_id'], 'integer'); 
	  }
	  $categories = $db->Execute($categories_query);
	  $number_of_categories = $categories->RecordCount();
	  $new_products_category_id = $current_category_id;  
	  
	/* ---------------- EOF - THIS MAKES SUB-CATS WORK -------------------- */

This modification was based on bodyjewelrystores code. I haven´t had problems with displaying names of sub-category or image. I hope it will solve your problem.

3 May 2009, 5:47 PM
#206
ryska avatar

ryska

New Zenner

Join Date:
Apr 2005
Location:
Louny, Czech Republic
Posts:
50
Plugin Contributions:
0

Re: Simple Category Tree

to neboztik: Thanx, I have a look in it.

JardaR

7 May 2009, 10:06 PM
#207
neboztik avatar

neboztik

New Zenner

Join Date:
Jan 2009
Location:
Czech Republic
Posts:
59
Plugin Contributions:
0

Re: Simple Category Tree

Hi, I used my code listed above and I have one big problem. When I click on manufacture link it brings me on the main page instead of products manufacture listing. Can smb help?

19 Oct 2009, 3:24 PM
#208
mkonchalski avatar

mkonchalski

New Zenner

Join Date:
Dec 2008
Posts:
18
Plugin Contributions:
0

Re: Simple Category Tree

So I ran into an interesting problem. I have installed the "all_sub_cats_products" mod, and it works wonderfully. However I noticed one little problem...

I added two new sub categories today, and the products don't show up as they are supposed to. I am not sure what to do. The site is also on local host, which is another issue so I can't post a link :(.

I'd appreciate if anyone can guide me in the right direction on how to get my new products to show up.

28 Oct 2009, 4:45 AM
#209
hey_you avatar

hey_you

New Zenner

Join Date:
Sep 2009
Posts:
49
Plugin Contributions:
0

Re: Simple Category Tree

Does anyone else get this error after uploading the autoloader?

[28-Oct-2009 00:40:35] PHP Fatal error: Call to a member function init() on a non-object in /home/xyz.com/zen/includes/autoload_func.php on line 90

29 Dec 2009, 7:04 AM
#210
vandiermen avatar

vandiermen

Totally Zenned

Join Date:
Feb 2007
Posts:
518
Plugin Contributions:
1

Re: Simple Category Tree

Hello,
I and 5 other people I have seen in the forum are looking for a way to list sub category products in the main category.

I added the simple_categories_tree.php and config.simple_categories_tree.php from yellow1912's list zip file
http://www.zen-cart.com/forum/showpost.php?p=697991&postcount=204

Can anyone tell me what else I have to do to list all products of each subcategory when click main category ? :lookaroun

P.s. I did not get an error when I added these files, but that is all I did(add these files).

30 Jan 2010, 12:27 PM
#211
gabone avatar

gabone

New Zenner

Join Date:
Jan 2010
Posts:
2
Plugin Contributions:
0

Re: Simple Category Tree

Hi yellow1912,

I seem to have a problem with the simple category tree. It seems that every subcategory that has an ID over 125 is displaying a different path causing the categories tree to collapse. Here is an example:

I have this category:

http://www.thegift.ro/zencart/cadouri-pentru-birou-c-23

and most of the subcategories are listed as (which are fine):

http://www.thegift.ro/zencart/calculatoare-c-23_74

except two of them:

http://www.thegift.ro/zencart/1-c-127
http://www.thegift.ro/zencart/7-c-126

It seems like they are top categories, but they are subcategories of category ID 23. I read this thread over and over again but I did not find any useful comments. One user seemed to have the same problem but nobody replied to that (maybe I missed it). Any help will be greatly appreciated.

Thank you,
Gabriel

30 Jan 2010, 9:03 PM
#212
brady avatar

brady

New Zenner

Join Date:
May 2007
Location:
Czech
Posts:
1
Plugin Contributions:
0

Re: Simple Category Tree

focus360:

I have the all products in sub-categories installed, and all is working great. However I have just noticed that, the sort order is not functioning. It always displays the products alphabetically until it reaches the deepest sub-cat when it shows the products as they should be (by sort order).

Is this an error in my installation or are you not able to display via sort order when all products in sub-cats are being displayed?

I have same problem, I have installed this module, all is working fine, but in first categori not working manufacturers sort by :O((

Can you help me what change, please:(

31 Jan 2010, 8:51 AM
#213
gabone avatar

gabone

New Zenner

Join Date:
Jan 2010
Posts:
2
Plugin Contributions:
0

Re: Simple Category Tree

Hi,

The problem seemed to have a different cause. I started creating new categories with lower ID number but that did not solve the problem. I even noticed that the newly created categories had different links, some of them having links to deleted categories. So I started looking for a cache. After deleting the contents (files, not directories) of the cache everything was working perfect, event the old categories.. :)

Regards,
Gabriel

6 Feb 2010, 6:54 PM
#214
scytheuk avatar

scytheuk

New Zenner

Join Date:
Apr 2009
Posts:
42
Plugin Contributions:
0

Re: Simple Category Tree

gabone:

Hi,

The problem seemed to have a different cause. I started creating new categories with lower ID number but that did not solve the problem. I even noticed that the newly created categories had different links, some of them having links to deleted categories. So I started looking for a cache. After deleting the contents (files, not directories) of the cache everything was working perfect, event the old categories.. :)

Regards,
Gabriel

Im having a similar issue, where products from sub cat's have been showing when clicking main cat, but it appears to not be working with the most recents cats ive added.

What cache did u delete and where?

Pete

27 Feb 2010, 12:37 AM
#215
mkonchalski avatar

mkonchalski

New Zenner

Join Date:
Dec 2008
Posts:
18
Plugin Contributions:
0

Re: Simple Category Tree

Try This...

In the Includes / Classes folder open the file SIMPLE_CATEGORIES_TREE.PHP and set the first line of code it says....

define ('SCT_REBUILD_TREE','false');

Change that line to:

define ('SCT_REBUILD_TREE','true');

That should do the trick for you.

27 Feb 2010, 3:13 PM
#216
sebastiankozub avatar

sebastiankozub

New Zenner

Join Date:
Feb 2010
Posts:
10
Plugin Contributions:
0

Re: Simple Category Tree

hi,
i'd like to read svn repositories and documentation but i can't open the link i have found this thread

27 Feb 2010, 4:11 PM
#217
sebastiankozub avatar

sebastiankozub

New Zenner

Join Date:
Feb 2010
Posts:
10
Plugin Contributions:
0

Re: Simple Category Tree

hey_you:

[28-Oct-2009 00:40:35] PHP Fatal error: Call to a member function init() on a non-object in /home/xyz.com/zen/includes/autoload_func.php on line 90

I have the same problem... I looks like the autoloader works for me but I get this fatal error as well

Any help?

17 Mar 2010, 10:06 PM
#218
patrick24601 avatar

patrick24601

New Zenner

Join Date:
Jan 2010
Posts:
17
Plugin Contributions:
0

Re: Simple Category Tree

I have downloaded this and installed it on my site. I need to go back and read up on how to config because I don't see a difference yet.

Has this been tested with the multi-site module?

Get Social With Me! ->Blog
No Zen Cart yet - but a girl can dream right?

28 Mar 2010, 12:59 PM
#219
damiantaylor avatar

damiantaylor

Zen Follower

Join Date:
Aug 2009
Posts:
244
Plugin Contributions:
0

Re: Simple Category Tree

Thanks for this great mod, it has made it so easy to get my nav buttons looking great :clap:

I've just noticed a small bug....when I click on Specials, the page reloads but the specials button doesn't have the 'current' class applied to it like all the other buttons do.

I'm going through the code looking for a fix but I'm no php programmer!
If I find the problem I'll post the solution here. In the mean time, does anybody already have a fix?