Wednesday 18 April 2012

Category Navigation Listings in Magento

Category toolbar has many options. By default is shows how many items are in the category, you can choose how many products you wish to be displayed per page, you can change the listing type (List or Grid) and you may choose Sort Order. This “Sort Order” can be confusing. The default “Sort Order” is “Best Value”. What does it mean? How is the Best value determined? Can we change the default sort order?
Listing Categories in Magento 1.4.1.1 & Above Firstly, you need to make sure the block that you're working is of the type catalog/navigation. If you're editing catalog/navigation/left.phtml then you should be okay. In my previous example, we used the Category model to load in category information. This can be slow and often loads in more information than we need for a simple navigation menu. This version uses the Varien_Data_Tree class.
helper('catalog/category') ?> getStoreCategories() ?> 0): ?>
  • escapeHtml($category->getName()) ?> isCategoryActive($category)): ?> getChildren() ?> 0): ?>
    • escapeHtml(trim($subcategory->getName(), '- ')) ?>


















How to change default Sort Order The file you need to look at is: 


/app/code/core/Mage/Catalog/Block/Product/List/Toolbar.php Since we’ll modify it, make a copy to /app/code/local/Mage/Catalog/Block/Product/List/Toolbar.php One there, you will notice this code at the beginning of the file: $this->_availableOrder = array( 'position' => $this->__('Best Value'), 'name' => $this->__('Name'), 'price' => $this->__('Price') ); Default order takes the first value available. So, all you have to do is to either: reorder it if you want to have a selection in the Toolbar or set only one value of choice if you will remove the selection from the toolbar I hope this will help somebody.





















Ecommerce websites when developed using the most popular and powerful platform as Magento would be sure to bring in lot of business for clients. Touch Website Solutions has worked on different Magento development projects for clients like PSD To Magento from different parts of the world with different unique requirements. Why all the hype for Magento ecommerce development,because it is more dynamic, feature-rich and highly customizable. Amount of customization that can happen on Magento is impossible to be done on other ecommerce development platforms.

No comments:

Post a Comment