0

I have to create a single page that needs to show various type of products (simple, grouped and bundle) and they have to be added to the cart.

In addition to this I cannot set a "add to cart" button for every product, but I have to use only one "add to cart" button that works for all the products in the page.

Is it possible? Anyone could guide me in the right direction?

1 Answer 1

0

This doesn't seem like a very elegant way to sell multiple products, why not combine them all as a bundle product?

If you really don't want to, you can simply have your add button perform the following logic:

$quote = Mage::getSingleton('checkout/session');
foreach ($products as $product){
    $qty = 1; //or your desired qty
    $quote->addProduct($product, $qty);
}
$quote->collectTotals()->save();

Your Answer

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

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