You can easily create a static block in magento programmatically. Useful when you need to upload a bunch of blocks from csv. Here I haven't created a parser but just a simple code to save a block.
Magento product report resource collection allows you to get most popular products based on different options for example total number of product views. The code below will show you how to load magento's most viewed products collection.
functions we will use: addViewsCount, setOrder
Let's load this resource collection first like this:
Magento product report resource collection allows you to get most popular products based on different options for example total number of product orders.
functions we will use: addOrdersCount, setOrder
Let's load this resource collection first like this: