Digital experiences for all disciplines
New Landing › How can we help? › Themeforest Theme Support › Neighborhood › Auto add product attributes selection to wordpress menu
New Landing › How can we help? › Themeforest Theme Support › Neighborhood › Auto add product attributes selection to wordpress menu
- This topic has 11 replies, 3 voices, and was last updated 9 years by Kyle – SUPPORT.
-
Posted in: Neighborhood
-
October 9, 2014 at 2:39 pm #118915
Hi I need to use the product attributes as menu links and used the following in my neighboorhood child template functions.php:
/* add product type attributes to the menu selection */ add_filter('woocommerce_attribute_show_in_nav_menus', 'profil_product_attributes_reg_for_menus', 1, 2); function profil_product_attributes_reg_for_menus( $register, $name = '' ) { if ( $name == 'pa_produkttyp' ) $register = true; return $register; }
This code is only adding a specific attribute, but this might be a nice feature to have for auto generation of all attributes available.
October 9, 2014 at 2:45 pm #118917Hi
I’m afraid that’s not possible for a theme to provide, it would be something WooCommerce would have to add
– Kyle
October 9, 2014 at 2:51 pm #118921Why not? Simple function in functions.php Seems like a unique peace of awesome to have in a template.
October 9, 2014 at 3:00 pm #118925But you would just add a custom link to the menu for e.g:
http://neighborhood.swiftideas.net/shop/?filter_brand=232
– Kyle
October 9, 2014 at 3:06 pm #118928Yeah I know but what if I have to explain some customers:
“Jep that url looks not very good and you need to find the ID to build it.”When integrated like in the example above the generated url is clean like http://neighborhood.swiftideas.net/shop/aspesi
Anyway…was just a hint from me as a customer on how to improve this already pretty awesome template.
October 9, 2014 at 3:11 pm #118933Ok thanks
– Kyle
May 26, 2015 at 11:12 am #178430HI Kyle / profilpr
We’d really like to enable some woo commerce custom attributes as a menu in our theme too – can you tell me where I need to add the code you posted in the functions.php file and do I copy that file out of the neighbourhood theme file and into the neighbourhood-child theme file?
THanks,
cC
May 26, 2015 at 1:31 pm #178492I get this error when I try replacing the adding the edited functions.php file in the child theme folder..?
Any ideas?
May 26, 2015 at 2:03 pm #178517Hi @MarieWorks
Not sure what function you’re referring to? The solution I provided was to just add the link for the attribute a a custom link in the menu, for e.g. http://neighborhood.swiftideas.net/shop/?filter_brand=232
– Kyle
May 26, 2015 at 2:13 pm #178521Hi @Kyle
@profilpr’s solution sounded like it generates a cleaner URL – but it seems quite complicated to get working…is there anyway of cleaning up the custom urls e.g when the customer goes to page filtered by just bowls url is
http://107.6.141.74/~reikokan/shop/?filter_product-type=75
it would be better if we could have
http://107.6.141.74/~reikokan/shop/bowls
having read a bit about changing the functions.php file (here http://docs.woothemes.com/document/using-custom-attributes-in-menus/) it should be possible – but I cant seem to make it work…?
Any ideas?
Thanks,
Chris
May 26, 2015 at 3:21 pm #178538The link solution also loads the generic shop page with a filter already activated (seen screen shot 1) it would be better if we could somehow load a specific page – with relevant heading (as happens when you load category pages – like Vases – screen shot two…)
Could one way of doing it be just to create lots more categories as use them more like tags – in which case can we prevent the categories being displayed underneath each product on the catalogue pages?
Thanks
C
May 26, 2015 at 6:42 pm #178603I’m afraid this functionality is more WooCommerce specific, rather than the theme. It’s something you would need to take up with WooCommerce support.
– Kyle
-
Posted in: Neighborhood
You must be logged in and have valid license to reply to this topic.