Page 1 of 8 123 ... LastLast
Results 1 to 10 of 76
  1. #1
    Join Date
    Sep 2008
    Location
    Cleethorpes
    Posts
    1,227
    Plugin Contributions
    6

    red flag Display child categories of a parent in categories sidebar

    I want to display sub categories of a parent category only in the categories sidebox tpl_catergories.php

    So sub categories of a single parent id

    And not display/hide other parent and child categories

    how would i do this?
    Nick Smith - Venture Design and Print
    https://venturedesignandprint.co.uk

  2. #2
    Join Date
    Jun 2005
    Location
    Cumbria, UK
    Posts
    10,263
    Plugin Contributions
    3

    Default Re: Display child categories of a parent in categories sidebar

    Glenn Herbert is the person to ask. He's done a lot of work on category displays using css.

    But this may not be good for the UX... In many ways, the display of a parent category, with its associated "tree" of child categories provides the viewer with a good degree of navigational logic. It's the same effect as breadcrumbs (which Google now regards as an important part of page display and applies ranking criteria in its algorithms for this).

    Think rather of how PEOPLE will use the site, not so much as to what you personally "like / dislike". Remember... (and has been researched by people like Jacob Nielsen, and organisations like Forrester) navigational logic must be quickly understood by a first-time visitor. Good, visible hierarchy logic can reduce bounce rate by a considerable %.
    20 years a Zencart User

  3. #3
    Join Date
    Sep 2008
    Location
    Cleethorpes
    Posts
    1,227
    Plugin Contributions
    6

    Default Re: Display child categories of a parent in categories sidebar

    Quote Originally Posted by schoolboy View Post
    Glenn Herbert is the person to ask. He's done a lot of work on category displays using css.

    But this may not be good for the UX... In many ways, the display of a parent category, with its associated "tree" of child categories provides the viewer with a good degree of navigational logic. It's the same effect as breadcrumbs (which Google now regards as an important part of page display and applies ranking criteria in its algorithms for this).

    Think rather of how PEOPLE will use the site, not so much as to what you personally "like / dislike". Remember... (and has been researched by people like Jacob Nielsen, and organisations like Forrester) navigational logic must be quickly understood by a first-time visitor. Good, visible hierarchy logic can reduce bounce rate by a considerable %.
    Ok let me explain. I have three carts that all use the same database. Each cart has its own categories, but it would be confusing to display categories from Cart A in Cart B and vice versa.

    I have tried using multi cart to associate categories to the correct cart, but this doesn't work as multi cart relies on using a different template for each cart and because each cart uses the same database I cannot change templates. The only way I can use multi cart is by using different domain names for each cart, however each cart has to have its own directory under one domain name. Multi cart won't work with sub directories, I have tried this route and came to the conclusion that it was easier just to duplicate one cart three times with the same configuration files.

    The problem with this is that all categories display in all carts. So, if I associate Cart A Categories with a Cart A Parent then I can display Cart A Parents Child Categories in Cart A. The same would be done for Cart B, and Cart C.

    Unless you know of a different way to associate different categories to different carts using one database? I did think about applying a class so I could hide categories in the stylesheet. But of course if there's a cleaner and better way to do this with PHP that would be best.
    Nick Smith - Venture Design and Print
    https://venturedesignandprint.co.uk

  4. #4
    Join Date
    Jun 2005
    Location
    Cumbria, UK
    Posts
    10,263
    Plugin Contributions
    3

    Default Re: Display child categories of a parent in categories sidebar

    Off the top of my head it would appear that the way to do this would be to put additional fields into various dbase tables that act as "flags". As the PHP for each "webshop" is independent of the others, vital "customisation" of what is called and rendered is governed by these flags.

    So, regarding categories for example... If you have three sites, then there would be an extra field in the categories table for each of the three front-ends - an additional 3 fields.

    Then, when the php calls for display of categories, it will be bound by the "flags" that are relative to the front-end in question. If it sees "yes" in that front-end's corresponding category field, it renders the category.

    But... it's not so simple... How do you deal with "search" and "display all products" ??? every relational function needs to first reference a "flag", before it executes the call to select relevant data.

    A lot of work... and one would need a really superior understanding of the relational nature of the dbase.

    "sticking plaster" solutions' like fancy css, won't work for global functions such as "search".
    20 years a Zencart User

  5. #5
    Join Date
    Sep 2008
    Location
    Cleethorpes
    Posts
    1,227
    Plugin Contributions
    6

    Default Re: Display child categories of a parent in categories sidebar

    Ok well I don't really want to go down the CSS route unless I am absolutely forced as like you say its a sticking plaster solution. In a sense I'm not really that bothered if the search returns items associated items from the other carts, as I see that as a type of cross selling. I could have different databases for each cart which of course would get around the problem, but that means the user would have to have different logins for each cart, which isn't ideal under the same domain name. And I am not using display all products so that isn't an issue. As the carts are for my own project and not a client I don't mind that I wouldn't be able to use display all products. So really I just need to be able to display categories in the sidebar associated with the cart they are associated with. I could do it like you say, that does seem a rather long way around doing it though. I'd have thought it would be easier to use something like you have in wordpress with conditional tags. Which would read something like if_is_cartA display_categories (1,2,3,4 etc) or display_child_of_parent_category (1)
    Nick Smith - Venture Design and Print
    https://venturedesignandprint.co.uk

  6. #6
    Join Date
    Jun 2005
    Location
    Cumbria, UK
    Posts
    10,263
    Plugin Contributions
    3

    Default Re: Display child categories of a parent in categories sidebar

    As you don't give much away as to what you are trying to achieve with this set up, it's really difficult to know how to address it. About 12 years ago I had a client who wanted "multiple sites" drawing data (certain bits) off a common database, and not drawing certain bits off that database.

    Zencart, fundamentally, is not designed to operate like this - and even that clunky and bloated multi-site module does not even come close to offering the kind of "independence" such a structure requires.

    You have a raft of issues that relate to what happens when users do certain things - such as register and login... After logging in, where will they end up? How do you keep login "common", but keep the customer on one site? What happens with the session ID? What happens if a customer switches to one of the other front ends (believing it to be a different site) - what happens to the session? When they sign up or checkout, how is the system going to send them a confirmation email that (legally) represents the seller - both in terms of brand ID as well as Distance Selling Regulations and the eCommerce Directive. How will you handle canonicalisation, and things like HTTPS, which are domain-dependent? Such a structure is unlikely to pass PCI-DSS scans

    There are hundreds of considerations that go way beyond css... and I don't think you're paying much attention to the raft of issues that relate to running multi-sites off a single database.

    Worst scenario is that it ends up confusing customers - who either won't bother checking out, or if they manage to get that far, won't return.

    Basically, zencart is not designed to operate this way... but good luck. I think you're trying to build a space shuttle to take a ride down to the corner shop.
    20 years a Zencart User

  7. #7
    Join Date
    Jun 2005
    Location
    Cumbria, UK
    Posts
    10,263
    Plugin Contributions
    3

    Default Re: Display child categories of a parent in categories sidebar

    Another scenario...

    Customer logs into Site A and adds to cart, then logs out (saving the cart happens automatically). Then customer goes to Site B and guess what... ? Products in cart are from Site A, so when they add to cart from Site B, they see Site A's products as well... and again.... the session Id is messed up. The thing will fall over - and the customer will just abandon it.
    20 years a Zencart User

  8. #8
    Join Date
    Sep 2008
    Location
    Cleethorpes
    Posts
    1,227
    Plugin Contributions
    6

    Default Re: Display child categories of a parent in categories sidebar

    LOL....I don't mind if customers switch from one site to another as the products are related. I am not building a space shuttle, just want an answer to what I asked in my question. I think your over complicating it in your head. I just want an answer to my question.
    Nick Smith - Venture Design and Print
    https://venturedesignandprint.co.uk

  9. #9
    Join Date
    Sep 2008
    Location
    Cleethorpes
    Posts
    1,227
    Plugin Contributions
    6

    Default Re: Display child categories of a parent in categories sidebar

    The products are related so there wouldn't be a problem if they jumped from site a to site b.
    Nick Smith - Venture Design and Print
    https://venturedesignandprint.co.uk

  10. #10
    Join Date
    Sep 2008
    Location
    Cleethorpes
    Posts
    1,227
    Plugin Contributions
    6

    Default Re: Display child categories of a parent in categories sidebar

    Also I'm not going to tell you what I am selling as that would give things away to you and you could be a competitor and copy it. I know why I want to do what I want to do, there are reasons behind it that have already been thought about so I don't need telling about all the scenarios etc. I just want an answer to the original question asked.
    Nick Smith - Venture Design and Print
    https://venturedesignandprint.co.uk

 

 
Page 1 of 8 123 ... LastLast

Similar Threads

  1. Conditional Statement - Parent and Child Category Display Additional Information
    By crlannen in forum Templates, Stylesheets, Page Layout
    Replies: 5
    Last Post: 6 Feb 2011, 04:13 AM
  2. Category Filter - Display Parent categories
    By djdavedawson in forum General Questions
    Replies: 1
    Last Post: 5 Oct 2010, 10:08 PM
  3. Enable Links for Parent Categories in Categories Sidebox
    By MrsQ in forum Templates, Stylesheets, Page Layout
    Replies: 3
    Last Post: 11 Sep 2009, 08:25 PM
  4. display all main parent categories(with category images) on a page
    By vandiermen in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 24 May 2009, 01:36 AM
  5. Parent... Child... Sub.... CATEGORIES
    By eliza-bee in forum Templates, Stylesheets, Page Layout
    Replies: 4
    Last Post: 12 May 2009, 03:03 PM

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