Page 1 of 2 12 LastLast
Results 1 to 10 of 20
  1. #1
    Join Date
    May 2014
    Location
    UK
    Posts
    317
    Plugin Contributions
    0

    Default Browsing through categories

    Good morning.

    This is probably a very simple change but I'm stuck at the moment!

    On our book library we have Genres (Categories) which have sub-categories for authors (manufacturers) so when you use the drop-down select a genre it then displays all the authors held within that genre. Selecting an author displays all their books.

    We would like an option to simply browse all books regardless of the author by selecting a genre.

    Any help would be greatly appreciated.

    Thanks

  2. #2
    Join Date
    Aug 2014
    Location
    Lisbon
    Posts
    594
    Plugin Contributions
    0

    Default Re: Browsing through categories

    This is related to Bookx module .... or Book by moku ?

    However I didn't quite understood the issue. You can try to post in the Bookx thread, maybe the author Philou will come up.
    I use a lot this module, so more or less I'm very familiar with the code, but when you say we have Genres (Categories) which have sub-categories for authors (manufacturers) I got lost

    Genres don't have tree relations, they work like tags.
    So maybe you mean Categories with subCategories and somehow you are using authors as manufactures ?

    So the filter you are using is the author's filter or manufacturer filter ?
    Anyway, Have you tried the option turn off the multiple filter ( if this is bookx related) ?

    Sorry, didn't really understood.
    “Though the problems of the world are increasingly complex, the solutions remain embarrassingly simple.” ― Bill Mollison

  3. #3
    Join Date
    May 2014
    Location
    UK
    Posts
    317
    Plugin Contributions
    0

    Default Re: Browsing through categories

    Quote Originally Posted by mesnitu View Post
    This is related to Bookx module .... or Book by moku ?

    However I didn't quite understood the issue. You can try to post in the Bookx thread, maybe the author Philou will come up.
    I use a lot this module, so more or less I'm very familiar with the code, but when you say we have Genres (Categories) which have sub-categories for authors (manufacturers) I got lost

    Genres don't have tree relations, they work like tags.
    So maybe you mean Categories with subCategories and somehow you are using authors as manufactures ?

    So the filter you are using is the author's filter or manufacturer filter ?
    Anyway, Have you tried the option turn off the multiple filter ( if this is bookx related) ?

    Sorry, didn't really understood.
    Hi.

    OK this is not BookX or Book by Moku. I tried BookX a long while back and it completely destroyed my database!!

    The way we use the system is based on the original V1.5.1 installation with a lot of bespoking. So where Zen-Cart has:

    Top-level category ==> Manufacturer ==> sub-categories

    we renamed it all to Genre (Top-level category) ==> Author (Manufacturer) ==> Book Series (sub-category).

    Does that help at all?

  4. #4
    Join Date
    Apr 2007
    Location
    Ontario, Canada
    Posts
    1,731
    Plugin Contributions
    27

    Default Re: Browsing through categories

    Where could one see this in real time?
    Twitch.
    https://www.twitchtoo.com Do you work for free? Please donate.
    Twitch Base8 - Obsidian - This, is what's new.

  5. #5
    Join Date
    May 2014
    Location
    UK
    Posts
    317
    Plugin Contributions
    0

    Default Re: Browsing through categories

    Hi All

    I have been following similar threads where people are having the same issue. Logically it should be simple enough but I am struggling to find the correct solution.

    To simplify my query:

    I have a list of Top-Level Categories at the top of each page:

    Click image for larger version. 

Name:	Capture.PNG 
Views:	18 
Size:	7.3 KB 
ID:	18313

    Clicking on 'Adult' takes me to http://digibooks.org.uk/db_155/index...index&cPath=31 (Adult has the categories_id of 31)

    This gives me a list of Authors under Top-Level category Adult:

    Click image for larger version. 

Name:	Capture2.PNG 
Views:	17 
Size:	2.9 KB 
ID:	18314

    Clicking on 'A J Carella' takes me to http://digibooks.org.uk/db_155/index...x&cPath=31_589 (where A J Carella is sub-catory 589)

    A J Carella has one series so clicking on that takes me to http://digibooks.org.uk/db_155/index...ath=31_589_590 (The Game Series)

    Click image for larger version. 

