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 to get all shipping methods by country? 
 
Siim
Jr. Member
 
Total Posts:  6
Joined:  2008-09-18
 

Hi.

I need to get all shipping methods that are available in a specific country. It is usually done by fetching them via Mage_Checkout_Block_Onepage_Shipping::getQuote()->getShippingAddress().

class Mage_Checkout_Block_Onepage_Shipping_Method_Available extends ...{

  
...

    public function 
getShippingRates()
    
{

        
if (empty($this->_rates)) {
        $this
->getAddress()->collectShippingRates()->save();
            
            
$groups $this->getAddress()->getGroupedAllShippingRates();
            return 
$this->_rates $groups;
        
}

        
return $this->_rates;
    
}

...

}

After saving the billing information (calling method Mage_Checkout_OnepageController::saveBillingAction()), I can get the shipping methods. This means, that I *must* always have the user address information available. I have a bit different situation: I want to merge billing address and shipping method into one step. Yes, I know that it is a bad idea… But I really need to know how to do it… How to get shipping methods by country.

Looking forward to thank you smile

Siim

 
Magento Community Magento Community
Magento Community
Magento Community
 
Siim
Jr. Member
 
Total Posts:  6
Joined:  2008-09-18
 

Hi again. I just found the solution. So, thank me smile

If someone is interested in how to do it… let me know.

Siim

 
Magento Community Magento Community
Magento Community
Magento Community
 
hoichuadau
Jr. Member
 
Total Posts:  1
Joined:  2009-03-05
 

HI
I need to get all shipping methods that are available in a specific country. It is usually done by fetching them via Mage_Checkout_Block_Onepage_Shipping::getQuote()->getShippingAddress().

 
Magento Community Magento Community
Magento Community
Magento Community
 
cindy.ming
Jr. Member
 
Total Posts:  7
Joined:  2010-04-26
 
Siim - 01 February 2009 12:12 PM

Hi again. I just found the solution. So, thank me :)

If someone is interested in how to do it… let me know.

Siim

HI Siim,

Can you send me your solution, I want to rewrite the checkout.

Thanks
Cindy

 
Magento Community Magento Community
Magento Community
Magento Community
 
daivats
Jr. Member
 
Total Posts:  11
Joined:  2010-10-12
 
Siim - 01 February 2009 12:12 PM

Hi again. I just found the solution. So, thank me smile

If someone is interested in how to do it… let me know.

Siim

Hello siim,

Please tell me how you fix this problem…

Thanks.

 
Magento Community Magento Community
Magento Community
Magento Community
 
12web
Jr. Member
 
Total Posts:  2
Joined:  2011-02-13
 

Hi, could you share your solution?

I´m also try to get all methods available, and its price.

Actually based on estimatePostAction() on im try to saving the shipping address using the following code

$quote = Mage::getSingleton(’checkout/session’)->getQuote();
$quote->getShippingAddress()
->setCity(’’)
->setCountryId(’US’)
->setPostcode(’32312’)
->setRegionId(’0’)
->setRegion(’’)
->setCollectShippingRates(true);
$quote->save();

and get the methods with:

$quote->getShippingAddress()->getGroupedAllShippingRates();

but its returning NULL.

Also, have some way to i get the shipping fee, without safe the product on the cart? I would like to bring, in each product page, the smallest shipping fee, so will appear not just the product price, but also how much will cost the shipping fee for this product, i pretend to save once the post code on session.

 
Magento Community Magento Community
Magento Community
Magento Community
 
ant_jullien
Jr. Member
 
Total Posts:  7
Joined:  2013-05-23
 

Everyone find the solution because I have the same problem ?

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