Skip to content

Instantly share code, notes, and snippets.

@farookibrahim
Created June 23, 2020 14:24
Show Gist options
  • Select an option

  • Save farookibrahim/b300232b09297a482e8546473c1d5b6c to your computer and use it in GitHub Desktop.

Select an option

Save farookibrahim/b300232b09297a482e8546473c1d5b6c to your computer and use it in GitHub Desktop.
Cartzilla - Change Shop Page Sorting Dropdown Text
if ( ! function_exists( 'cartzilla_wc_catalog_orderby' ) ) {
function cartzilla_wc_catalog_orderby( $options ) {
$options = array(
'popularity' => esc_html__( 'Popularity', 'cartzilla' ),
'price' => esc_html__( 'Low - Hight Price', 'cartzilla' ),
'price-desc' => esc_html__( 'High - Low Price', 'cartzilla' ),
'rating' => esc_html__( 'Average Rating', 'cartzilla' ),
'title-asc' => esc_html__( 'A - Z Order', 'cartzilla' ),
'title-desc' => esc_html__( 'Z - A Order', 'cartzilla' ),
);
return $options;
}
}
if ( ! function_exists( 'cartzilla_mp_catalog_orderby' ) ) {
function cartzilla_mp_catalog_orderby( $options ) {
$options = array(
'date' => esc_html__( 'Newest', 'cartzilla' ),
'popularity' => esc_html__( 'Bestsellers', 'cartzilla' ),
'rating' => esc_html__( 'Popular', 'cartzilla' ),
'price' => esc_html__( 'Low Price', 'cartzilla' ),
'price-desc' => esc_html__( 'High Price', 'cartzilla' ),
);
return $options;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment