Magento get quote from order


Magento get quote from order : You can get quote id from the order as quote id is saved along with the order detail. You can get quote id from order object. Once the quote id is received load quote object to fetch the quote detail. Here is an example of getting quote id , quote detail from order.


Magento get quote from order

First get the quote id and then load quote to get more details.

Magento get Quote Id From Order

Here is syntax to get quote id from order in magento –

Magento get quote id from order

$orderIncrementId = 902;

$order = Mage::getModel('sales/order')->loadByIncrementId($orderIncrementId);

//now get quote id from order object
$quoteId = $order->getQuoteId();

The Above example will give quote id from which the order was created.

Magento get Quote object using Quote Id

Magento get quote from order


$orderIncrementId = 902;

$order = Mage::getModel('sales/order')->loadByIncrementId($orderIncrementId);

//now get quote id from order object
$quoteId = $order->getQuoteId();

$quote = Mage::getModel('sales/quote')->load($quoteId);

Advertisements

Add Comment

📖 Read More