3

I am writing a custom module, which deals with order creation, for multiple stores with free-shipping disabled.

What should I call in my install scripts or add to my config.xml in order to enable shipping_method == freeshipping_freeshipping and set it's minimum order amount to 0 ?

2 Answers 2

4

You should be able to do the following in your setup script to enable free shipping.

$installer->setConfigData('carriers/freeshipping/active', true);
$installer->setConfigData('carriers/freeshipping/free_shipping_subtotal', 0);

Where the installer is of type Mage_Core_Model_Resource_Setup

1

You can do this using install which is update this free shipping method details using

$groups=array();
$groups[freeshipping][fields][active][value]=true; 
$groups[freeshipping][fields][free_shipping_subtotal][value]=0

here [freeshipping][fields][active][value] is field name .you can see this in here freeshipping is shipping method code and active is field name of activation

from admin input field

Mage::getModel('adminhtml/config_data')
    ->setSection('carriers')
    ->setWebsite(null)
    ->setStore($StoreId)
    ->setGroups($groups)
    ->save();  

if you have multi store then you need fetch all store and run this code in foop

see more at

https://stackoverflow.com/questions/2474039/magento-update-store-logo-programmatically

1
  • Thank you, very much for the answer, Mr. Bera. Unfortunately some IRL changes, prevented me from implementing what was going to be a golden-plating functionality for the said client. Regardless I will test the solution at 1st available opportunity and accept the answer. Thanks again. Commented Oct 23, 2014 at 17:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.