Book Image

Magento 1.4 Development Cookbook

By : Nurul Ferdous
Book Image

Magento 1.4 Development Cookbook

By: Nurul Ferdous

Overview of this book

<p>Magento is the fastest growing PHP-based e-commerce solution based on the Zend Framework. It is a robust CMS that provides developers the ability to enrich their store with extra functionalities using custom modules. Developing a Magento store to get the desired look and feel is not as easy as you might believe and may take hours due to the wealth of features available for you to use.<br /><br />Magento 1.4 Development Cookbook provides unparalleled guidelines to develop a much faster and more captivating Magento store by writing powerful custom modules. The book covers everything from common development tasks to integrating social networking plugins into Magento.<br /><br />If you choose to work through all the recipes from the beginning, you will have a development platform ready to work with Magento. You will also explore different ways to customize the look and feel of a Magento store to offer your customers a better user experience. Integration of Magento with WordPress to add striking functionality to your store will be accomplished in just a few steps. Some cool recipes take care of the Magento security measures by editing the parameters in the admin panel. Setting up a master-slave setup for Magento database is discussed along with other database optimizations in the database chapter. Developing new modules and widgets for Magento is thoroughly described. Optimizing Magento's performance is the most important part of this book, which is armed with some easy and incredible recipes dealing with YSlow, Page Speed, Siege, Apache bench, Apache configuration, php.ini optimization, and caching with APC or Memcached. The work procedure behind the wall is explained in an easy manner so that both novice and experienced developers can benefit from it. This book also has some recipes that are not only useful for Magento but also for any other LAMP-based project.</p>
Table of Contents (19 chapters)
Magento 1.4 Development Cookbook
Credits
About the Author
About the Reviewer
www.PacktPub.com
Preface
Index

Adding an RSS feed (last five tweets!)


You might have heard about the much hyped Twitter and might have an account with it. You will be glad if we could add it to your eCommerce store powered by Magento, probably in the sidebar.

We will add the last five tweets from a given Twitter account's username and Twitter feed. It's not a tough dance to dance! We can add it within a couple of minutes!

Getting ready

We will use Zend_Feed_Rss library to parse the RSS feed, which came with Magento and Zend Framework. Open your favorite PHP IDE and fire up the Magento project.

How to do it...

  1. Create a new file named tweets.phtml in the app/design/frontend/YOUR_PACKAGE/YOUR_THEME/template/callouts directory. In my case, it's app/design/frontend/base/default/template/callouts.

  2. Now paste the following code inside it and change the Twitter username and feed URL with your desired one:

    <?php
    /**
     * @var String $twitterUsername
     * change $twitterUsername with your desired username
     */
    $twitterUsername = 'packtpub...