My client wanted to offer free shipping only to registered customers, but also wanted all the people who clicked “Register” option at checkout, instead of “Checkout as Guest”, to be eligible for free shipping, too. This looked like several hours of work at first but came up pretty simple. My solution involved adding few lines of code to two different files, and creation of system config value through system.xml. It was quickly done, so I chipped in a feature to enable free shipping to specified customer groups, instead of all registered, for greater flexibility.
Instructions on how to do it are in the spoiler.
Spoiler Inside
Add this code to Shipping/Model/Carrier/Freeshipping.php, collectRates() method, after first clause (approx line 55):
And create a module with system.xml file with following content:
<?xmlversion="1.0"?><config><sections><carriers><groups><freeshipping><fields><group_idstranslate="label"><label>Customer group ID-s</label><frontend_type>text</frontend_type><sort_order>3</sort_order><show_in_default>1</show_in_default><show_in_website>1</show_in_website><show_in_store>0</show_in_store><comment>ID's of customer groups that qualify for free shipping (ex 1,4,7). Leave blank for all.</comment></group_ids></fields></freeshipping></groups></carriers></sections></config>
2 Responses to Free shipping only for registered users
thanks.
does this work on later versions of magento?