Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

How do you read from the configuration (settings managed in backend)? 
 
One Step Checkout
Member
 
Avatar
Total Posts:  34
Joined:  2008-03-21
Norway
 

Hello guys and girls,

I am trying to modify the Cart Sidebar to display some data related to free shipping. In the block’s code, I need to find out what the “Minimum subtotal” value is set to, so I can know whether the user has reached the amount required for free shipping yet.

At the moment I have this code ..

$quote $this->getQuote()->getShippingAddress();
$carriers $quote->getGroupedAllShippingRates();
                
foreach(
$carriers as $code => $carrier)    {
    
if( $code == 'freeshipping' )    {
        
foreach($carrier as $key => $rate)    {
                
# Here I have the freeshipping/freeshipping rate in $rate
        
}
    }
}

You can set a minimum amount for free shipping in the administration interface. How can I get that value from the code I have? The scope is currently within Mage_Checkout_Block_Cart_Sidebar. I think the configuration name is something like ‘carrier/freeshipping/free_shipping_subtotal’ ..

Any ideas?

 
Magento Community Magento Community
Magento Community
Magento Community
 
Core
Member
 
Total Posts:  68
Joined:  2008-03-09
 

Assuming your module is under app\code\local\freeshipping\freeshipping

and your system.xml file is configured something like

<config>
<sections>
<payment>
<groups>
<freeshipping translate="label" module="freeshipping">>
...

Then I think

$rate Mage::getStoreConfig('freeshipping/freeshipping/rate');

Should do the trick

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top