Results 1 to 10 of 23

Hybrid View

  1. #1
    Join Date
    Jan 2004
    Posts
    66,446
    Plugin Contributions
    81

    Default Re: how to extract subcategories????

    Quote Originally Posted by paddy_uk2007 View Post
    but i have looked at them and can not find what it is i need to add the pull the child categories
    it builds a list of all categories and subcategories, starting with the children of "0" which is the very top level category in ZC v1.x.x.
    For 4 specific categories that would mean you would just call it 4 times, each time feeding it the category number you want it to return results for.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  2. #2
    Join Date
    Aug 2007
    Posts
    95
    Plugin Contributions
    0

    Default Re: how to extract subcategories????

    Quote Originally Posted by DrByte View Post
    it builds a list of all categories and subcategories, starting with the children of "0" which is the very top level category in ZC v1.x.x.
    For 4 specific categories that would mean you would just call it 4 times, each time feeding it the category number you want it to return results for.
    Thanks i will look into it now and see if i can figure it out, I will post back how i get on ;)

  3. #3
    Join Date
    Aug 2007
    Posts
    95
    Plugin Contributions
    0

    Default extract sub category for dropdown menu?

    Hi all am still stuck on this one, ive manage to extract all the subcategories for every category but i need to know how to just extract the sub cats for a set category. this is the code i have that extracts all the shop sub cats.

    Code:
    <?php
    if (CATEGORIES_TABS_STATUS == '0') 
    {
    	echo '<ul>';
    
    	$categories_tab_query = "SELECT c.categories_id, cd.categories_name FROM ".TABLE_CATEGORIES." c, ".TABLE_CATEGORIES_DESCRIPTION . " cd WHERE c.categories_id=cd.categories_id AND c.parent_id= '0' AND cd.language_id='" . (int)$_SESSION['languages_id'] . "' AND c.categories_status='1' ORDER BY c.sort_order, cd.categories_name;";
    	$categories_tab = $db->Execute($categories_tab_query);
    
    	while (!$categories_tab->EOF) 
    	{
    		$subcategories_tab_query="SELECT c.categories_id, cd.categories_name FROM ".TABLE_CATEGORIES." c, ".TABLE_CATEGORIES_DESCRIPTION . " cd WHERE c.categories_id=cd.categories_id AND c.parent_id= '".(int)$categories_tab->fields['categories_id']."' AND cd.language_id='" . (int)$_SESSION['languages_id'] . "' AND c.categories_status='1' ORDER BY c.sort_order, cd.categories_name;";
    		$subcategories_tab=$db->Execute($subcategories_tab_query);
    		if($subcategories_tab->RecordCount()>0)
    		{
    			echo '<ul>';
    			while (!$subcategories_tab->EOF) 
    			{
    				$cPath_new=zen_get_path($subcategories_tab->fields['categories_id']);
    				$cPath_new=str_replace('=0_', '=', $cPath_new);
    				echo '<li>'.'<a href="' . zen_href_link(FILENAME_DEFAULT, $cPath_new) . '">'.$subcategories_tab->fields['categories_name'].'</a></li><br />';
    				$subcategories_tab->MoveNext();
    			}
    			echo '</ul>';
    		}
    		echo '</li>';
    		$categories_tab->MoveNext();
    	}
    	echo '</ul>';
    }
    ?>
    what part of that code would i change if i wanted to just extract the subcategories for one of my categories (category id 31)

    It must be possible to change that code so it only shows the sub cats for my category with the id of 31.

    Please can someone help
    thanks

  4. #4
    Join Date
    Oct 2010
    Posts
    11
    Plugin Contributions
    0

    Default Re: How do i get a category pulldown menu????

    I too am dying to know these things about fly out/ drop down menus. But i am not even a new bee yet so....in the weekend i'll be trying to upload a template and try to change the menu to a flyout or dropdown menu. fingers crossed.

 

 

Similar Threads

  1. Replies: 1
    Last Post: 5 May 2014, 12:26 PM
  2. How do I get the UK counties to automatically show as a pulldown?
    By wizer in forum Currencies & Sales Taxes, VAT, GST, etc.
    Replies: 3
    Last Post: 16 Jun 2011, 11:23 AM
  3. Pulldown menu question: How to make first option not orderable?
    By datatv in forum Setting Up Categories, Products, Attributes
    Replies: 2
    Last Post: 13 Oct 2008, 03:58 AM
  4. Flyout or Pulldown Menu Needed - How?
    By bekinky in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 1 Feb 2007, 07:54 PM
  5. Staes Pulldown Menu
    By JollyJim in forum Templates, Stylesheets, Page Layout
    Replies: 13
    Last Post: 19 Jun 2006, 11:56 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg