0

I've been asked to make a controller that will display all active shopping cart price rules. Then add description, number of uses etc.

I've created a custom module with a controller index:

app/code/local/Company/ActivePromotions/controllers/IndexController

Which contains this code:

class Company_ActivePromotions_IndexController extends Mage_Core_Controller_Front_Action{

    public function IndexAction() {

        {
        $this->loadLayout();

        $this->renderLayout();

        }       
    }

The module block is here:

app/code/local/Company/ActivePromotions/Block/Page.php

It contains this code:

<?php

class Company_ActivePromotions_Block_Page extends Mage_Core_Block_Template

{
protected function _construct()
{
parent::_construct();
$this->setTemplate('activepromotions/1column.phtml');
}

The routers have been setup in /app/code/local/Company/ActivePromotions/etc/config.xml to display the data at: website.com/activepromotions

I've been advised to use this method:

Mage_CatalogRule_Model_Resource_Rule::updateRuleProductData

This is where I'm unable to get it to return anything.

How do I call the updateRuleProductData() method in the template file below?

/app/design/frontend/base/default/template/activepromotions/1column.phtml

Should I add the updateRuleProductData() to the Block.php file or use a Helper in my custom module?

  • what version of magento are you using ? do mention the version . it will be easier to get help. – Naveed Asim Mar 14 '18 at 13:25
  • Hi, I'm using v1.9 – artworker Mar 14 '18 at 14:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.