I am attempting to retrieve the quote items that have a particular parent_item_id
I actually have an instance of the parent quote item which I retrieved like so:
$parentQuoteItem = Mage::getModel("sales/quote_item")->load($quoteItemId);
How can I extract the children of this quote item?
I have tried calling the getChildren() method but unfortunately its giving an empty array:
$parentQuoteItem->getChildren()
Any help is greatly appreciated :)
---------------UPDATE-----------------------------
I kinda solved the issue with the following code:
$aChildQuoteItems = Mage::getModel("sales/quote_item")
->getCollection()
->setQuote($mQuote)
->addFieldToFilter("parent_item_id", $quoteItemId);
You probably need to load the quote first before calling getparent/child on the item...
$parent_quote = Mage::getModel("sales/quote")->load($quote_id);
$q_item = $quote->getItemById('q_item_id_looking_for')->getChildren();
// do something with them...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With