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.

1 ACCEPTED SOLUTION

Accepted Solutions

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;
}

View solution in original post

5 REPLIES 5

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;
}

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?

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;
}