I have a simple product with an ID of 2 and a grouped product with an ID of 1. The simple product is associated to the grouped product.
I can add the simple product to the cart with this URL:
However, when I want to add the simple product to the cart as an associated product of the grouped product, so that it will be linked to the grouped product in the cart, I am coming up short.
Here is what I've tried:
Mage::helper('checkout/cart')->getAddUrl($groupedProduct, array('super_group' => 99));
This returns a seemingly working URL, but accessing it does not add anything to the cart, with the error "Please select a quantity":
I have also tried manually adding a
parameter to this URL without any change.
This does not work either:
Mage::helper('checkout/cart')->getAddUrl($groupedProduct, array('super_group' => array(2 => 99)));
This seems to completely ignore the second parameter.
Any ideas how I can create an URL that adds the simple product to the cart with the association to the grouped product?