Snippets

Get all items in an order

If you need to know how to retrieve all the items in a customer order here is how: Read More

, ,

Check if customer is logged in

$customerStatus = Mage::getSingleton('customer/session')->isLoggedIn();

, , ,

Get cat­e­gory prod­ucts or­dered by num­ber of sales

This snippet is useful if you want to know which products are the bestsellers, this can be used on custom reports, lists, etc. Read More

, ,

Load Category/Product by Attribute

If you ever need to manually load a category or product you can do it either by id or by attribute:

Read More

Displaying a Product Attributes

Depending on where you want to call a product attribute there are different methods for doing it: Read More

Pager toolbar for any Collection

This code will call the toolbar block, pass your collection (previously created) and display the pagination links. It will correctly page through your collection. Read More

Calling a static block inside the template

The following snippet is incredible useful specially when you are implementing custom layouts with menus, static blocks of text and so on the following code should work with any version of Magento Read More