Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AshlinRejo/c4557c9517f94ef7db4e9ccc2b88b963 to your computer and use it in GitHub Desktop.
Save AshlinRejo/c4557c9517f94ef7db4e9ccc2b88b963 to your computer and use it in GitHub Desktop.
Woo Discount: Compatible for WC Role Based Price By Varun Sridharan
function wc_rbp_product_get_price_for_woo_discount_compatible($wcrbp_price, $product, $role_based_pricing_object){
$changes = $product->get_changes();
if(!empty($changes)){
if(isset($changes['price'])){
$wcrbp_price = $changes['price'];
}
}
return $wcrbp_price;
}
add_filter('wc_rbp_product_get_price', 'wc_rbp_product_get_price_for_woo_discount_compatible', 10, 3);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment