0

I have a requirement in magento2.4.6 as we know when we create a order for bundle product order price is calculated based on child product price, Here i need to add a custom price for the Bundle parent product(that i have added using catalog eav attribute) and when we create an order with this product the calculation should take place with this custom price no need to consider the child product price i have write the code to create order but cant replace the bundle cart price with custom price

foreach($orderData['items'] as $item){
            if (isset($item['bundle_options'])) {
                $product = $this->productRepository->getById($item['product_id']);
                $params = [
                    'product' => $item['product_id'],
                    'bundle_option' => $item['bundle_options'],
                    'qty' => $item['qty']
                ];
                $this->cart->addProduct($product,$params);
            }
            $cart = $this->cart->save();
            $quoteId = $cart->getQuote()->getId();
        }

Can anyone Help me on this

1 Answer 1

0

Finally I got the Solution

Disable the Dynamic Price option while creating a Bundle Product in Magento, then you will have an opportunity to specify a fixed price for the Main (Parent) Bundle Product. Also, you will be able to indicate Price Difference (either amount or percent value) for each Simple (Associated) Product included in the Bundle

enter image description here

enter image description here

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.