Username or Email
Password:
Forgot Password
a small question:
i created a custom picture atribute to display the logo of the manufacturer, i can even display it in the frontend. trouble is: if it is empty, the rendering of the page will stop. that is the code for the display:
<img id="image-3" src="<?php echo $this->helper('catalog/image')->init($_product, 'manufacturer_pic')->resize(50); ?>" alt="<?php echo $this->htmlEscape($_product->getName()) ?>" />
how do i get an default picture instead of an error? help appreciated
WE have no future because our Present is too volatile.We have only riskmanagement. The spinning of the given moment´s scenario. *Pattern Recognition.W.Gibson*
Hi,
you could do smth like this:
<?php if($_product->getManufacturerPic()) : ?><img id="image-3" src="<?php echo $this->helper('catalog/image')->init($_product, 'manufacturer_pic')->resize(50); ?>" alt="<?php echo $this->htmlEscape($_product->getName()) ?>" /> <?php else: ?><img id="image-3" src="<?php echo $this->helper('catalog/image')->init($_product, 'image')->resize(50); ?>" alt="<?php echo $this->htmlEscape($_product->getName()) ?>" /> <?php> endif; ?>
Cheers
Stefan
mzentrale | eCommerce - eBusiness Agentur für eCommerce Beratung, Entwicklung & Marketing. Magento™ Silver Partner ----