0
votes

I need some solution.

I'm using Magento, I have only 6 product in my shop, on every product page I have added a static block, problem is that this block is the same on every product page. I would like something like this. F.ex. On product called "Doll" static block displays an img of a doll, on product "Gun", we will see the gun image. How to do it? I thought about something like this: (I don't know php so I will write my mind image)

If in div TITLE is a word DOLL then img src="/doll.jpg"

if in div TITLE is word GUN then img src="/gun.jpg"

How to write it in php from A do Z?

Thank you.

1
Why not have a different block for each product? Since you have only 6 products this should be easy. - Marius

1 Answers

1
votes

no need to create block for each product.just add below code in your product page

$name = strtolower(Mage::getModel('catalog/product')->load($_product->getProductId())->getName());

img src="<?php echo $name.'jpg'?>"

may this code help.