Name:	Capture3.PNG 
Views:	18 
Size:	4.6 KB 
ID:	18315

    Click image for larger version. 

Name:	Capture4.PNG 
Views:	21 
Size:	14.1 KB 
ID:	18316

    The first Book 'The Game' links to http://digibooks.org.uk/db_155/index...oducts_id=6377 and so on.

    OK most of our users quite like this technique. They can see a list of series for any given author under a specific category. They can also pull up all books by A J Carella by using the drop-down menu in the Manufacturers sidebox.

    A lot of users simply want to browse all books listed under 'Adult' So here is where my question comes in. Is there any way through an adjusted hyperlink that clicking on 'Adult' at Top-Level could simply display all books that are associated with Top_Level categories_id=31 irrespective of author or series?

    If there is I then understand that we lose the display of series listings per author. So maybe there might also be a way by maybe adding a field in the database of creating a drop-down sidebox for Series per Top-Level category?

    I know that there is a specific BookX template (still in Beta I believe) that I tried a couple of years ago and it completely destroyed my databases!! I am therefore not confident enough to try that again.

    This website is just a test site getting V155 ready for production so does look messy but is accessible by all.

    Thanks for any advice that you may be able to give me.

  6. #6
    Join Date
    Aug 2014
    Location
    Lisbon
    Posts
    594
    Plugin Contributions
    0

    Default Re: Browsing through categories

    So, basically, you want to link to the last subcat no matter what ?
    That would be in your:
    \zencart\includes\modules\categories_tabs.php ( I've checked on zc 156)

    Just for test purposes, try this. At least will give you an idea.
    This is for the top tab category list
    If cpath is not set it will link to the last child.
    If is set, it will link to the top category ( I guess ... didn't test all )
    that $subcategories_array has the child's categories ID.
    Maybe this works, if you follow the same category configuration.

    PHP Code:
    while (!$categories_tab->EOF) {
        
    $path $categories_tab->fields['categories_id'];
        
    // currently selected category
        
    if ((int) $cPath == $categories_tab->fields['categories_id']) {
            
    $new_style 'category-top';
            
    $categories_tab_current '<span class="category-subs-selected">' $categories_tab->fields['categories_name'] . '</span>';
        } else {
            
    $new_style 'category-top';
            
    $categories_tab_current $categories_tab->fields['categories_name'];
            
    $subcategories_array = array();
            
    zen_get_subcategories($subcategories_array$categories_tab->fields['categories_id']);
            if (!empty(
    $subcategories_array)) {
                
    $path $categories_tab->fields['categories_id'] . '_' implode('_'$subcategories_array);
            }
        }

        
    // create link to top level category
        
    $links_list[] = '<a class="' $new_style '" href="' zen_href_link(FILENAME_DEFAULT'cPath=' $path) . '">' $categories_tab_current '</a> ';
        
    //$links_list[] = '<a class="' . $new_style . '" href="' . zen_href_link(FILENAME_DEFAULT, 'cPath=' . (int)$categories_tab->fields['categories_id']) . '">' . $categories_tab_current . '</a> ';

        
    $categories_tab->MoveNext();

    And ofcourse , as always, probably there is a better way
    Last edited by mesnitu; 3 Feb 2019 at 02:09 PM.
    “Though the problems of the world are increasingly complex, the solutions remain embarrassingly simple.” ― Bill Mollison

  7. #7
    Join Date
    Aug 2014
    Location
    Lisbon
    Posts
    594
    Plugin Contributions
    0

    Default Re: Browsing through categories

    But this is very restrictive If you need to use something else on those tabs ( some other cat path)
    “Though the problems of the world are increasingly complex, the solutions remain embarrassingly simple.” ― Bill Mollison

  8. #8
    Join Date
    May 2014
    Location
    UK
    Posts
    317
    Plugin Contributions
    0

    Default Re: Browsing through categories

    Thanks. I will give that a try.

    I think the problem is that with the conglomeration of Zen-Cart contributors, the databases have been maybe over-complicated.

    I was brought up 40 years ago on a mainframe programming simple database relationships.

    In this case I would have:

    Top-Level categories

    Sub-Categories

    Manufacturers

    Series

    Products

    Just 5 database tables with all the information.

    I am thinking that I may create these tables .. export the data and then try to integrate them into Zen-Cart.

    I cannot get my head around why we have products .. products descriptions ... products to descriptions etc. There should be ... from past programming .. one products file with all the information???

    Please don't get me wrong .. I love Zen-Cart but just think that the database structure is totally wrong causing difficulties in trying to make the system customised.

  9. #9
    Join Date
    Aug 2014
    Location
    Lisbon
    Posts
    594
    Plugin Contributions
    0

    Default Re: Browsing through categories

    normally tables like products_descriptions have languages.
    So product_id is not unique because the description can exist in various languages

    On products table , the pID is unique.

    You've made a very specific workaround to get things done for your needs.
    So, you have to tweak a bit
    “Though the problems of the world are increasingly complex, the solutions remain embarrassingly simple.” ― Bill Mollison

  10. #10
    Join Date
    May 2014
    Location
    UK
    Posts
    317
    Plugin Contributions
    0

    Default Re: Browsing through categories

    Quote Originally Posted by mesnitu View Post
    So, basically, you want to link to the last subcat no matter what ?
    That would be in your:
    \zencart\includes\modules\categories_tabs.php ( I've checked on zc 156)

    Just for test purposes, try this. At least will give you an idea.
    This is for the top tab category list
    If cpath is not set it will link to the last child.
    If is set, it will link to the top category ( I guess ... didn't test all )
    that $subcategories_array has the child's categories ID.
    Maybe this works, if you follow the same category configuration.

    PHP Code:
    while (!$categories_tab->EOF) {
        
    $path $categories_tab->fields['categories_id'];
        
    // currently selected category
        
    if ((int) $cPath == $categories_tab->fields['categories_id']) {
            
    $new_style 'category-top';
            
    $categories_tab_current '<span class="category-subs-selected">' $categories_tab->fields['categories_name'] . '</span>';
        } else {
            
    $new_style 'category-top';
            
    $categories_tab_current $categories_tab->fields['categories_name'];
            
    $subcategories_array = array();
            
    zen_get_subcategories($subcategories_array$categories_tab->fields['categories_id']);
            if (!empty(
    $subcategories_array)) {
                
    $path $categories_tab->fields['categories_id'] . '_' implode('_'$subcategories_array);
            }
        }

        
    // create link to top level category
        
    $links_list[] = '<a class="' $new_style '" href="' zen_href_link(FILENAME_DEFAULT'cPath=' $path) . '">' $categories_tab_current '</a> ';
        
    //$links_list[] = '<a class="' . $new_style . '" href="' . zen_href_link(FILENAME_DEFAULT, 'cPath=' . (int)$categories_tab->fields['categories_id']) . '">' . $categories_tab_current . '</a> ';

        
    $categories_tab->MoveNext();

    And ofcourse , as always, probably there is a better way
    Thanks, But this doesn't work in 155 just a white screen

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. Replies: 1
    Last Post: 9 May 2011, 05:12 PM
  2. Something is going wrong when browsing through categories
    By goalsurfer in forum General Questions
    Replies: 7
    Last Post: 7 Nov 2010, 06:00 AM
  3. Replies: 3
    Last Post: 13 Jul 2009, 05:23 PM
  4. Browsing Categories
    By tameboy in forum Templates, Stylesheets, Page Layout
    Replies: 8
    Last Post: 5 Feb 2008, 10:15 PM
  5. having trouble when browsing through categories
    By blackinches in forum Setting Up Categories, Products, Attributes
    Replies: 1
    Last Post: 20 Dec 2006, 01:05 AM

Bookmarks

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
Zen-Cart, Internet Selling Services, Klamath Falls, OR