1

I am trying to change a validation rule from positive number to any number (so it allows negative numbers too) for the following field:

[Admin Area] -> Promotions -> Catalogue Price Rules -> Add New Rule -> Actions -> Discount Amount

I have successfully changed the client-side validation rule but am struggling with the server-side validation rule.

Here's where I have got to:

app/code/core/Mage/Adminhtml/controllers/Promo/CatalogController.php

Mage_Adminhtml_Promo_CatalogController::saveAction

That function seems to fetch a rule_id from $_GET or $_POST and sends it to a load() method on the catalog/rule model, and then validateData() is called on that model with the data from $_POST.

I have searched all files for discount_amount but didn't seem to find any validation rules.

1

Found out how to do it.

app/code/core/Mage/Rule/Model/Abstract.php

Mage_Rule_Model_Abstract::_beforeSave

Override that file to the local folder and comment out the first bit of code in that method.

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.