Drupal commerce custom discount I'm using the Drupal Commerce module.

I want to make a discount rule where if there are 3 or more products of type X, you get a discount of 40% on all type X products. I don't know how I can do this without affecting type Y. Can this be done by pricing rules?
If you're willing to make "products of type X" "products with taxonomy term X" instead, you could probably get away with using Commerce Taxonomy Conditions. With it, you can create a product discount that applies 1) if an order has a certain quantity of a taxonomy and 2) if the current product has a certain taxonomy term.

If that didn't suite you, you could model the correct discount/inline conditions from that code... ripping out the taxonomy bits and replacing them with Drupal Commerce product types.