Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Change Mix and Match price string from From: $99 to range style $99 - $100
<?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
You can’t perform that action at this time.