I use some catalog price rules, to display discount on frontend. All these rules do have a end date.

I want to display the end date on frontend, so that a customer knows when the discount will end.

How can I display that?

1 Answer 1


you can get with help of below function.

define this function in to your local/custom helper

 protected function getCatalogRules($_product) {
        return Mage::getResourceModel('catalogrule/rule')->getRulesFromProduct(
                        Mage::getModel('core/date')->date('Y-m-d'), 1, Mage::getSingleton('customer/session')->getCustomerGroupId(), $_product->getId()

pass product as object in to this to get desire result if product has applied catalog rule.

Then you can get information about current catalog rule applicable for current product.grab in to one array and display end from response.

hope this will work for you.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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