1

We're using grouped products, and we have the configuration set to use the parent image for thumbnails in the shopping cart view. This is working, but when we see those products in the wishlist, all we see is a placeholder image.

How can I make the thumbnail selection there work the same as on the cart page?

I have tried editing the wishlist/view.phtml to use:

$this->helper('catalog/image')->init($this->getItemProductForThumbnail($item), 'small_image')->resize(113, 113);

instead of

$this->helper('catalog/image')->init($product, 'small_image')->resize(113, 113);

but that breaks the page. I get this in the system.log:

2014-09-18T18:15:30+00:00 ERR (3): Recoverable Error: Argument 1 passed to Mage_Catalog_Helper_Image::init() must be an instance of Mage_Catalog_Model_Product, null given, called in...

So I don't think $item is what getItemProductForThumbnail($item) is expecting

14
  • can you update the code?
    – Keyul Shah
    Commented Sep 18, 2014 at 16:14
  • then once you have some code then please update the question so we can help you
    – Keyul Shah
    Commented Sep 18, 2014 at 16:22
  • @KeyulShah Oh you meant upLOAD the code...I haven't changed anything, so the wishlist code should still be stock Magento...Let me see if I can find it... Commented Sep 18, 2014 at 16:23
  • not whishilt group product code buddy
    – Keyul Shah
    Commented Sep 18, 2014 at 16:25
  • Let us continue this discussion in chat.
    – Keyul Shah
    Commented Sep 18, 2014 at 16:29

1 Answer 1

3

What your trying to do will require a lot of work

Take a look at /app/design/frontend/default/[theme]/template/checkout/cart/item/default.phtml

To get the correct image magento uses

 <img src="<?php echo $this->getProductThumbnail()->resize(160, 155); ?>

$this->getProductThumbnail() is define in

For Configurable item - app/code/core/Mage/Checkout/Block/Cart/Item/Renderer/Configurable.php

For Group item - /app/code/core/Mage/Checkout/Block/Cart/Item/Renderer/Grouped.php

For Simple item - /app/code/core/Mage/Checkout/Block/Cart/Item/Renderer.php

In /app/design/frontend/default/[theme]/template/wishlist/view.phtml

You check the product type using $_product->getTypeId() the lookup the image according to $this->getProductThumbnail()

1
  • I see now that the method I was using is depricated...I will have to put in logic to try this answer and let you know how it works. Commented Sep 18, 2014 at 18:46

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.