Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8862139
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T15:39:24+00:00 2026-06-14T15:39:24+00:00

My problem: I need to retrieve the main product image from a cut down

  • 0

My problem:

I need to retrieve the main product image from a cut down product object which is supplied by the class: Mage_Bundle_Model_Resource_Price_Index

My code demonstrating the issue:

$_product = $this->getProduct();
$_options = Mage::helper('core')->decorateArray($this->getOptions());

foreach($_options as $_option):
    $_selections = $_option->getSelections();

    foreach ($_option->getSelections() as $tmpsel) {
        var_dump($tmpsel->getImageUrl());
    }

Which returns my placeholder image:

http://dev.dev/media/catalog/product/cache/7/image/265x/0dc2d03fe217f8c83829496872af24a0/placeholder/default/logo_3.jpg

My horrible and hacky work around:

In order to get correct image Url, I have resorted to loading a completely new product object, which is terribly inefficient.

foreach ($_option->getSelections() as $tmpsel) {
    $product = Mage::getModel("catalog/product")->load($tmpsel->getId());
    $image = Mage::helper('catalog/image')->init($product, 'image');        
    var_dump($image."");
}

This returns correctly:
http://dev.dev/media/catalog/product/cache/7/image/0dc2d03fe217f8c83829496872af24a0/M/P/MP1428219-107-Main.jpg

What I want to do:

I want to be able to use the catalog/image helper with the selection ($tmpsel), but when I try I end up getting the placeholder image again.

foreach ($_option->getSelections() as $tmpsel) {
    $image = Mage::helper('catalog/image')->init($tmpsel, 'image');      
    var_dump($image."");
}

Extra Info:

Anything I think of that could help I will add here

Cut down product object includes some reference to image

  'small_image' => string '/M/P/MP1428219-107-Main.jpg'
  'thumbnail' => string '/M/P/MP1428219-107-Main.jpg' 

Description of getSelection()

In: ./app/code/core/Mage/Bundle/Model/Resource/Price/Index.php

* Retrieve bundle options with selections and prices by product

The function uses low level SQL to generate the collection, so I can always extend it to add options if needed, not sure which options though.


Thank you for reading, hope someone can give me a good way of doing this, will keep updated.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T15:39:25+00:00Added an answer on June 14, 2026 at 3:39 pm

    Init() method require a product object

    init(Mage_Catalog_Model_Product $product, $attributeName, $imageFile=null)
    

    Try

    <?php echo $this->helper('catalog/image')->init($tmpsel, 'small_image')->resize(40,40); ?>
    

    You do not have ‘image’ but you do have ‘small_image’ attribute

    See Magento – how to retrieve bundled option images

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Im stumbling upon a problem where i need to retrieve data from the following
Problem: I need to retrieve the language of a given cell from the cube.
Problem: I need to write/read objects from a file.This because I need to write/read
I have problem i need to convert from my Array structure to std::vector<int> ...
I need to retrieve & copy attached files from a number of mail items.
I need to retrieve the number of hours past midnight from a UIDatePicker control
I need to retrieve data (usernames and email addresses) from two separate databases on
I need to retrieve information from a SQL server and insert into a XML
I need to retrieve a set of Widgets from my data access layer, grouped
Goal: Gain datatype date with year and month Problem: Need to help to convert

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.