We have bundle products that are just groupings of simple products. I have disabled all options for the bundle products so that customers can't edit quantities etc. because I want them to act like simple products. For stock reasons, we need to use bundle products.
What I would like however is for the "ADD TO CART" Button to behave like a simple product and if it is clicked from say a "Category Page" It gets added directly to the cart. I.e. have the same functionality of simple products "add to cart" button from a "Category Page".
There are similar questions but so far I have not found a solution.
Current Code for the "Add To Cart Button" Is:
<?php $postParams = $block->getAddToCartPostParams($_product); ?>
<form data-role="tocart-form" action="<?php /* @escapeNotVerified */ echo $postParams['action']; ?>" method="post">
<input type="hidden" name="product" value="<?php /* @escapeNotVerified */ echo $postParams['data']['product']; ?>">
<input type="hidden" name="<?php /* @escapeNotVerified */ echo Action::PARAM_NAME_URL_ENCODED; ?>" value="<?php /* @escapeNotVerified */ echo $postParams['data'][Action::PARAM_NAME_URL_ENCODED]; ?>">
<?php echo $block->getBlockHtml('formkey')?>
<button type="submit"
title="<?php echo $block->escapeHtml(__('Add to Cart')); ?>"
class="action tocart primary">
<span><?php /* @escapeNotVerified */ echo __('Add to Cart') ?></span>
</button>
</form>