Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get full product image url in Magento

Tags:

magento

How to get full product image url in magento ,i need to migrate the data from magento to django so i need to get the product full image url to migrate the site

here is my code

<?php
@ob_start();
@session_start();
ini_set('display_errors', 1);
//for order update
include '../../../../app/Mage.php';
Mage::app('default');
echo '<pre>';
if(isset($_REQUEST['productid'])){
$productId = $_REQUEST['productid'];
}else{
echo 'Default Product => ';
$productId = '12402'; // product ID 10 is an actual product, and used here for a test
}
$product = Mage::getModel('catalog/product')->load($productId);  //load the product     

print_r($product->getthumbnail());<br/>
print_r($product->getcreated_at());
?>
like image 339
Rohit Goel Avatar asked Jan 04 '13 10:01

Rohit Goel


People also ask

How do I find the product image URL in Woocommerce?

“get product image woocommerce” Code Answer's php $image = wp_get_attachment_image_src( get_post_thumbnail_id( $product_id ), 'single-post-thumbnail' );?>


1 Answers

Try this

$product = Mage::getModel('catalog/product')->load($product_id);
$full_path_url = Mage::helper('catalog/image')->init($product, 'thumbnail');
like image 199
Deepak Mallah Avatar answered Nov 09 '22 08:11

Deepak Mallah