Created
June 17, 2020 16:30
-
-
Save xlawok/e018499438f9dbe36fb9a7e9c0f8e956 to your computer and use it in GitHub Desktop.
woocommerce change order achive PRODUCT based on tag possible category also
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//REARRANGE PRODUCT IN NOWOŚCI TAG | |
add_filter('woocommerce_default_catalog_orderby', 'custom_default_catalog_orderby'); | |
function custom_default_catalog_orderby($sort_by) { | |
if( !is_tax( 'product_tag', 'Nowości' ) ) { | |
return $sort_by; | |
} | |
return 'date'; // Can also use title and price | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment