Extra fee for Shopping Cart AND Catalog Cart Price Rules in Magento – Negative discount

This article is incomplete and the solution might not work!

Ever wondered wether it would be possible creating a negative discount? This article describes how to create a negative shopping cart price rule.

By default, Magento doesn’t accept negative price rule discount values:

Magento Negatieve Korting

We have to add some changes through the core in Magento conform the article:

  1. Go to: app/code/core/Mage/Rule/Model/Rule.php and fin:
    //check if discount amount > 0
    if ((int)$this->getDiscountAmount() < 0) { 3 Mage::throwException(Mage::helper(‘rule’)->__(‘Invalid discount amount.’));
    }
  2. Replace this code, by 'commenting':
    // if ((int)$this->getDiscountAmount() < 0) { 3 //Mage::throwException(Mage::helper(‘rule’)->__(‘Invalid discount //amount.’));
    //}
  3. Go to: app/code/core/Mage/Adminhtml/Block/Promo/Quote/Edit/Tab and find: 'class' => 'validate-not-negative-number',
  4. ‘Comment’ this code as well: // 'class' => 'validate-not-negative-number',
Now it works for shopping cart price rules. Unfortunately the article doesn’t describe how to enable negative values for catalog price rules. We have the solution:
  1. Repeat step 3 and 4 for the file app/code/core/Mage/Adminhtml/Block/Promo/Catalog/Edit/Tab/Action.php
  2. Then you can upload these files, I’ll prefer to save it in the app/code/local directory instead of core.

4 thoughts on “Extra fee for Shopping Cart AND Catalog Cart Price Rules in Magento – Negative discount”

  1. What about the TAX and the invoice?
    Totals in the orders in the backend are messed up, is there a solution for this problem?

    1. Hi Marcel,

      Unfortunately, I never got this workaround 100% working. So it requires some final modifications in order to get it working properly.

Leave a Reply

Your email address will not be published.