Throw errors in onepage checkout predispatch observers

Introduction In Magento 1.x.x, before calling the action method of a controller class, Magento dispatch an event called controller_action_predispatch_<route name>. Using the observers for this predispatch event, we can do anything that needs to be done before actually calling the action method. There are multiple steps available in the onepage checkout of default Magento 1.x.x. […]

Read more

Magento 1.x : Revert coupon code usage for cancelled orders

We have a requirement that customer should be able to use his coupon when the order is cancelled, either due to payment step or manually cancelling orders in the admin panel. I was searching the internet and got some basic ideas (http://magebase.com/magento-tutorials/quick-fix-coupon-codes-used-up-on-incomplete-transactions/). However the solution was not enough to handle shopping cart rules in different […]

Read more

Magento: Add back to top

Read more

Magento round grand total

To round the grand total please change the below function app\code\core\Mage\Sales\Model\Quote\Address\Total\Grand.php

Read more

Add attribute options programatically through csv file

Read more

Magento update product attribute options programmatically by attribute code with label

Read more

Get Store Information in Magento templates or CMS Pages

If you need to dynamically display the current Store’s Name, Telephone Number or Address in your Magento template, you can use the code to display as required.

Read more

Magento: Timestamp not saved when someone subscribes to the newsletter

It seems that, change_status_at field is intended to hold the last date of subscription/unsuscription. However this field is never be used or updated in magento. (May be a bug in Magento). However you can use the advantage of this field by adding a simple line of code inside Mage_Newsletter_Model_Subscriber::subscribe(). You just want to do this […]

Read more

How to make last name optional in Magento 1.9

1. Remove the classes for JS validation from your templates. customer/widget/name.phtml http://oxsoftwares.com/wp-admin/plugins.php Remove class=”required” from the label relating to the ‘lastname’ field at line 80 Remove < ?php echo $this->helper(‘customer/address’) ->getAttributeValidationClass(‘lastname’) ?> from the input relating to ‘lastname’ at line 82 2. Copy your core files from: /app/code/core/Mage/customer/Model/Address/Abstract.php /app/code/core/Mage/customer/Model/Customer.php into: /app/code/local/Mage/customer/Model/Address/Abstract.php /app/code/local/Mage/customer/Model/Customer.php And comment out […]

Read more

Magento. How to change emails logo

To upload your email logo: 1. From the Admin panel, select System > Configuration 2. In the Configuration panel on the left, under Design, selectTransactional Emails. 3. Click the Browse button and select the Logo Image from your computer; 4. In the Logo Image Alt field, type the alt text you want to use for […]

Read more