0

I have product select attribute for product material. Now I have created select attribute and in admin I can choose product material and it's ok. But in front I want to show material image and description.

So I need that select option value was textarea and i could put into them image and description.

There is any way to have what I want?

3
  • So you mean if the drop down is selected in admin, then only a textarea should come on front? Commented Jun 7, 2014 at 8:47
  • Yes. For example, if admin choosed laminat, in front i should show image and description for laminat.
    – Felix
    Commented Jun 7, 2014 at 8:55
  • If you do not have many options then you can try creating multiple attribute sets? I am not sure but may be that can help Commented Jun 7, 2014 at 9:02

1 Answer 1

2

Maybe the best approach on this is to create your own CRUD module where you manage materials.
Each material should have a title, description and image. (and any other field you need).
Then you can make that entity you create into a product attribute.
This shows you how to create a product attribute with a custom source model.

Then in the product page you can add a section where you can show the details of the material.
Something like this:

<?php $materialId = $_product->getMaterial();
if ($materialId) : 
    $material = Mage::getModel('[module]/material')->load($materialId); ?>
    <div class="material-description"><?php echo $material->getDescription();?></div>
    <div class="material-image"><img src="BASE IMAGE PATH HERE <?php echo $material->getImage()?>" /></div>
<?php endif;?>

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.