0

I have created an event observer in a module.

Observer is called after checkout_card_add event.

I want to call a cms page from the module if a certain condition is met.

My observer.php file

<?php
class Rohan_Module2_Model_Observer
{

            public function changeUserGroup(Varien_Event_Observer $observer)
            {

              Mage::log('function entered:');
              $customer1 = Mage::getModel('customer/customer')->load($customerId);
              $attr = $customer1->getCustomattribute();

                 if(some if conditon about $attr)
                 {
                     //if true redirect to cms page about-us url(http://127.0.0.1/magento1-test/index.php/about-magento-demo-store) 
                 }

             }
}

How can i call a CMS Page from this observer.php file?

1
<?php

class Rohan_Module2_Model_Observer
{

    public function changeUserGroup(Varien_Event_Observer $observer)
    {

      Mage::log('function entered:');
      $customer1 = Mage::getModel('customer/customer')->load($customerId);
      $attr = $customer1->getCustomattribute();

         if(some if conditon about $attr)
         {
            //This will redirect to about-us page
             Mage::app()->getResponse()->setRedirect(Mage::getBaseUrl().'about-us')->sendResponse();
             exit();
         }

     }
}
0

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.