Guest User

Image helper test script

a guest
Dec 6th, 2015
178
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.34 KB | None | 0 0
  1. <?php
  2.  
  3. include 'app/Mage.php'; // adjust as required
  4.  
  5. Mage::app()->setCurrentStore(1); // use whatever one of your store ID/codes is
  6.  
  7. $product = Mage::getModel('catalog/product')->loadByAttribute('sku', 'YOURSKU'); // put your product sku in
  8.  
  9. var_dump((string) Mage::helper('catalog/image')->init($product, 'thumbnail')->resize(50, 50));
Advertisement
Add Comment
Please, Sign In to add comment