For instance we have 3 products in the cart. Two of them are on sale, the last one is not. The rule is: apply 10% discount on not discounted products only if the the subtotal amount of NOT discounted products exceeds $50.
So if we have 3 products, where two of them are already discounted, we don't care about them. Since, we have the only one not discounted product, then we check if it's price is not less that $50 and only then apply 10% to this product.
If we had 4 products, two of which are not discounted, (assume their prices are $20, $35, respectively), then we check if $20 + 35$ is greater than $50 and apply $2 and $3.5 discount to them.
The bit I struggle is how to get this subtotal of not discounted products?