# Compatible with WooCommerce Product Add-Ons Ultimate by Plugin Republic

```php
add_filter('advanced_woo_discount_rules_discounted_price_of_cart_item', function($price, $cart_item, $cart_object, $calculated_cart_item_discount){
	  $add_on_price = 0;
    if(isset($cart_item) && isset($cart_item['product_extras']) && !empty($cart_item['product_extras'])){
            $price_with_extras = isset($cart_item['product_extras']['price_with_extras']) ? $cart_item['product_extras']['price_with_extras'] : 0;
            $original_price = isset($cart_item['product_extras']['original_price']) ? $cart_item['product_extras']['original_price'] : 0;
            $add_on_price = $price_with_extras - $original_price;
            $price = $price + $add_on_price;
        }	
	
  return $price;
}, 10, 4);
```
