1

I'd like some advice on amending the export function in Magento 1.4.0.1.

I've created a profile that exports the products including the Image URL path and category ID.

Is it possible to insert the image folder URL before the image URL oath, and also replace the category ID with the name of the category?

r1853
  • 141
  • 1
  • 1
  • 9

1 Answers1

0

For Image Url, you can use

$image = Mage::getModel('catalog/product_media_config');
$product = Mage::getModel('catalog/product')->load($your_product_id);

$thumbnail_path_url = $image->getMediaUrl($product->getThumbnail());
$smallimage_path_url = $image->getMediaUrl($product->getSmallImage());
$image_path_url = $image->getMediaUrl($product->getImage());

For Category name, you can use

$_cat = Mage::getModel('catalog/category')->setStoreId(Mage::app()->getStore()->getId())->load($your_category_id);
$catname = $_cat->getName();       

Fetch these values separately and bind it to your existing fields.

What I provided was a general way of getting the Url path. If you need to override the core magento Export functionality to add URL to image you can Check this Link

Community
  • 1
  • 1
Arun Krish
  • 2,153
  • 1
  • 10
  • 15
  • Thanks for the quick response! How would I go about binding these as you've suggested? Would that involve editing the core files? – r1853 Sep 29 '15 at 12:37
  • Yes, you need to override the Magento Core file. – Arun Krish Sep 29 '15 at 12:44
  • Can you provide the path and file name to the files in question? – r1853 Sep 29 '15 at 12:58
  • Check the link http://stackoverflow.com/questions/21789380/magento-advanced-profiles-export-prepend-url-to-image-path – Arun Krish Sep 29 '15 at 13:49
  • I did as the article said but nothing's happened. The Actions XML looks exactly the same. I created the new files in, app/code/local/Mage/Dataflow/Model/Convert/Mapper/MyColumn.php and app/code/local/Mage/Dataflow/Model/Convert/Profile/Collection.php I also don't see where the code you've mentioned fits in to either of those files. Can you elaborate? – r1853 Sep 30 '15 at 10:55
  • Hi, just to check - this will work with Magento 1.4, won't it? – r1853 Sep 30 '15 at 11:02
  • I work on magento 1.9. I am not sure about Magento 1.4. – Arun Krish Sep 30 '15 at 11:03
  • That's really not helpful when I mentioned the version twice! – r1853 Sep 30 '15 at 14:09