| Linux webm010.cluster103.gra.hosting.ovh.net 5.15.206-ovh-vps-grsec-zfs-classid #1 SMP Fri May 15 02:41:25 UTC 2026 x86_64 Path : /home/cuisinesj/www/new/wp-content/themes/wp-intouch/woocommerce/loop/ |
| Current File : /home/cuisinesj/www/new/wp-content/themes/wp-intouch/woocommerce/loop/orderby.php |
<?php
/**
* Show options for ordering
*
* @author WooThemes
* @package WooCommerce/Templates
* @version 2.2.0
*/
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
global $woocommerce, $wp_query;
if ( 1 == $wp_query->found_posts || ! woocommerce_products_will_display() )
return;
?>
<?php
if(!isset($_GET['orderby'])) $_GET['orderby'] = 'menu_order-asc';
$f = explode('-',$_GET['orderby']);
if(count($f)>1){
$sort= $f[1];
}else{
$sort = 'desc';
}
if(isset($_GET['woocommerce-sort-by-columns'])){
$perpage = '&woocommerce-sort-by-columns='.$_GET['woocommerce-sort-by-columns'];
}else{
$_GET['woocommerce-sort-by-columns'] = 6;
$perpage = '';
}
?>
<form class="woocommerce-ordering ct-shop-sort clearfix" method="get">
<ul class="order-combobox no-left-padding">
<li><strong><?php echo $_GET['woocommerce-sort-by-columns'];?> <?php _e( 'Products' , 'color-theme-framework' ); ?></strong> <?php _e( 'Per Page', 'color-theme-framework' )?>
<ul class="no-left-padding">
<li><a href="?orderby=<?php echo $f[0].'-'.$sort; ?>&woocommerce-sort-by-columns=6"><?php _e( '6 Products' , 'color-theme-framework' ); ?></a></li>
<li><a href="?orderby=<?php echo $f[0].'-'.$sort; ?>&woocommerce-sort-by-columns=9"><?php _e( '9 Products' , 'color-theme-framework' ); ?></a></li>
<li><a href="?orderby=<?php echo $f[0].'-'.$sort; ?>&woocommerce-sort-by-columns=15"><?php _e( '15 Products' , 'color-theme-framework' ); ?></a></li>
<li><a href="?orderby=<?php echo $f[0].'-'.$sort; ?>&woocommerce-sort-by-columns=30"><?php _e( '30 Products' , 'color-theme-framework' ); ?></a></li>
<li><a href="?orderby=<?php echo $f[0].'-'.$sort; ?>&woocommerce-sort-by-columns=45"><?php _e( '45 Products' , 'color-theme-framework' ); ?></a></li>
</ul>
</li>
</ul>
<?php
if($sort == 'desc'){
echo '<a title="'.__( 'Order products ascending', 'color-theme-framework' ).'" class="desc-asc-sort asc" href="?orderby='. ($f[0]) . '-asc'.$perpage.'"></a>';
}else{
echo '<a title="'.__( 'Order products descending', 'color-theme-framework' ).'"class="desc-asc-sort desc" href="?orderby='. ($f[0]) . '-desc'.$perpage.'"></a>';
}
?>
<ul class="order-combobox no-left-padding">
<?php
$title_arr = array(
'menu_order' => 'Name',
'popularity' => 'Popularity',
'rating' => 'Average Rating',
'date' => 'Date',
'price' => 'Price',
);
?>
<li style="font-size:11px;">Sort By <strong><?php if( isset ($f[0])) {echo $title_arr[$f[0]];}?></strong>
<ul class="no-left-padding">
<?php
$catalog_orderby = apply_filters( 'woocommerce_catalog_orderby', array(
'menu_order' => __( 'Name', 'color-theme-framework' ),
'date' => __( 'Date', 'color-theme-framework' ),
'price' => __( 'Price', 'color-theme-framework' ),
'popularity' => __( 'Popularity', 'color-theme-framework' ),
'rating' => __( 'Average rating', 'color-theme-framework' ),
) );
if ( get_option( 'woocommerce_enable_review_rating' ) == 'no' )
unset( $catalog_orderby['rating'] );
foreach ( $catalog_orderby as $id => $name )
echo '<li class="li_' . esc_attr( $id ) . '" ' . selected( $orderby, $id, false ) . '><a href="?orderby=' . esc_attr( $id ) . '-asc'.$perpage.'">' . esc_attr( $name ) . '</a></li>';
?>
</ul>
</li>
</ul>
</form>
<?php
?>
<?php
// Keep query string vars intact
foreach ( $_GET as $key => $val ) {
if ( 'orderby' == $key )
continue;
if (is_array($val)) {
foreach($val as $innerVal) {
echo '<input type="hidden" name="' . esc_attr( $key ) . '[]" value="' . esc_attr( $innerVal ) . '" />';
}
} else {
echo '<input type="hidden" name="' . esc_attr( $key ) . '" value="' . esc_attr( $val ) . '" />';
}
}
?>