How to add product qty to your product collection

March 25, 2013 15:14

Sometimes you have to add the product qty to your product collection which is not included in default. Normally people will get the collection first, then run the below code per product: If you have more than 10000 records, it spends too much time by additional SQL query and increase server loading. Actually you can [...]

Override Controllers in Magento

May 30, 2011 16:41

Sometimes you may have to override the core controllers to add some specific functions, don’t know how to override them? Just simply follow below: If you want to override the some controllers in adminhtml module for admin, add the following XML to your own module’s config.xml: If you want to override the some controllers in [...]

Add session message manually

December 30, 2010 16:31

Sometimes it doesn’t work when using the following codes to show the successful / error message: Doesn’t matter, you can use the below codes to show the successful / error message: That’s easy, right? Happy Magento’ing ~

Comments Off

How to completely disable Magento module

November 12, 2010 14:31

Disable Magento module? Easy, in admin panel, click the menu “System” -> “Configuration” -> “Advanced” in “Advanced” Section, select “disable” for the module you would like to disable, and it’s finish, right? Sorry but … NO! If you disable the module in admin panel, it will only disable the module output, not the module functionalities. [...]

How to create coupon code for fixed amount discount

November 11, 2010 15:55

In your selling period, sometimes you would like to make offer for promotion or festival. Here I will show you how to create a coupon code between a specific period for all products and customers with unlimited usage. In admin panel, click the menu “Promotions” -> “Shopping Cart Price Rules”, then the list for all [...]

Comments Off

Shortening Increment ID length for Orders, Invoices, Creditmemo and Shipments

November 8, 2010 11:52

By default, Magento use 8 digits for Orders, Invoices, Creditmemo and Shipments’ increment ID. However, sometime you would like to change the length to meet 3rd party’s system requirement. This can be easily accomplished by: modify the field “increment_pad_length” in the “eav_entity_type” table for whatever entity you’re wanting to modify. modify the field “increment_last_id” in [...]

How to get attribute option label in Magento with different store view

October 29, 2010 11:37

In Magento customization, sometimes you may want to get the value of attribute’s option. In below example I will show you how to do it. Assuming that there is an attribute named “dropdown_field” and contains 4 options label: “Option 1″, “Option 2″, “Option 3″, “Option 4″. The codes below get the option label which is [...]

Comments Off

Delete all orders, reset bestseller and most viewed products in Magento

October 28, 2010 09:48

In your Magento development period, you may create many order to test the checkout process. Before the website launch, you should find that there is no “delete” action for orders. What? Is it crazy? Unfortunately, it’s really crazy (maybe) that you cannot delete order in Magento by default. Like me, there are over hundred orders [...]

Comments Off

Add custom layout in CMS page

October 25, 2010 15:55

You may design some nice templates and layouts for your Magento shopping cart, but you cannot choose these layouts in CMS. You can add the following XML codes in “global” section in either one of config.xml in any module, but I suggest you to create a new custom module to change it. For example, if [...]

Comments Off

Re-run module’s setup routines in Magento

October 25, 2010 10:03

When you’re implementing custom module, normally you will have to re-run setup routines. Some people will create newer version of the setup file, but it will make you confuse after 100 modification. To do it, simply remove references to your modules in “core_resource” table and then, in backend, go to ‘System’ -> ‘Configuration’ -> ‘Advanced’ [...]

Comments Off