Created
September 20, 2018 08:46
-
-
Save pvphong90/9c742b31aab4ad76ee81a4473120aec4 to your computer and use it in GitHub Desktop.
Code lấy ra bộ lọc của Woo
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
<ul> | |
<li class="gia_khac">Sắp xếp <i class="icon-angle-down"></i> | |
<ul class="dropdown woocommerce-ordering"> | |
<?php | |
$catalog_orderby = apply_filters( 'woocommerce_catalog_orderby', array( | |
'menu_order' => __( 'Default sorting', 'woocommerce' ), | |
'popularity' => __( 'Sort by popularity', 'woocommerce' ), | |
'rating' => __( 'Sort by average rating', 'woocommerce' ), | |
'date' => __( 'Sort by newness', '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="' . '?orderby=' . $id . '" >' . esc_attr( $name ) . '</a></li>'; | |
?> | |
</ul> | |
</li> | |
</ul> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment