2

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.

1

The quote class has:

public function setBillingAddress(Mage_Sales_Model_Quote_Address $address)
public function setShippingAddress(Mage_Sales_Model_Quote_Address $address)
public function addAddress(Mage_Sales_Model_Quote_Address $address) 

the address object is:

$address = Mage::getModel('sales/quote_address')->setAddressType($type);

$type can be Mage_Sales_Model_Quote_Address::TYPE_BILLING or Mage_Sales_Model_Quote_Address::TYPE_SHIPPING

or simply use:

public function getBillingAddress()
public function getShippingAddress()

both again methods of the quote object.

and use $quoteObject->collectTotals() to get the totals calculated.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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