How to get the price of items of bundle product in order?

enter image description here

  • There is an Admin REST API endpoint for getting all children of a bundle product using the parents sku. Check the documentation: devdocs.magento.com/redoc/2.3/admin-rest-api.html#tag/… – HelgeB Mar 4 '19 at 10:03
  • @HelgeB Tks. But I need the price of the bundle item for the order, because if I change the price, I will not have the correct value. – Lisandro Decker Mar 4 '19 at 18:27

You can use below code.

$orderItems = $order->getAllItems();

foreach ( $orderItems as $item ) { $customOptions = $item->getProductOptions(); $itemOptions = $customOptions['bundle_options'] echo '';print_r($itemOptions); // In this array, you can get the price of the selected option of the bundle product. }

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.