Skip to main content
Tweeted twitter.com/StackMagento/status/865688137355456512
replaced http://magento.stackexchange.com/ with https://magento.stackexchange.com/
Source Link

As the part of creating bundle product programmatically in Magento 2. I am getting below error. Even i removed var/cache and generation.

This may be a duplicate question but none of the answer is working for this issue.

Fatal error: Cannot instantiate interface Magento\Catalog\Api\Data\ProductExtensionInterface in \ObjectManager\Factory\Dynamic\Developer.php on line 73

Used below code as the reference of linklink

$productExtension = $objectManager->create(\Magento\Catalog\Api\Data\ProductExtensionInterface::class);
$option = $objectManager->create(\Magento\Bundle\Api\Data\OptionInterface::class);
$option->setTitle('Size');
$option->setType('radio');
$option->setRequired(true);
$option->setPosition(1);
//$option->setProductLinks($links);
$productExtension->setBundleOptions([$option]);
$_product->setExtensionAttributes($productExtension);

I am using object manager for temporary/quick purpose, will convert the object manager to constructor injunction.

Any one can help me on this issue.

As the part of creating bundle product programmatically in Magento 2. I am getting below error. Even i removed var/cache and generation.

This may be a duplicate question but none of the answer is working for this issue.

Fatal error: Cannot instantiate interface Magento\Catalog\Api\Data\ProductExtensionInterface in \ObjectManager\Factory\Dynamic\Developer.php on line 73

Used below code as the reference of link

$productExtension = $objectManager->create(\Magento\Catalog\Api\Data\ProductExtensionInterface::class);
$option = $objectManager->create(\Magento\Bundle\Api\Data\OptionInterface::class);
$option->setTitle('Size');
$option->setType('radio');
$option->setRequired(true);
$option->setPosition(1);
//$option->setProductLinks($links);
$productExtension->setBundleOptions([$option]);
$_product->setExtensionAttributes($productExtension);

I am using object manager for temporary/quick purpose, will convert the object manager to constructor injunction.

Any one can help me on this issue.

As the part of creating bundle product programmatically in Magento 2. I am getting below error. Even i removed var/cache and generation.

This may be a duplicate question but none of the answer is working for this issue.

Fatal error: Cannot instantiate interface Magento\Catalog\Api\Data\ProductExtensionInterface in \ObjectManager\Factory\Dynamic\Developer.php on line 73

Used below code as the reference of link

$productExtension = $objectManager->create(\Magento\Catalog\Api\Data\ProductExtensionInterface::class);
$option = $objectManager->create(\Magento\Bundle\Api\Data\OptionInterface::class);
$option->setTitle('Size');
$option->setType('radio');
$option->setRequired(true);
$option->setPosition(1);
//$option->setProductLinks($links);
$productExtension->setBundleOptions([$option]);
$_product->setExtensionAttributes($productExtension);

I am using object manager for temporary/quick purpose, will convert the object manager to constructor injunction.

Any one can help me on this issue.

Source Link
Krishna ijjada
  • 9k
  • 6
  • 42
  • 70

Fatal error: Cannot instantiate interface in Magento 2?

As the part of creating bundle product programmatically in Magento 2. I am getting below error. Even i removed var/cache and generation.

This may be a duplicate question but none of the answer is working for this issue.

Fatal error: Cannot instantiate interface Magento\Catalog\Api\Data\ProductExtensionInterface in \ObjectManager\Factory\Dynamic\Developer.php on line 73

Used below code as the reference of link

$productExtension = $objectManager->create(\Magento\Catalog\Api\Data\ProductExtensionInterface::class);
$option = $objectManager->create(\Magento\Bundle\Api\Data\OptionInterface::class);
$option->setTitle('Size');
$option->setType('radio');
$option->setRequired(true);
$option->setPosition(1);
//$option->setProductLinks($links);
$productExtension->setBundleOptions([$option]);
$_product->setExtensionAttributes($productExtension);

I am using object manager for temporary/quick purpose, will convert the object manager to constructor injunction.

Any one can help me on this issue.