O'Reilly logo

Getting Started with Magento Extension Development by Branko Ajzele

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Adding the business logic

Now that we have registered our extension with Magento and defined the required configuration options, it's time to add the business logic as described in the following steps:

  1. Add the event observer to our config.xml file as shown in the following code:
    <?xml version="1.0" encoding="UTF-8"?>
    <config>
      <!-- ...other elements... -->
        <frontend>
          <events>
            <sales_quote_save_before>
              <observers>
                <foggyline_maxorderamount_enforceSingleOrderLimit>
                  <class>foggyline_maxorderamount/observer</class>
                    <method>enforceSingleOrderLimit</method>
                </foggyline_maxorderamount_enforceSingleOrderLimit>
              </observers>
            </sales_quote_save_before>
          </events>
        </frontend>
      <!-- ...other elements... -->
    </config>

    Event observers can be placed under config/global, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required