2

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?

0

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.

| improve this answer | |

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.