Question

I am setting up magento store which buy stuff from customers. Instead of decreasing Price of the product, I want to increase the price of the product using coupon code. in which file i need to make changes for this.

Update 1:

Thanks Amit. I have another question. I like to change "Discount" to "Promotion" in cart and onepage checkout. However, I can't find any file location. I have turn on the Template Path Hints from Configuration. Can anyone help me out ?

Was it helpful?

Solution

If you need only fixed amount discount, then you can remove the validate for Discount Amount field so that you can add negative value in this field, so when you try to apply this coupon it will automatically add that amount instead to decrease. So you need to override below two classes.

For more details on Magento override see this Link.

Mage_Adminhtml_Block_Promo_Quote_Edit_Tab_Actions 

find this code

$fieldset->addField('discount_amount', 'text', array(
            'name' => 'discount_amount',
            'required' => true,
            'class' => 'validate-not-negative-number',
            'label' => Mage::helper('salesrule')->__('Discount Amount'),
        ));

and change it to

$fieldset->addField('discount_amount', 'text', array(
            'name' => 'discount_amount',
            'required' => true,
            'label' => Mage::helper('salesrule')->__('Discount Amount'),
        ));

and remove the below code

if ($this->hasDiscountAmount()) {
            if ((int)$this->getDiscountAmount() < 0) {
                Mage::throwException(Mage::helper('rule')->__('Invalid discount amount.'));
            }
        }

from

Mage_Rule_Model_Abstract::_beforeSave()

OTHER TIPS

Have a look at the CartController.php in Mage/Checkout/Controllers and at the Mage_Sales_Model_Quote model with its methode -collectTotals().

You need to create a new module where you override the model or create an observer.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top