Support » Plugin: WooCommerce Blocks » Custom Taxonomy

  • Resolved Robin

    (@cinghaman)


    Hi,

    Does it have any hooks/filters which can allow adding custom taxonomy along with the attributes to be used for filtering, for example, Filter by Year of Car (custom taxonomy)

    Thanks

Viewing 7 replies - 1 through 7 (of 7 total)
  • Yes, my site is all marked with Taxonomy…. I used with existing filters… This would be a very good addition….

    David

    Hi Robin (and David!),

    It appears you are asking about filter hooks for allowing the filtering of (products?) by a custom taxonomy. My apologies for not fully understanding your request but would you be able to elaborate a bit about what functionality/view you are wanting to adjust? Is this for a specific WooCommerce block?

    HI @nerrad like you have taxonomy for example color etc by default, right now we have to depend on additional filter plugins which dont fully follow WP standards but we have no choice

    This is the closest example i have https://facetwp.com/demo/cars/ now you see the filters on right (so imagine cars being WooCommerce product)

    Car (buy second-hand cars online) > Filter option
    Make of car
    Colour
    Year
    Etc.

    Plugin Support Jessica

    (@jesscga)

    Automattic Happiness Engineer

    Hey there!

    Just to clarify – you’d like to use WooCommerce Blocks to filter specific products, but not by category or tag; rather by a custom taxonomy. Is that correct?

    Are the custom taxonomy values added as attributes on your products, by any chance? If so, you could use the Products by Attribute Block to pull them onto a page.

    Let me know if that might be a viable workaround!

    Robin

    (@cinghaman)

    It’s always good to use native option as much as possible and if Woo Blocks are already adding filtering option no harm in checking if we can extend that functionality with hooks for custom Woo attributes as well and not just limit to the basic ones.

    It is not about pulling them, looks like you did not actually check the demo link I sent, would have given you a clear idea of what I meant and trying to achieve.

    Hi Robin,

    I do apologize but its still not clear exactly what you are wanting help with here. What I have gathered from your explanation here and the demo you linked to is that you want some way to the displayed items by an attribute that can be filtered by an accompanying filter controlled by the person viewing the items.

    So for example, in the demo you linked to, you’d want to have a list of filters by “year of car” (which isn’t shown in the demo).

    Since you’ve posted this as a support request in the WooCommerce Blocks repository I’m assuming your question is regarding the new All Products Block in combination with the various filtering blocks.

    You can have multiple “Filter by Attributes” block setup for a page and each block instance can display terms from different product attribute taxonomies. So if “year of car” is a product attribute taxonomy, it should be available as an option for the block.

    However, based on your question it appears you may be asking if you could use a custom taxonomy that is not a product attribute taxonomy for the filtering? If so, then currently there is no way to do this built-in or hooks available for injecting the custom taxonomy. The best approach here would be to build an additional Filter Block that is wired up to filter by your custom taxonomy.

    Does what I wrote above indicate I’ve understood your request correctly?

    Hi Yes, thanks got it sorted

Viewing 7 replies - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.