How can I create an 'add to cart' button for simple products within a grouped product AND still get the grouped product image to show in the cart when there is not an image specified for the simple?
I've added the button, code as below, for each simple within a grouped product but when I click to add the associated simple to the cart it doesn't display an image in the 'my cart' preview or on the cart page - it's just showing the placeholder image. I've tried getAddToCartUrl instead but it has the same issue.
<button type="button" class="button btn-cart buy-btns" id="<?php echo $_item->getId(); ?>" onclick="setLocation('<?php echo Mage::helper('checkout/cart')->getAddUrl($_item); ?>' + 'qty/' + $(this).previous().value; ?>')">Add to cart</button>
I assume it's treating it as an independant simple, however I do not have images on all my simples and want it to display the grouped product image if the simple does not have an image. Some of my simple products are in more than one grouped so I can't just pull any grouped image that it's associated with.
I've looked at the function getAddUrl in the Core code (Cart.php) and notice it has $additional parameters. Could this help me or can anyone help me resolve this issues? Many thanks.