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
240 views
in Technique[技术] by (71.8m points)

php - Can I set different ordering in WooCommerce Shop page and product based on category

Currently I applied filter to shop page to display product order by title. But my product in individually category also got affected. My goal is to display product order by title in shop page and display product in individual category by custom sorting+title. May I know is it possible. Please advise. Thanks.

question from:https://stackoverflow.com/questions/65948257/can-i-set-different-ordering-in-woocommerce-shop-page-and-product-based-on-categ

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

1 Answer

0 votes
by (71.8m points)

Yes totally possible just add an if statement to your filter, something like:

If( ! Is_product_category() ) {

}


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

...