diff --git a/src/app/code/community/Flagbit/FactFinder/Model/Export/Product.php b/src/app/code/community/Flagbit/FactFinder/Model/Export/Product.php index 6e2f38e4..4140026d 100644 --- a/src/app/code/community/Flagbit/FactFinder/Model/Export/Product.php +++ b/src/app/code/community/Flagbit/FactFinder/Model/Export/Product.php @@ -232,13 +232,28 @@ public function doExport($storeId = null) ); if ($exportImageAndDeeplink) { - $product = Mage::getModel("catalog/product"); - $product->setStoreId($storeId); - $product->load($productData['entity_id']); - - $productIndex[] = (string) $this->_imageHelper->init($product, $imageType)->resize($imageSize); - $productIndex[] = $product->getProductUrl(); - $product->clearInstance(); + list($width, $height) = explode('x', strtolower($imageSize)); + $imageBaseFile = Mage::getResourceSingleton('catalog/product')->getAttributeRawValue($productData['entity_id'], $imageType, $storeId); + $imageModel = Mage::getModel('catalog/product_image') + ->setWidth($width) + ->setHeight($height) + ->setDestinationSubdir($imageType) + ->setBaseFile($imageBaseFile); + if(!$imageModel->isCached()) { + $imageModel->resize(); + } + $productImage = $imageModel->getUrl(); + + $productUrl = Mage::getModel('catalog/product') + ->getCollection() + ->addAttributeToFilter('entity_id', $productData['entity_id']) + ->setStoreId($storeId) + ->addUrlRewrite() + ->getFirstItem() + ->getProductUrl(); + + $productIndex[] = $productImage; + $productIndex[] = $productUrl; } $this->_getAttributesRowArray($productIndex, $productAttr, $storeId);