Call cms page from custom moduleCall of my custom module in a CMS Page not workingDisable Cache in CMS Page...

Landlord wants to switch my lease to a "Land contract" to "get back at the city"

Are cabin dividers used to "hide" the flex of the airplane?

Can I find out the caloric content of bread by dehydrating it?

What is the meaning of "of trouble" in the following sentence?

Are objects structures and/or vice versa?

Where else does the Shulchan Aruch quote an authority by name?

What do the Banks children have against barley water?

What do you call something that goes against the spirit of the law, but is legal when interpreting the law to the letter?

Is there a name of the flying bionic bird?

Patience, young "Padovan"

How would photo IDs work for shapeshifters?

How to move the player while also allowing forces to affect it

Calculate Levenshtein distance between two strings in Python

What is it called when one voice type sings a 'solo'?

Domain expired, GoDaddy holds it and is asking more money

Does a dangling wire really electrocute me if I'm standing in water?

What is GPS' 19 year rollover and does it present a cybersecurity issue?

Short story: alien planet where slow students are executed

Cisco ASA 5585X Internal-Data0/1 interface errors

Prime joint compound before latex paint?

Is it legal to have the "// (c) 2019 John Smith" header in all files when there are hundreds of contributors?

Is "plugging out" electronic devices an American expression?

Is domain driven design an anti-SQL pattern?

Need help identifying/translating a plaque in Tangier, Morocco



Call cms page from custom module


Call of my custom module in a CMS Page not workingDisable Cache in CMS Page Using a Custom ModuleCustom price for a productNo stock decrease at order if certain conditions are metHow to stop customer registration if the validation fails?Magento2: Re-direct to custom URL from observerMagento Custom Module in CMS Page Not Workingcatalog_product_collection_load_after causing maximum nesting issue for configurable productsSimple Observer not firing on eventAdd block from custom module to CMS page not working






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ margin-bottom:0;
}







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?










share|improve this question































    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?










    share|improve this question



























      0












      0








      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?










      share|improve this question
















      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?







      magento-1.9 module event-observer cms cms-pages






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited 15 mins ago









      Muhammad Anas

      459215




      459215










      asked May 7 '17 at 12:26









      Rohan BhatiaRohan Bhatia

      71




      71






















          1 Answer
          1






          active

          oldest

          votes


















          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();
          }

          }
          }





          share|improve this answer
























            Your Answer








            StackExchange.ready(function() {
            var channelOptions = {
            tags: "".split(" "),
            id: "479"
            };
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function() {
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled) {
            StackExchange.using("snippets", function() {
            createEditor();
            });
            }
            else {
            createEditor();
            }
            });

            function createEditor() {
            StackExchange.prepareEditor({
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: false,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: null,
            bindNavPrevention: true,
            postfix: "",
            imageUploader: {
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            },
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            });


            }
            });














            draft saved

            draft discarded


















            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f173348%2fcall-cms-page-from-custom-module%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            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();
            }

            }
            }





            share|improve this answer




























              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();
              }

              }
              }





              share|improve this answer


























                1












                1








                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();
                }

                }
                }





                share|improve this answer













                <?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();
                }

                }
                }






                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered May 8 '17 at 5:00









                Prince PatelPrince Patel

                14.5k65481




                14.5k65481






























                    draft saved

                    draft discarded




















































                    Thanks for contributing an answer to Magento Stack Exchange!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid



                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.


                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function () {
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f173348%2fcall-cms-page-from-custom-module%23new-answer', 'question_page');
                    }
                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    “%fieldName is a required field.”, in Magento2 REST API Call for GET Method Type The Next...

                    How to change City field to a dropdown in Checkout step Magento 2Magento 2 : How to change UI field(s)...

                    變成蝙蝠會怎樣? 參考資料 外部連結 导航菜单Thomas Nagel, "What is it like to be a...