Product List: Show out of stock products in the last

In this blog post, we will be sharing how to show out of stock products at last of product listing page. Assumption: MagePsycho_Productsort is the skeleton module Steps: 1. Register event: catalog_product_collection_load_before File: app/code/local/MagePsycho/Productsort/etc/config.xml … <frontend> <events> <catalog_product_collection_load_before> <observers> <magepsycho_productsort_catalog_product_collection_load_before> <type>singleton</type> <class>magepsycho_productsort/observer</class> <method>catalogProductCollectionLoadBefore</method> </magepsycho_productsort_catalog_product_collection_load_before> </observers> </catalog_product_collection_load_before> </events> </frontend> … 2. Implement the observer model: File: …

Read more

Extend Magento sales order grid using event observer

You can add new columns to the Sales Order grid easily by extending the block class: Mage_Adminhtml_Block_Sales_Order_Grid But this is not the preferred way due to conflict issues. Here I will show you how to extend order grid by using events(core_block_abstract_to_html_before & sales_order_grid_collection_load_before) only. For example purpose, we will be adding Payment Method to sales …

Read more

Change shipping price & handling fee on the fly in Magento

Problem: How do I change shipping prices and handling fees on the fly? You may want to have different shipping prices for different scenarios. Your scenario could be any of the following: Different shipping price based on the shipping address Different shipping price based on weight Different shipping price based on categories Different shipping price …

Read more

Password protecting your development site using .htaccess / .htpasswd

You may want to restrict the development site from the search engine or from direct access. One of the popular ways of doing so is to use Apache2 Basic Authentication. Here we will be discussing on how to password protect your development site using Apache2 Basic Authentication which makes use of .htaccess & .htpasswd files. …

Read more

Sending JSON data to the remote server

Sending JSON data to the remote server

JSON: JavaScript Object Notation. JSON is syntax for storing and exchanging text information. Much like XML. JSON is smaller than XML, and faster and easier to parse. You may need to post JSON data to the server for different purposes. If you are wondering about ‘How to send JSON data to the remote server?’ then …

Read more