Created
March 2, 2020 17:31
-
-
Save helgatheviking/8f3c9746a4d573e3075aa4e27435681d to your computer and use it in GitHub Desktop.
Change Mix and Match price string from From: $99 to range style $99 - $100
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
<?php | |
/** | |
* Change price string from From: $99 to range style $99 - $100 | |
* | |
* @return string | |
*/ | |
function kia_mnm_price_range( $price, $product ) { | |
if ( $product->get_max_container_size() && $product->get_mnm_price( 'max' ) && $product->get_mnm_price( 'min' ) !== $product->get_mnm_price( 'max' ) ) { | |
$price = sprintf( _x( '%1$s - %2$s', 'Price range', 'woocommerce-mix-and-match-products' ), $price . $product->get_price_suffix(), $product->get_mnm_price( 'max' ) . $product->get_price_suffix() ); | |
} | |
return $price; | |
} | |
add_filter( 'woocommerce_mnm_price_html', 'kia_mnm_price_range', 10, 2 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Updating for 2.0, removing suffix for now.