Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
158 views
in Technique[技术] by (71.8m points)

php - WooCommerce: Sorting problem: Selected orderby value overwrites filter value

I have a sorting problem in my woocommerce shop. I'm selling shoes in my shop and I have some filters which shows users shoes they like, for example: shoe type, brand, size, color.

All of them work well with the orderby dropdown selection even if I combine them all. But when a size is selected and for example "order by price" the filter value of size is overwritten by the selected orderby value:

Selected filter size 10:

../shop/?filter_size=10

Selected filter size 10 and orderby price:

../shop/?orderby=price&filter_size=price

Edit:

If I choose first orderby price and then size 10 there is no problem:

shop/?filter_size=10&orderby=price

I use: WooCommerce Standard Widget Filter: "Products by Attribute".

Any ideas where this error could come from?

question from:https://stackoverflow.com/questions/65916145/woocommerce-sorting-problem-selected-orderby-value-overwrites-filter-value

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Problem solved. I had a copy of orderby.php in my child theme woocommerce folder which caused this error. After I deleted it everything was fine.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...