• Resolved markelovett

    (@markelovett)


    Where can I find the Woocommerce permalink to an archive page that displays all products sharing the same attribute value?

    I set up ‘Pool Tables’ as a variable product, ‘Find Your School’ as an attribute, and all the schools are entered as attribute values.

    How can I gain access to an archive page that displays all products associated with a particular school?

    How can I link the schools under the ‘Find Your School’ menu in the main nav , at https://affinitygamerooms.marklovettstudio.com, to an archive page that displays all products associated with a particular school?

    Thanks so much!
    Mark
    [email protected]

Viewing 15 replies - 1 through 15 (of 23 total)
  • richstrauss

    (@richstrauss)

    Hi Mark,

    Have a look at this and see if it will work for you:

    https://docs.woocommerce.com/document/using-custom-attributes-in-menus/

    Thread Starter markelovett

    (@markelovett)

    Ok Rich. I’ll check it out. Thx much!

    Thread Starter markelovett

    (@markelovett)

    Rich,
    I read this previously, and just read it again. It’s not near enough information for me. Do you think it will work? If so, could you give me some direction?
    Thx,
    Mark

    Thread Starter markelovett

    (@markelovett)

    Actually, I think it worked. I see the values in the menu. Thx.
    Let me see where they go now.

    Thread Starter markelovett

    (@markelovett)

    I think it’s gonna be awesome! Thanks much Rich!

    richstrauss

    (@richstrauss)

    OK great! Glad you figured it out ??

    Thread Starter markelovett

    (@markelovett)

    Hi Rich,

    After adding multiple products and variations, and testing, when I select a school from the ‘Find Your School’ menu,

    on my dev site here: https://affinitygamerooms.marklovettstudio.com/,

    such as ‘Arizona State University’, although the permalink is ‘https://affinitygamerooms.marklovettstudio.com/pa_find-your-school/arizona-state-university/’,

    all the products displaying are for Air Force Academy, the first school in the menu, instead of Arizona State University.

    Similarly, when I select the ‘Army West Point’ from the ‘Find Your School’ menu, the permalink appears correct, https://affinitygamerooms.marklovettstudio.com/pa_find-your-school/army-west-point/, however the products that display are for Air Force Academy as well.

    The code I added to my child theme functions.php is:

    add_filter(‘woocommerce_attribute_show_in_nav_menus’, ‘wc_reg_for_menus’, 1, 2);
    function wc_reg_for_menus( $register, $name = ” ) {
    if ( $name == ‘pa_find-your-school’ ) $register = true;
    return $register;
    }

    Will you please help me find a solution so the schools display only products associated with the school selected?

    Thanks much,
    Mark

    richstrauss

    (@richstrauss)

    Hi Mark,

    Did you copy the woocommerce/templates/taxonomy-product_cat.php into your child theme folder, and renamed the template to reflect your attribute – ie yourchildtheme/woocommerce/templates/taxonomy-pa_find-your-school.php?

    Rich

    Thread Starter markelovett

    (@markelovett)

    Ah ….. I sure didn’t. Sounds like the solution! Let me give it a try. Thanks so much Rich!

    Thread Starter markelovett

    (@markelovett)

    Bummer. Still not working.

    As you suggested, I copied woocommerce/templates/taxonomy-product_cat.php into my child theme folder and renamed template to mychildtheme/woocommerce/templates/taxonomy-pa_find-your-school.php

    Then I cleared my varnish cache and refreshed the site several times but no change. Both schools, Arizona State and Army West Point still display Air Force Academy products.

    richstrauss

    (@richstrauss)

    OK, I think I know…

    Did you add the attributes ‘Find Your School’ on a per product basis, or as Global Attributes?

    In this documentation >> https://docs.woocommerce.com/document/using-custom-attributes-in-menus/

    … it says that “archives must be enabled”

    I don’t see that archives can be enabled for attributes added on a per product basis, but it can be enabled for Global Attributes.

    So it seems you need to add ‘Find Your School’ as a Global Attribute and then enable Archives:

    Products >> Attributes >> Enable Archives?

    You will then have that Global Attribute available to select in each of your products.

    See this video on creating Global Attributes >> https://woocommerce.com/videos/product-categories-tags-shipping-classes-attributes/

    Let me know if that solves the problem and if it makes sense!

    Thread Starter markelovett

    (@markelovett)

    Thanks again Rich for helping. Yes it makes sense and I previously set up find-your-school as a global attribute with ‘Enable Archives’ checked, so I’m still clueless.

    Hi Mark,

    Sorry for the delay. Please ensure that you have marked each individual attribute to have stock available and that each individual attribute has a price assigned to it.

    If that doesn’t solve the issue I’ll set up an install on my side this week and see if I can replicate the problem. I wish I could help you sooner, things are a bit busy on my side with clients and such.

    Rich

    Thread Starter markelovett

    (@markelovett)

    No problem Rich. I appreciate your help very much.

    Yes I double checked, and all products, as well as attribute/variations (schools) have prices set and have items listed as in-stock.

    Happy to send you files or give you login credentials.

    Thread Starter markelovett

    (@markelovett)

    Just to clarify:

    When user selects a school in the “Find Your School’ menu, I want to display only products associated with the particular school.

    However upon selecting any school, only data from the default main product displays in the archive page, and none of the variable product data for all the school variations displays here.

Viewing 15 replies - 1 through 15 (of 23 total)
  • The topic ‘Archive page displaying all products sharing same attribute value?’ is closed to new replies.