Magento 2.2.0 - fails to add bundle product
Asked Answered
D

3

8

I have tried to add product with bundle type that time getting error like below.

Could not save child: "Unknown entity type: Magento\Bundle\Model\Selection\Interceptor requested"

Desantis answered 1/12, 2017 at 7:2 Comment(0)
O
0

1. Check for JavaScript Errors

Bundle products in Magento rely heavily on JavaScript to update pricing and options. Open your browser’s developer tools and check for any JavaScript errors in the console while trying to add the product to the cart. If there are errors, they may indicate an issue with the theme or customizations.

2. Reindex and Clear Cache

Sometimes, Magento’s indexers or cache can be outdated, causing issues with products not behaving as expected.

Run the following commands to reindex and clear the cache:

php bin/magento indexer:reindex php bin/magento cache:clean php bin/magento cache:flush

3. Check Product Configuration

Ensure that:

All the child products of the bundle are in stock and enabled.
The bundle product itself is enabled, in stock, and properly configured.
The bundle product has been assigned to the correct website/store view.

4. Check Logs

Look at the Magento error logs for any clues. Magento logs are located in the var/log/ directory:

var/log/system.log
var/log/exception.log

Review these logs to see if there are any error messages or exceptions being thrown when trying to add the bundle product to the cart.

5. Check PHP Version Compatibility

Magento 2.2.0 has specific PHP version requirements. Ensure that you're using a supported PHP version (typically PHP 7.0.x for Magento 2.2.0). If you're on an incompatible version, this could cause issues with certain functionality, including bundle products.

6. Look for Extensions or Customizations

Disable custom modules: If you have custom modules or third-party extensions installed, they could be interfering with bundle product functionality. You can try disabling these one by one to see if the issue resolves.
Theme Issues: If you're using a custom theme, switch to the default Magento Luma theme to see if the issue is theme-related.

You can disable third-party modules by running:

php bin/magento module:disable Vendor_ModuleName

After disabling a module, clear the cache and test the product again.

7. Database Integrity Check

Sometimes, database integrity issues can cause problems with bundle products. Run the following query to ensure there are no missing records:

sql

SELECT * FROM catalog_product_bundle_option WHERE parent_id NOT IN (SELECT entity_id FROM catalog_product_entity);

If this returns any results, it means there are bundle options linked to products that no longer exist, and you may need to clean up these records.

8. Debugging the Add-to-Cart Controller

If you suspect there is an issue with how the request is being processed, you may need to debug the Magento\Checkout\Controller\Cart\Add controller. Add logging or use Xdebug to step through the code and identify where the issue occurs.

Orellana answered 18/9, 2024 at 11:16 Comment(0)
I
-1

i got same issues for this trouble, i resolved by add interface : Magento\Framework\ObjectManager\NoninterceptableInterface to Magento\Bundle\Model\Selection the final class define look like:

class Selection extends \Magento\Framework\Model\AbstractModel implements \Magento\Framework\ObjectManager\NoninterceptableInterface

Igloo answered 5/2, 2018 at 8:9 Comment(1)
Where exactly did you add this? Any more info?Ajani
P
-1

Change

class Selection extends \Magento\Framework\Model\AbstractModel

to

class Selection extends \Magento\Framework\Model\AbstractModel implements \Magento\Framework\ObjectManager\NoninterceptableInterface

on below file

vendor/magento/module-bundle/Model/Selection.php

Paramagnet answered 19/5, 2020 at 4:52 Comment(1)
You really shouldn't be editing core files. And editing something in the vendor directly will just get overwritten the next time that package is upgraded through composer. This is inappropriate for two reasons.Coatbridge

© 2022 - 2025 — McMap. All rights reserved.