I am creating a Custom APi to retrieve products in cart how can i get the bundle product details as displayed in web currently how i do this

$childrens = $item->getChildren();
    public function getBundleData($childrens) {
        $data = [];
        $count = 0;
        foreach($childrens as $children) {
            $data[$count]['id'] = $children->getId();
            $data[$count]['name'] = $children->getName();
            $data[$count]['price'] = $children->getData('price_incl_tax');
            $data[$count]['quantity'] = $children->getQty();
        return $data;

But I also want to get the option label option id selected option Id etc as displayed in below figure please help thanks in advanced

enter image description here


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Browse other questions tagged or ask your own question.