Hi, as stated in the title, I would like to be able to change the product image based on the user’s option on a radio button for a bundled item. For example, I choose a radio button that changes the chassis of a product, the image should also change. This is similar to changing an image based on colour, but not quite the same. I would appreciate any help if you could please point me in the right direction. Thank you very much.
Here is whet you can try.
Edit app\design\frontend\{interface}\{theme}\template\bundle\catalog\product\view\type\bundle\option\radio.phtml
For each radio button in that file add an ‘onclick’ event. (or something else)
This is to code for a radio input (original)
Thanks a lot for replying. When I click on an image from “More Views”, however, the image still links to the old image. Also, when I add the item to the cart, the image is the original image. What would be the best way to handle these “problems”?
I thought you only needed it for the product details page and it seamed to be the easiest solution.
I have no idea how to keep the changed picture. I don’t even know how to approach this.
I can just recommend looking through the cart files maybe you find something.
The product image in the cart is displayed like this
public function getProductThumbnail() { if (!is_null($this->_productThumbnail)) { return $this->_productThumbnail; } return $this->helper('catalog/image')->init($this->getProduct(), 'thumbnail'); }
(see \app\code\core\Mage\Checkout\Block\Cart\Item\Renderer.php)
You can try to set a value for _productThumbnail so you won’t see the default thumbnail.
If you manage to do this post your solution here for everyone to ‘enjoy’.