site magento

Display a BestSellers block on your Magento homepage

One of the frequent questions you ask when installing Magento is how to add Bestsellers block to your homepage

Indeed, Magento - in its standard version at least - does not provide this feature.

Nevertheless, even if the lack of this feature might be quite weird for an ecommerce platform, it is not a blocking issue. Quite the contrary, it allows you to realise how easy it is to create new blocks on Magento, or, at least, the flexibility of the architecture of Magento.

  1. Get the data

    This could be the most difficult step since you must know perfectly the Magento core object model.
    As soon as you know where to collect data (in this case, sold products) and how to request them (in this case, by descending order of sales), getting required data is pretty easy, it just take one line (actually several lines here, but just to allow a better readability).

    $_productCollection = Mage::getResourceModel('reports/product_collection')
        ->addAttributeToSelect('*')
        ->addOrderedQty()
        ->setOrder('ordered_qty', 'desc');

  2. Create your BestSellers block

    Remember to use MVC pattern: Zend framework, and therefore Magento, ensure that each object has its specific role.
    Creat your business object:
    In a file that could be app/code/local/ma_librairie/Bestseller/Model/Bestseller.php write your business rules (here: getting sold products by descending order of sales).
    Then in a file app/code/local/ma_librairie/Bestseller/Block/Bestseller.php extend class Mage_Core_Block_Template that will pass data to display block.
    At last, in file app/design/frontend/mon_theme/default/template/catalog/product/view/bestseller.phtml display block content.
    Of course these files have to be declared in the appropriate XML configuration files.

  3. Display your block

    Set up your block on yout active layout.
    Either change the XML file of your layout, or add it on your homepage from Magento backoffice.

For more information about Magento Templates, you may read the article Creating templates for your Magento website.

How to use Magento CMS feature to create multilingual content

Magento natively integrates CMS features.

Two types of objects are available to allow you to create content in Magento:

  • Pages, which allow you to display general information such as your terms of sale, contact information, store locations, et cetera.
  • Static blocks ( "static" is not quite the appropriate term as discussed below, it means that the content of these blocks is editable directly from the back-office, without modifying php source code), which allow you to enter information to be usually displayed on several pages, such as footers, headers, but also specific informations (predictive site shut down, promotions ...).

Note that these objects, static pages or blocks, may contain elements dynamically calculated and it is relatively easy to make create new ones for the webmaster (for instance to display current date and time, number of online customers, last item sold...).

Furthermore, these blocks and pages can also contain other blocks, static (ie, whose content is changed here) or not (block articles, bestsellers block ...).

Finally, these pages and blocks fit perfectly into the Magento architecture: for the same page or static block identifier, you can (but do not have to) create one version per View Store. It becomes very easy to create specific content for each language and the system will display the version corresponding to the language of the customer without you having wrote a single line of code.

Of course the system is not without fault and we can regret:

  • The lack of a rich text editing tool,
  • The inability to manage hierarchical content,
  • The lack of online form management.

We shall see very soon how to find a workaround these deficiencies.

Magento Top 10 Things to Know

Magento Top 10 things to know: Magento software has made quite a buzz since the version 1 release in 2008 and revolutionized the world of e-commerce solutions. The reasons for this enthusiasm about Magento websites are numerous, here are 10 of them.

  1. Opensource Software, Solid Company

    Written in PHP, based on the Zend framework, Magento is an opensource solution.
    This means that source code is public: everyone has access to it, for free. Contributions from anyone are welcome and speed of integration of new features is increased, as it was the case for example for VAT management: the first official release was not adapted to European market but the openness of the code helped solving this problem within a few weeks.
    However, Magento was developed by a for-profit company, Varien, ensuring uniformity and consistency in functionality and continuity in developments, with over sixty persons working on it .

  2. Turnkey Software

    Download Magento, unzip the archive on your Apache / PHP / MySql server, run the automatic installation script, go to the admin panel to customize Magento configuration and you're ready to sell!
    Having that done, updating the system when new releases comes out can be easily done by going back to the administration panel, clicking only twice on your mouse, no more.
    Of course, you would still have to customize the look of your store and integrate your catalog content.

  3. Highly Customizable Data Model, Long Feature List

    Whether you are selling shoes, socks, clothes, curtains, wine, hotel rooms or virtual downloadable products, Magento data model is designed and thought to fit your needs, while offering the standard features that you are entitled to expect from an e-commerce website: product customizable attributes (sizes, colors ...), configurable products, Cross-Sell, Up-Sell, et cetera.
    Moreover, version 1.3 introduced the concept of flat catalog that provides an excellent compromise between performance and customizability.
    Among the many standard features available, you will find tools for managing price and promotions.

  4. Advanced Management for Template Design

    Magento Design system allows you to manage the template of your Magento website.
    Supplied with a basic graphic design, Magento allows you to lay out your shop as you want to, while allowing you to benefit from future releases. (See Creating templates for your Magento website.)

  5. Designed for Search Engine Optimization

    Allowing URL rewriting, meta-data fields, Google Site Map management, etcetera, Magento gives you all the tools you need for Search Engine Optimization.
    (See Magento et le référencement naturel)

  6. Global Software

    Thanks to Magento your store is ready for global sales, with the possibility (but not the obligation) to define for each area or country:

    • its own currency,
    • its own language (many languages are available),
    • its own graphic design,
    • its own sub-catalog,
    • its own shipping rules,
    • et caetera .

  7. Payment Modules

    Magento currently knows how to handle over 200 payment systems , including:

    • ATOS / Sips,
    • CyberMUT Paiement / Paiement CIC,
    • CyberP@iement,
    • FIAT-NET ReceiveAndpay,
    • Google Checkout,
    • Ogone,
    • Check,
    • Paybox,
    • PayPal,
    • SPPLUS,
    • et caetera .

    It is also easy to add new ones.

  8. Shipping modules

    Magento currently knows how to handle over 60 shipping systems , including:

    • Free shipping management,
    • Chronospot,
    • Colissimo,
    • DHL,
    • FedEx,
    • TNT, relais colis,
    • UPS,
    • et caetera .

    It is also easy to customize a module to suit your logistical constraints and your pricing policy, or even create new ones.

  9. Connecting to Your System

    Magento provides standard modules import / export that allows you to import files to Magento.
    These modules can be easily automated and customized to fit in your existing system. (See Importing files into Magento)

  10. Robust Software, Reliable Solution

    With today hundreds of e-Store running on Magento , some of which containing over 300,000 records (three hundred thousand) Magento is now recognized as a reliable and trustworthy software, whatever your needs are.

Importing files into Magento

Among the many standard features, one of them is the subject of many questions: importing files into Magento.

Indeed, except for a few pure players who can just rely on Magento back-office, writing interfaces connections with existing information system is a prerequisite when setting up an e-Commerce solution.

This might involve:

  • updating your Magento catalog (SKU, description, pictures...) from an existing back office,
  • updating stocks quantities from an existing back office,
  • pushing new orders in batch mode (eg. once a day) or interactive mode (in real time) from Magento to logistic systems,
  • pulling orders (order statuses, shipping tracking IDs ...), from logistic system and send e-mails to customers,
  • pushing orders data to accounting systems,
  • pushing customers data to CRM systems,
  • et caetera.

Of course, these operations, their automation and especially their test running can not be built in a Magento module nor in the Magento configuration panel. However, Magento offers APIs and connectors that provide solutionq for writing connectors that can be easily and cleanly plugged to the core system. This allows to have less specific developments and insure compatibility with future versions. The most time consuming part will eventually be the specification of your business needs.