Magento – Get shipping methods from address in multi-address shipping

addressshipping

I am trying to merge Addresses and Shipping information tabs of multi-address shipping in one step. I have the addresses dropdown, when I select any address option I want to get the Shipping methods associated with that address. How to do it?

I have already wrote ajax when address is changed, it will call the function where I have to get all the shipping methods and then echo all the shipping methods to display in the dynamic div.

I have quote id, product id, item information, address information. How to get shipping methods from it?

Best Answer

There are many ways to do this but i am sharing with you the best method i know of. - See more at:

Detail LINK

let me know if i can help you more

EDIT

Here i am giving you sudo code

 if ($this->_checkChangedAddress($bill_data, 'Billing', $bill_addr_id) || $this->getRequest()->getPost('payment-method', false))
        {
            if (isset($bill_data['email']))
            {
                $bill_data['email'] = trim($bill_data['email']);
            }

        $bill_result = $this->getOnepagecheckout()->saveBilling($bill_data, $bill_addr_id, false);

        if (!isset($bill_result['error']))
        {
            $pmnt_data = $this->getRequest()->getPost('payment', array());
            $this->getOnepagecheckout()->usePayment(isset($pmnt_data['method']) ? $pmnt_data['method'] : null);

            $result['update_section']['payment-method'] = $this->_getPaymentMethodsHtml();

            if (isset($bill_data['use_for_shipping']) && $bill_data['use_for_shipping'] == 1 && !$this->getOnepagecheckout()->getQuote()->isVirtual())
            {
                $result['update_section']['shipping-method'] = $this->_getShippingMethodsHtml();
                $result['duplicateBillingInfo'] = 'true';

                $ship_updated = true;
            }
        }
        else
        {
            $result['error_messages'] = $bill_result['message'];
        }
    }
Related Topic