Skip to content

Instantly share code, notes, and snippets.

@apedicdev
Last active August 29, 2015 14:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save apedicdev/49c68cf198cb9a8b290c to your computer and use it in GitHub Desktop.
Save apedicdev/49c68cf198cb9a8b290c to your computer and use it in GitHub Desktop.
How to avoid fatal error if an image doesn't exist in Magento
try {
product_img = $this->helper('catalog/image')->init($_product, 'header_slider_img'){
catch (Exception $e) {
Mage::log('Slider '.$e->getMessage(), null, 'slider.log');
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment