Under the Promotions tab in your admin panel there is a shopping cart price rule int this you can't add minus value to for rule. But now it is possible to add minus value and this value was added as extra fee to cart and checkout.
Note: we are going to change Magento Core files. Please make a backup of your files before continuing.
1). Go to app/code/core/Mage/Rule/Model/Rule.php
Find this:
if ((int)$this->getDiscountAmount() < 0) {
Mage::throwException(Mage::helper('rule')->__('Invalid discount amount.'));
}
Just add some bars // to comment the code: it look like this
//if ((int)$this->getDiscountAmount() < 0) {
//Mage::throwException(Mage::helper('rule')->__('Invalid discount amount.'));
//}
2). Now go to: app/code/core/Mage/Adminhtml/Block/Promo/Quote/Edit/Tab/Actions.php
find this
'class' => 'validate-not-negative-number',
and coomment it
//'class' => 'validate-not-negative-number',
3). Translate the discount word.
Go to app/locale/es_ES (I'm using the Spainish translation so maybe yours would be en_US)
Find a file called Mage_Sales.csv. Inside look for the word discount you will find something like:
"Discount (%s)","Discount (%s)"
You can change the value in order to show your own text. For example:
"Discount (%s)","Extra Fee (%s)"
4). If you want to apply this rule to whole cart than do this
goto app\code\core\Mage\SalesRule\Model\validator.php
find this below code it is near to line 280 to 300.
case 'cart_fixed':
$cartRules = $address->getCartFixedRules();
if (!isset($cartRules[$rule->getId()]) > 0) {
$cartRules[$rule->getId()] = $rule->getDiscountAmount();
}
if ($cartRules[$rule->getId()]) {
replace by
case 'cart_fixed':
$cartRules = $address->getCartFixedRules();
if (!isset($cartRules[$rule->getId()])) {
$cartRules[$rule->getId()] = $rule->getDiscountAmount();
}
if ($cartRules[$rule->getId()]) {