Support » Plugin: WooCommerce » Improving Product Tag Cloud Widget based on a Visited Category

  • Resolved anotherbreed

    (@anotherbreed)


    Hello,

    I’m using the default product tag cloud widget in my WordPress + Woocommerce site, but I’m not really satisfied with it, as it only displays general results for each tag, while I wish it could actually display more specific results, for example:

    I have two categories: Dogs, Cats.

    And a list of tags: Black, White, Grey, Red, Brown, etc.

    It would be nice that when I’m browsing a specific category, let’s say “Dogs”, all the tags displayed in the Widget would work in a way that if I click on one of them, let’s say “Brown”, I will see a list of all the dogs (no cats!) tagged as Brown. Also, if there are no dogs tagged as Grey, that tag should be hidden in the Widget.

    If I am outside of a category, for example, I’m browsing the Home Page, it would just display everything tagged with Brown (both gods and cats), just like the default Widget already does.

    I’ve found a lot of filters plugins which have *so much stuff* I don’t need, while this would simply be an enhancement of the default Widget which already exists.

    What do you think? Has anyone had the same need with this?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Support Three Sons

    (@3sonsdevelopment)

    Hi @anotherbreed,

    That’s a very interesting idea. So the tag cloud simply makes links to the “archive” of that tag. In a sense to do what you’re asking, you need to change the URL for these links based on the current view. So if you’re in the product category of dogs, then adding a tag will keep the same category, but add in a filter for the tag.

    If you don’t have many, you could use custom links in a navigation menu widget instead of the tag cloud. WPMU has an article on how to construct URLs for items like this:

    https://premium.wpmudev.org/blog/building-customized-urls-wordpress/

    You could then use widget visibility to selectively hide/show these widgets so they only appear in the correct categories.

    But that’s going to be a lot of trouble if you have a lot of content.

    Because of that, I would suggest going with one of the filtering plugins. It has the logic built in to do this dynamically. Otherwise, you either have to write your own code to do this dynamically or hand create a lot of links.

    If you have any questions, let me know.

    Best,

    Plugin Support Three Sons

    (@3sonsdevelopment)

    Hi @anotherbreed,

    It’s been a while since we heard from you, so I’m marking this thread resolved. Hopefully, you’ve been able to resolve this, but if you haven’t, please let open up a new topic and we’ll be happy to help out.

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