I want to set billing and shipping address to Quote. Actually I am creating an API for which I need to get Shipping Price and other normal checkout information. So I am thinking that, if I can able to set billing and shipping address to quote then it will easy to fetch shipping price from quote. Please help me to achieve this. Many thanks.
Magento – How to set billing and shipping address to Quote
magento-1.9
Best Answer
The quote class has:
the address object is:
$address = Mage::getModel('sales/quote_address')->setAddressType($type);
$type
can beMage_Sales_Model_Quote_Address::TYPE_BILLING
orMage_Sales_Model_Quote_Address::TYPE_SHIPPING
or simply use:
both again methods of the quote object.
and use
$quoteObject->collectTotals()
to get the totals calculated.