cancel
Showing results for 
Search instead for 
Did you mean: 

How to get bundle items name and cost of that bundle items using Order Object in magento?

SOLVED

How to get bundle items name and cost of that bundle items using Order Object in magento?

Bundle items name & Cost get using Order Object in success.phtml page after complete place order.

5 REPLIES

Re: How to get bundle items name and cost of that bundle items using Order Object in magento?

Hi @Ashish_k_php,

 

If you have the $order object you should be able to do something like this:

 

foreach ($order->getAllItems() as $item) {
    echo $item->getName() . PHP_EOL;
    echo $item->getSku() . PHP_EOL;
    echo $item->getPrice() . PHP_EOL;
}
--
If you've found one of my answers useful, please give "Kudos" or "Accept as Solution"

Re: How to get bundle items name and cost of that bundle items using Order Object in magento?

Thank you @Damian Culotta for the reply.

Yes, this is working fine on my end but not get selected bundle items Qty.

How can we get that Qty?

Re: How to get bundle items name and cost of that bundle items using Order Object in magento?

Hi @Ashish_k_php,

 

Did you mean the Ordered Qty?

--
If you've found one of my answers useful, please give "Kudos" or "Accept as Solution"

Re: How to get bundle items name and cost of that bundle items using Order Object in magento?

Re: How to get bundle items name and cost of that bundle items using Order Object in magento?

Hi @Ashish_k_php,


Maybe using this?

 

foreach ($order->getAllItems() as $item) {
    echo $item->getName() . PHP_EOL;
    echo $item->getSku() . PHP_EOL;
    echo $item->getPrice() . PHP_EOL;
    echo $item->getQtyOrdered() . PHP_EOL;
}
--
If you've found one of my answers useful, please give "Kudos" or "Accept as Solution"