markelovett
Forum Replies Created
-
Rich,
When I originally created the variations for the 60 schools, rather than adding them one at a time, I selected ‘Create variations from all attributes’, which created variations for 50 schools at one time. Then I ran it again, and the remaining school variations were added. Next I entered into each variation and added the specific school products.
It seemed to make sense doing it this way, rather than adding on variation at a time.
Did I do it wrong?
What is the procedure you used to create your variations ?
Thanks,
MarkRich,
In product data, all schools are listed as attribute values, and all schools are listed as variations as well.
Is this wrong?
Do I need to delete all the variations (with all the school specific products) and start over creating one variation at a time?
Wow that’s very encouraging Rich! But I hope it’s not my theme that’s causing a conflict. It’s really hard for me to understand what you mean. Can I email you a wp login and let you have a look at my setup?
I updated this info and put up a new post here:
Forum: Plugins
In reply to: [WooCommerce] Custom attribute value in menu to display product archiveCorrection:
Renamed template to mychildtheme/woocommerce/taxonomy-pa_find-your-school.php
I never used the template subdirectory, it is setup like this:
yourchildtheme/woocommerce/taxonomy-pa_find-your-school.php
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.
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.
The find-your-school attribute was set up as a global attribute with ‘Enable Archives’ box checked.
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.
Per instructions given here: https://docs.woocommerce.com/document/using-custom-attributes-in-menus/
1-Added following code to my child theme functions.php:
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;
}2) 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.
Help!
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.
Ah ….. I sure didn’t. Sounds like the solution! Let me give it a try. Thanks so much Rich!
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,
MarkI think it’s gonna be awesome! Thanks much Rich!