php - How to make Woocommerce layered nav widget works on products page -
i added woocommerce layered nav widget shop's sidebar. main page shows categories, when user clicks on category, page show subcategories , after choosing subcategory, user see products.
my problem layered nav widget works on page showing categories. want make work on page shows products only.
if knows in function woocommerce selects products show on page helpful.
thank you.
upd: found in widgets/class-wc-query.php in function get_layered_nav_chosen_attributes() $_get looks working incorrectly. when try filter products in subcategories or products lists, see in $_get following values:
[q] => /product-category/category-name/subcategory_name/filter_brand=brand_name
[query_type_brand] => or
when filter products categories list see filter_brand correctly parsed , treated separate parameter.
if knows problem please me.
upd2: @ time have workaround. in class-wc-widge-layered-nav.php get_page_base_url() function after $link calculation added fake argument 'a=1'. necessary arguments parsed correctly. @ time don't know root cause of behavior. i'm newbie php , wordpress:)
i resolved issue. root cause incorrect nginx configuration.
location { try_files $uri $uri/ /index.php?q=$uri$args }
so nginx added unnecessary $uri.
correct value is:
try_files $uri $uri/ /index.php?$args
Comments
Post a Comment