Hi everybody,
my goal is show in checkout/cart the bundle product and the child selected.
This is my code, but doesn't work.
$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$product = $objectManager->get('Magento\Catalog\Model\Product')->load(703);
$listBlock = $objectManager->get('\Magento\Catalog\Block\Product\ListProduct');
$addToCartUrl = $listBlock->getAddToCartUrl($product);
<form data-role="tocart-form" action="<?php echo $addToCartUrl; ?>" method="post">
<?php echo $block->getBlockHtml('formkey')?>
<button type="submit"
title="Add to Cart"
class="action tocart primary">
<span>Add to Cart</span>
</button>
</form>
Can someone tell me what's wrong?
Thanks
you need to pass bundle options array into the post.