Shopping Cart Item Discount Multiple Products

I have been tasked with applying a discount to products in the shopping cart, when of a certain type are purchased.

Lets say I have a document type called Product Mugs, of which I have three different products, A, B, and C with a quantity of 1 in my cart.

I would like it so that when a minimum of 3 of this type is purchased, the user would receive a discount of $10.

As I understand the current volume discount solution in Kentico, this could not be accomplished because Volume Discount is for that specific product only.

To achieve this, my ideas have been the following.
1. Setup each product to have a volume discount with a minimum quantity of 1, with the discount price of $3.3333333
2. Create a new info provider class to make the volume discount above only execute when a minimum of 3 different products of that doc type are in the cart

I am struggling with this, because I am not sure what InfoProviderClass to extend. So far I have created a CustomVolumeDiscountInfoProvider class and a ShoppingCartInfoProvider class, with Calculate..Internal() functions, which doesn't seem to help.

At what point in the shopping cart item calculation does the volume discount get executed? Am I going about this the wrong way? I know this is definitely possible with customization, but a little insight would be great.

Recent Answers

We are glad you like it:) Regarding your issue - the way I would approach it would be to override CalculateTotalDiscount in the ShoppingCartInfoProvider class which you are already exploring. What you need to have is information of all other items places in your shopping cart so I would try to add whole ShoppingCart info to the CalculateTotalDiscount method and once you have all the items you should be able to calculate the price as per your needs.