All about Magento E-commerce Store.......MagentoForum: 2012

Sunday, January 8, 2012

Magento: How to get top rated products?

Here, I will be showing you how to get the top/highest rated product.
The basic idea for getting the top rated products is fetching all products, looping through them, getting ratings of each product and populating a ratings array. After that sort the array and then slice the array for limiting the number of product to display.

Magento: How to setup Ogone Payment Method?

Ogone is one of the leading European Payment Service Providers with more than 28.000 clients across 40 countries.
Ogone is connected through certified links to more than 200 European banks/acquirers that enable handling of international payment methods like Visa, MasterCard, American Express, Diners Club and JCB as well as local ones like iDEAL and Machtigingen in The Netherlands, Solo and Maestro UK in United Kingdom and ELV and giropay in Germany.

Magento: Get sub categories and product count

Here, I will be showing you the code to get sub categories of a particular category and the number of products (product count) present in the sub categories.
Like, I have a category named Furniture. The sub categories under Furniture are Living Room and Bedroom. Now, I want to show the sub categories under Funiture and the products associated with the sub categories (Living Room and Bedroom).

Magento: How to get all associated children product of a configurable product?

A configurable product can have multiple other products associated to it.
Here is the code to fetch all the children products that are associated with a configurable product.
Here goes the code :)

Magento: Product Edit Warning: Invalid argument supplied for foreach()

While editing product programatically from frontend. I was trying to change the status of the product with the following code:

Magento: Reindex Data Programmatically

This article shows how to reindex Magento Data Programmatically (through code).
You can manually reindex data from System -> Index Management. However, this article is concerned how this can be done through code/programming.

Magento: How to get product rating and review?

Here is the code to get ratings and reviews for any particular product.
 * Getting reviews collection object

Magento: Show/Hide website to search engines by adjusting robots meta tag

The Robots META Tag is meant to provide users who cannot upload or control the/robots.txt file at their websites, with a last chance to keep their content out of search engine indexes and services.
<meta name="robots" content="robots-terms">

The content=”robots-terms” is a comma separated list used in the Robots META Tag that may contain one or more of the following keywords without regard to case: noindex, nofollow, all, index and follow.
noindex = Page may not be indexed by a search service.
nofollow = Robots are not to follow links from this page.
You can find more about the robots meta tag over here:
There is an easy way in Magento to adjust robots meta tags. You can simply choose from admin settings.
Go to System -> Configuration -> Design -> HTML Head -> Default Robots
You have the following options to choose:
- index, follow
- noindex, follow
- index, nofollow
- noindex, nofollow
If you have a live site (production site) then choose ‘index, follow‘. If you have a test site (development site) then choose ‘noindex, nofollow‘.
Hope it helps. Thanks.

Magento: Show/Hide Demo Store Notice

A demo store is where there are products but the order done by customer is not processed. If your website is in development mode then it is better to enable demo store notice.
Enabling demo store notice in Magento is very simple. You just need to select an option in configuration settings in admin panel.

Go to System -> Configuration -> Design -> HTML Head -> Display Demo Store Notice
By default, it is set as ‘No’. To enable demo store notice, select ‘Yes’.
Now, you will see a notice bar at top of your page saying ‘This is a demo store. Any orders placed through this store will not be honored or fulfilled.
Hope it helps. Thanks.