2

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>

1 Answer 1

0

You should try grouped products not bundle.

A grouped product consists of simple standalone products that are presented as a group. You can offer variations of a single product, or group them by season or theme. Presenting a grouped product can create an incentive for customers to purchase additional items. A grouped product provides an easy way to offer variations of a product, and list them all on the same page.

For example, you might sell open stock flatware, and list every type of utensil that is used in a formal place setting. Some might order multiple salad forks, fish forks, dinner forks, dinner knives, fish knives, butter knives, soup spoons, and dessert spoons. Other customers might order a simple fork, knife, and spoon. Customers can order as many of each item as they want.

1
  • There are various reasons to prefer bundles over grouped products. For example, you can't really configure the prices of grouped products well.
    – TheFrakes
    Apr 28, 2021 at 12:38

Your Answer

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

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