开发者

Magento image media custom attribute - Not showing url

开发者 https://www.devze.com 2023-04-11 01:30 出处:网络
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.

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消