Answer the question
In order to leave comments, you need to log in
How to display Woocommerce sorting?
How to display the sorting of products in the filter plugin template?
Preferably with the ability to edit the frontend, at least in the div>ul>li loop format.
Doesn't work:
Even plugins that display sorting will help. It is also desirable that it would work on ajax.
woocommerce_catalog_ordering()
Answer the question
In order to leave comments, you need to log in
found the perfect solution for anyone who needs it:
<ul>
<?php
$catalog_orderby = apply_filters( 'woocommerce_catalog_orderby', array(
'menu_order' => __( 'Default sorting', 'woocommerce' ),
'price' => __( 'Sort by price: low to high', 'woocommerce' ),
'price-desc' => __( 'Sort by price: high to low', 'woocommerce' )
) );
if ( get_option( 'woocommerce_enable_review_rating' ) == 'no' )
unset( $catalog_orderby['rating'] );
foreach ( $catalog_orderby as $id => $name )
echo '<li><a href="' . get_permalink( woocommerce_get_page_id( 'shop' ) ) . '?orderby=' . $id . '" >' . esc_attr( $name ) . '</a></li>';
?>
</ul>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question