Created
March 21, 2019 14:04
-
-
Save djrmom/be55929c2839041e8c14a9cedff01b23 to your computer and use it in GitHub Desktop.
facetwp out price html rather than just price for woocommerce in layout builder
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 | |
/** replace woocommerce "price" in layout builder with price/sale price html **/ | |
add_filter( 'facetwp_builder_item_value', function( $value, $item ) { | |
if ( 'woo/price' == $item['source'] ) { | |
$product = wc_get_product( get_the_ID() ); | |
$value = $product->get_price_html(); | |
} | |
return $value; | |
}, 10, 2 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment