Your question should be specific to WordPress. Generic PHP/JS/SQL/HTML/CSS questions might be better asked at Stack Overflow or another appropriate Stack Exchange network site. Third-party plugins and themes are off-topic for this site; they are better asked about at their developers' support routes.
Closed 5 years ago.
Improve this questionHow to rename the WooCommerce sorting dropdown options and customise the wording? For example, change "Popularity" to "Best Selling" or "Price: Low to High" to just "Price Low to High" without the colon.
Closed. This question is off-topic. It is not currently accepting answers.Your question should be specific to WordPress. Generic PHP/JS/SQL/HTML/CSS questions might be better asked at Stack Overflow or another appropriate Stack Exchange network site. Third-party plugins and themes are off-topic for this site; they are better asked about at their developers' support routes.
Closed 5 years ago.
Improve this questionHow to rename the WooCommerce sorting dropdown options and customise the wording? For example, change "Popularity" to "Best Selling" or "Price: Low to High" to just "Price Low to High" without the colon.
Share Improve this question edited Nov 26, 2019 at 8:03 tru.d 1861 gold badge1 silver badge17 bronze badges asked Nov 25, 2019 at 4:47 aye ceeaye cee 15912 bronze badges1 Answer
Reset to default 1Add this code to functions.php and rename the relevant option. Here I have renamed the 'Popularity' option to 'Best Selling'.
add_filter( 'woocommerce_catalog_orderby', 'rename_sorting_option_woocommerce_shop' );
function rename_sorting_option_woocommerce_shop( $options ) {
$options['popularity'] = __( 'Best Selling', 'woocommerce' );
$options['date'] = __( 'Newest', 'woocommerce' );
$options['price'] = __( 'Price: Low to High', 'woocommerce' );
$options['price-desc'] = __( 'Price: High to Low', 'woocommerce' );
return $options;
}
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744967938a4603796.html
评论列表(0条)