Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

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

Select an option

Save AnanthFlycart/fc0b8e08c01c553be68a3d7aa794d0eb to your computer and use it in GitHub Desktop.
// Add discounted price to cart item data (product)
add_filter('advanced_woo_discount_rules_discounted_price_of_cart_item', function ($price, $cart_item, $cart_object, $cart_item_key){
$do_apply_price_rules = apply_filters('advanced_woo_discount_rules_do_apply_price_discount', true, $price, $cart_item, $cart_object, $cart_item_key);
if ($do_apply_price_rules) {
$cart_item['data']->awdr_product_discounted_price = $price;
}
return $price;
}, 10, 4);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment