Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save AnanthFlycart/5b0e145dcb4115b8ebd7f3b080c87f75 to your computer and use it in GitHub Desktop.

Select an option

Save AnanthFlycart/5b0e145dcb4115b8ebd7f3b080c87f75 to your computer and use it in GitHub Desktop.
add_filter('woocommerce_available_variation', function($data, $variable_product, $variation) {
if (isset($data['display_price'])) {
$discount_details = apply_filters('advanced_woo_discount_rules_get_product_discount_details', false, $variation);
if ($discount_details !== false) {
$data['display_price'] = $discount_details['discounted_price_based_on_tax_settings'];
}
}
return $data;
}, 100, 3);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment