Ran into an interesting bug today and was wondering if anyone else has come across it.

I took a default Magento CE installation ( and added in the dummy data. Then created a new category called "Software" in the Computer > Electronics category and added a single Downloadable Product to it.

I then attempted to create a price rule where if you added a product that had a category of Furniture (category 22) to the cart along with a downloadable product (category 35), you would get a flat, $15 dollar discount on your order.

Just to start off, I created a coupon that would be applied if any item with category ID of 22 was added to the cart.



This works just fine if you add just, say, an Ottoman to your cart... but if you then also add a downloadable product to your cart, the rule fails to apply.




Success, Part 2



If I attempt to do anything with price rules when there's a downloadable product in the cart, the rule fails.

Any ideas?


Turns out this is simply a little bit of a complex rule. Final settings to accomplish what I wanted looked like this...





  • Might be, because if you only have downloadable products in the cart, there is no shipping address. Only an idea. – Fabian Blechschmidt Mar 26 '13 at 19:13
  • I thought that might have something to do with it so, to test it, I created a separate rule that only applied to the Software category. I added a downloadable product to the cart and the new test rule applies correctly - but only if it's the only item in the cart. The bug only seems to appear if it's a combination of downloadable and non-downloadable products. – wlvrn Mar 26 '13 at 19:23
  • Does the downloadable product need to have the discount coupon applied as well? – pspahn Mar 26 '13 at 20:27
  • Keep in mind there is no coupon code. It's simply a sales rule. It says "Apply a $15 discount if there is a product with a category of 22 and a product with a category of 35 in the cart." – wlvrn Mar 26 '13 at 20:40
  • category is 22 means that the product in ONLY in the 22 category, try is one of – FlorinelChis Mar 26 '13 at 20:51

The problem is that you're applying the rule to all items in the cart, so when it checks the Virtual product, it sees that it is not in category 22, and it fails the rule.

If you want to apply the discount whenever an item from category 22 and category 35 are both in the cart, change your 'Conditions' rule to:

~ If ANY of these conditions are true:

~~ If total quantity greater than 0 for a subselection of items matching ANY these conditions:

~~~ Category is 22

~~~ Category is 35

I think my brain wrapped that correctly. If it's not quite right, it should at least get you on the right track.

enter image description here enter image description here

I used category 8 here, but that's just where I set up my own test Virtual product.

  • Closer, but this example will allow the discount to be applied to either item. Add items from both categories to your cart and you'll see the discount. Remove one and the discount is still there. We're trying to only have the discount applied if an item from category 22 is in the cart at the same time as an item from category 35 is in the cart. – wlvrn Mar 27 '13 at 12:24
  • Should just change ANY to ALL for the second image. – pspahn Mar 27 '13 at 13:31
  • Unfortunately, that doesn't seem to do the trick. Changing the "If total quantity..." line to meet ALL conditions and the discount isn't applied with a product from categories 22 and 35 in the cart. They don't make this easy, do they? – wlvrn Mar 27 '13 at 13:41
  • Got it. Needed to tweak it to look like this. screencast.com/t/REBpMHURuSS – wlvrn Mar 27 '13 at 13:47
  • Getting the logic correct in price rules can be difficult, the language could certainly be improved to provide more clarity. – pspahn Mar 27 '13 at 15:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.