Take the 2-minute tour ×
Magento Stack Exchange is a question and answer site for users of the Magento e-Commerce platform. It's 100% free, no registration required.

I need help with getting some values out of my code.So I have my configurable product and it is based on a global attribute "size", it has its own associated products which are the same product in different sizes. I need to somehow call a model or something that will give me the associated products and their label for the attribute "size" for example "xxl".
What I did so far was to get all child products. But the this size value is an Int, and there is no size label variable.

Another thing I'd like to add if it helps: the size variable from child products and the value_index from "size" options are the same.

UPDATE

This is the code and need to insert the label in it and to get it displayed in a foreach as a li element

$product1= Mage::getModel('catalog/product')->load($_product->product_id); 
$childProducts = Mage::getModel('catalog/product_type_configurable')
                         ->getUsedProducts(null,$product); 

foreach($childProducts as $child) {

    print_r($child->getId()); 
    print_r($child->getsize()); 

}
share|improve this question
    
I'm pretty sure I gave you the answer just below. –  Julien Lachal Jul 17 at 13:54

1 Answer 1

up vote 3 down vote accepted
    Mage::getModel('catalog/product')->getResource()->getAttribute("size")->getSource()->getOptionText("your_id");
share|improve this answer
    
Ah, thank you it did the job! –  user12285 Jul 17 at 14:04
    
glat it helped. –  Julien Lachal Jul 17 at 14:32

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.