I'm having trouble in getting magento to echo the url of a custom attribute that I have created for magento's custom attribute set.
$_product = Mage::getModel('catalog/product');
$_product->load($_selection->getProductId());
echo $_product->getCustomimage();
in admin, the attribute code is custom开发者_如何学运维image which load Image Media.
What's the type of that attribute? If it's only text and its name is «customimage» and not «custom_image», the way you're calling it seems to be OK. Is that the code you're using?
Maybe you should load the product in a variable and then call that method in order to get the url of that image. Try loading a specific product to see if it works...
$product = Mage::getModel('catalog/product')->load($productId);
echo $product->getCustomimage();
You can take a look at this.
精彩评论