Home › Forums › WoodMart support forum › Product Category Filter hides sibling categories when selecting a category with

Product Category Filter hides sibling categories when selecting a category with

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #730412

    Palaplast Marketing
    Participant

    Hello,
    I am using the WOODMART Product Category Filter widget in the shop sidebar with:
    – Layout: List
    – Filter structure: Hierarchical
    – AJAX Shop: Enabled
    I have a category structure similar to:
    Irrigation
    → Irrigation Fittings
    → Compression
    → Connection
    → Drip Tape
    → Dripline Fittings
    → Drippers
    → Garden Fittings
    The problem occurs when I select a category that has no child categories, for example Compression.
    After selecting Compression, the Product Category Filter refreshes and the other sibling categories (Connection, Drip Tape, Drippers, Garden Fittings, etc.) disappear.
    I would like the sidebar category filter to keep the parent category and its sibling categories visible, even when the currently selected category has no children.
    For example, after selecting Compression, I would still like to see:
    Irrigation Fittings
    → Compression (active)
    → Connection
    → Drip Tape
    → Dripline Fittings
    → Drippers
    → Garden Fittings
    I noticed that WoodMart has the option “Show category neighbors if there is no children” under Theme Settings → Product archive → Page title, which provides similar behavior for the page-title category navigation.
    Is there a way to enable the same behavior for the WOODMART Product Category Filter sidebar widget?
    Ideally, I would like to achieve this using a native WoodMart setting or hook/filter rather than modifying theme core files.
    Thank you.

    Attachments:
    You must be logged in to view attached files.
    #730429

    Aizaz Imtiaz Awan
    Keymaster
    Xtemos team

    Hello,

    Thank you for the detailed explanation. The “Show category neighbors if there is no children” option applies to the page-title category navigation and does not directly control the Product Category Filter widget.

    The requested behavior may require custom code. You can use the default WooCommerce Product Categories widget as an alternative if you want to keep the full category tree visible in the sidebar.

    If you want to display all product categories on every product category page, please use the default WooCommerce Product Categories widget instead of the WoodMart Product Category Filter widget.https://postimg.cc/sMybjB6G.

    Hope this Helps!

    Best Regards.

    #730434

    Palaplast Marketing
    Participant

    Thank you.

    I understand that custom code is required.
    Could you please let me know whether the WoodMart Product Category Filter widget provides any PHP hook/filter that can be used to modify the category query/output?
    Specifically, when the currently selected category has no children, I would like to query the current category’s parent and display its children (siblings of the current category).
    I would like to implement this in the child theme without modifying WoodMart core files.
    If there is a relevant hook/filter in WoodMart 8.6.2, could you please provide its name?
    Thank you.

    #730447

    Aizaz Imtiaz Awan
    Keymaster
    Xtemos team

    Hello,

    The WOODMART Product Category Filter widget does not provide a WoodMart-specific PHP hook or filter for modifying its category query.

    Therefore, there is no native hook that can be used to change the behavior from showing child categories to showing the current category’s siblings when no children exist.

    This would require a custom solution, such as a custom widget or adjustments through generic WordPress term-query filters in a child theme. Please note that this is outside the theme’s built-in functionality and would require custom development which is out of theme support.

    Best Regards

Viewing 4 posts - 1 through 4 (of 4 total)