• Resolved studiocardo

    (@studiocardo)


    Hi

    As every woocommerce user, I need to create a link and assign it to a menu item to effect queries to perform:
    1. query by category
    2. query by attributes
    3. query by “other”

    I have searched extensively for this topic yet I still can’t get a handle on how to do this. For example, my dead beat developer added a menu link that looks like

    https://xxx.com/product-category/red-wine/red-blend/

    where red is a category and blend is a category under red, so it’s straight forward enough. Yes, I tried to follow the convention of this example, but it didn’t work. So if I want to add additional menu items that query categories for beer and subcategories for IPA/lager/stout, how do I do it? And I can’t imagine that I have to do this by hand… WooCommerce has to have a facility that allows me to click and select the categories that I want… But where can I find that? And what is the general convention for creating links as such?

    Also, same line of logic, how do I perform a query for category of “Other”? Meaning anything that is (NOT beer AND NOT wine)?

    And how about attributes?

    Thank you for your support.

Viewing 9 replies - 1 through 9 (of 9 total)
  • Maybe change some of those Categories into Attributes and sort them accordingly?

    Plugin Support Zubair Zahid (woo-hc)

    (@doublezed2)

    Hello studiocardo

    Thank you for contacting Woo support.

    Just to confirm, when you say “Query by category”, do you mean a page that shows only products related to that specific category? For example, the category page for T-shirts will only display T-shirts and no other products.

    It would be better if you could share examples of a few categories that you have and the relevant products you want to display on that page.

    The one example you shared:
    https://xxx.com/product-category/red-wine/red-blend/

    This is the built-in Category system present in WooCommerce.
    In this case, you have two categories, Red Wine (parent category) and the Red Blend (Child category of Red Wine). This specific URL will show you a page with products listed under the Red Blend category.

    Once you share some real examples of products and categories, I will be in a better position to understand your requirements and assist you further.

    Looking forward to your response. ??

    Best regards.

    Thread Starter studiocardo

    (@studiocardo)

    Hi Zubair Zahid?

    Thank you so much for your support. Allow me to elaborate!

    There are four parent categories [Red, White, Espumante, Rose, Others]. This is an example of the structure of Red and White:

    Red
    – Blend
    – Bonarda
    – Cabernet Franc
    – Cabernet Sauvignon
    – Malbec
    – Merlot
    – Pinot Noir
    – Petit Verdot

    White
    – Blend
    – Chardonnay
    – Sauvinon Blanc
    – Riesling

    Orange
    – Chardonnay
    – Torrontes

    So the menu allows the users to query, for example, by Chardonnay (a child category of White), and the URL string looks like:

    xxx.com/product-category/white-wine/white-chardonnay/

    and it works as expected. However, since the creation of the above URL string by the developer, I added new category of Orange and its two children categories [Chardonnay, Torrontes]. So by following the convention of the URL query string above, I expect

    xxx.com/product-category/orange-wine/orange-chardonnay

    to return wines under that category combination, but I got a 404. So, what is the right way to compose the query string? What plugins or process or procedure should I have used? In other CMS’s like Joomla, to perform a query (aren’t they always?) via a menu, I would just go to the backend, through a drop down menu to select/compose the appropriate search criteria and the CMS will compose the string for me to embed in the menu. But that does not seem to be the case with WP/WooCommerce. I have no idea what appropriate steps I need to take to come up with the search string. So, for example, if I were to bestow the menu -> Orange -> Torrontes the ability to query all wines under white/torrontes categories, what are the steps? Where are the documentation and tutorials that I can follow?

    Also, if I were to search all the wines under White that are not [Blend, Chardonnay, Torrontes], ie all the white wines that fall under “Other”, how do I compose the appropriate menu query string?

    And what if I would like to search by attributes?

    Thank you for your support.

    Stefan

    Plugin Support Zubair Zahid (woo-hc)

    (@doublezed2)

    Hello studiocardo

    Thank you for a detailed explanation.
    It makes more sense now.

    What you want to achieve can easily be done by using the Product Categories of WooCommerce.
    The URL xxx.com/product-category/white-wine/white-chardonnay/ is working because the White Wine and White Chardonnay categories were created by your developer.

    Similarly, if you create an Orange Wine category and then also create its child category Orange Chardonnay. Then the URL xxx.com/product-category/orange-wine/orange-chardonnay will work and not show a 404 error.

    To confirm, could you share a screenshot of Products → Categories?
    Here is an example of my test site:

    I look forward to your reply. ??

    Best regards.

    Thread Starter studiocardo

    (@studiocardo)

    Hi Zubair Zahid

    I figured out the answer to my first question. And I am documenting it here for others who might have the same questions in the future. Essentially, to query products from a (child)category, the menu will be:

    xx.com/product-category/[slug_of_parent_category]/[slug_of_child_category]

    This is what a menu link needs to be. Coming from other CMS, I find this process to be, for the lack of better word, surprising…

    Ok, on to the second question, how do I create a query for Other? In my situation, here is an example category structure:

    White
    – Blend
    – Chardonnay
    – Chenin
    – Sauvinon Blanc
    – Riesling
    – Torrontes

    Because there aren’t that many wines from [Chenin, Sauv Blan, Reisl.], I don’t intend to make a menu item for each of them. Instead, I’ll lump them into Other, so a menu will essentially try to query

    xx.com/product-category/white-wine/others

    which will return wines that are Chenin+Sauv Blanc+Riesl. But WooComm does not permit different categories to share the same slug. In SQL, it’s easy enough to form a query that excludes unwanted categories, but how does one go about forming such a query in WooComm (that will eventually be translated into corresponding SQL)?

    Last but not least, how about query by Attribute?

    Regards,
    S

    Hey, @studiocardo!

    Regarding the other category, you can create a subcategory for White Wine called ‘others’ and put all the wines you want under that category there. You can also create subcategories for Chenin, Sauv Blan, Reisl to have each one on their own category for organizational purposes, but not add those to the menu, only add the ‘others’ category, which would show all of them.

    I hope this was clarifying. If you face any issues or have any questions, please let us know so we can assist you further.

    Last but not least, how about query by Attribute?

    Do you mind sharing more details about this?

    Do you want to know how to get the Attribute’s URLs?
    Do you want to set up a filter by attribute on the site?

    The more information we have about your goal, the better ??

    Looking forward to your reply.

    Have a wonderful day!

    Thread Starter studiocardo

    (@studiocardo)

    Hi carolm29

    Thanks for your reply. Yeah, that is definitely a viable implementation. Far from an ideal one in my opinion because:

    1. I can lump all white Chenin/Riseling/Sauv Blanc wines in Other, which is another child category of White, which should satisfy my design goal of querying these wines through only one menu item of “Other”. But I lose the ability to query wines under Chenin/Riseling, etc. directly, say, Chenin wines or Riseiling, etc..
    2. Or I replicate all the wines under Chenin/Riseling under both Other and its respective subcategory with its namesake. But then I am essentially creating two identical product list, but under different subcategories… That can not be a good design. So much so, I would not consider this to be a viable solution.
    3. So I am down to lumping them all in “Other”. Hum…

    As for searching by attributes, here’s an example. For these wines, I assigned their origin as an attribute. For example:

    Region:
    – Napa
    – Sonoma
    – Paso Roble
    – Russian River

    So I’d like to enable users to use the menu to query all the wines by their regions, might it be Napa or Sonoma, etc. I even have sub-regions for more details parcels in Napa, Sonoma, etc. But I assume once I can get query by Attribute working, it should be no different if I enable sub-regions. I found a couple plug-ins like Husky that is supposed to extend the search/query ability. Maybe that’s the solution.

    Regards,
    S

    Hey, @studiocardo!

    I can lump all white Chenin/Riseling/Sauv Blanc wines in Other, which is another child category of White, which should satisfy my design goal of querying these wines through only one menu item of “Other”. But I lose the ability to query wines under Chenin/Riseling, etc. directly, say, Chenin wines or Riseiling, etc..

    You can have the “other” category be a child of White Wine, but have Chenin/Riseling be categories of their own, without being a child of White Wine. And have the products on both categories.

    If this is not your goal, do you mind sharing more details about so we can better understand it?

    So I’d like to enable users to use the menu to query all the wines by their regions, might it be Napa or Sonoma, etc. I even have sub-regions for more details parcels in Napa, Sonoma, etc. But I assume once I can get query by Attribute working, it should be no different if I enable sub-regions. I found a couple plug-ins like Husky that is supposed to extend the search/query ability. Maybe that’s the solution.

    We have a Filter By Attribute block that you can add to your website without installing a new plugin. But installing a plugin might be a good fit for you as they can have additional features that will better fit your needs.

    While Husky is not a plugin we provide support for, it has been recently updated, it has a lot of installations and great ratings. So it seems like a good option ??

    We also have another option on our marketplace, which we do provide support for, called Product Filters. You might also want to take a look at that.

    Have a wonderful day!

    anastas10s

    (@anastas10s)

    Hi! We haven’t heard back from you in a while, so I’m going to mark this as resolved – we’ll be here if and/or when you are ready to continue.

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘How to create link for menu item to query product category’ is closed to new replies.