Skip to content
This repository was archived by the owner on Apr 25, 2025. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ protected function _getValue(Varien_Object $row)
$val = $val2 = $row->getData($this->getColumn()->getIndex());
$val = str_replace('no_selection', '', $val);
$val2 = str_replace('no_selection', '', $val2);
$url = Mage::helper('enhancedgrid')->getImageUrl($val);
$url = Mage::helper('enhancedgrid')->getImageUrl($val, $row);

if (!Mage::helper('enhancedgrid')->getFileExists($val)) {
$dored = true;
Expand Down
18 changes: 15 additions & 3 deletions app/code/community/TBT/Enhancedgrid/Helper/Data.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,23 @@

class TBT_Enhancedgrid_Helper_Data extends Mage_Core_Helper_Abstract
{
public function getImageUrl($image_file)
/**
* Get url of cached thumbnail image
* Will generate cached image if doesn't exist
*
* @param string $image_file
* @param Mage_Catalog_Model_Product $product
* @return bool|string
*/
public function getImageUrl($image_file, $product)
{
$url = false;
$url = Mage::getBaseUrl('media').'catalog/product'.$image_file;

if (!empty($image_file)) {
$helper = Mage::helper('catalog/image')->init($product, 'thumbnail');
$width = Mage::getStoreConfig( 'enhancedgrid/images/width');
$height = Mage::getStoreConfig( 'enhancedgrid/images/height');
$url = $helper->resize($width, $height)->__toString();
}
return $url;
}

Expand Down