How you doing?
It’s officially our 31st day of lockdown here in Italy. Things are getting better and we can see the end of the tunnel – Italy is currently deciding on a “phase 2” after Easter, where activities will be gradually restored.
Anyway, welcome back to our WooCommerce Weekly appointment – here comes a series of WooCommerce tutorials put together by yours truly so that you can learn something new.
New WooCommerce Tips
WooCommerce: Display a Product Categories Dropdown Select
There is already a widget that allows you to place a “Product Category Dropdown” in your sidebar areas. The problem is that lately, sidebars have become kinda 1990. So, what if you want to place a “Category Select Box” anywhere in your WooCommerce website, and (in this case study), exactly on the Product Category pages, so that you can switch from one category to the other? Well, in this snippet you will learn a lot of things. For example, the wc_product_dropdown_categories() function magically displays a category dropdown, while the wc_enqueue_js() function allows you to inject jQuery (responsible to trigger the category page redirect). Enjoy: https://businessbloomer.com/woocommerce-display-product-categories-select-list/









