如何获取具有特定名称的magento产品的所有图库图像? [英] How do I get all the gallery images for a product in magento with a particular name?
本文介绍了如何获取具有特定名称的magento产品的所有图库图像?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想从产品的图库图片中获得标记为特殊的图片.使用该图片,我想要获取该图片的网址.
I want to get the image labeled as special from the Gallery images of a product.Using this I want to get that image url.
我尝试了相同的以下代码,但对我不起作用
I tried following code for the same but not working for me
<?php echo Mage::getModel('catalog/product')->load($_product->getId())->getMediaGalleryImages()->getItemByColumnValue('label','look')->getFile(); ?>
这对我来说方法getFile()抛出错误
this was throwing error for me for method getFile()
推荐答案
您可以通过这种方式获得带有特定标签的产品图片
You can get product image with specific label from this way
$image= Mage::getModel('catalog/product')->load($productid)->getMediaGalleryImages();
$_images = $image->getItemByColumnValue('label', 'YOUR_LABEL');
http://magentotutorialbeginners.blogspot. in/2014/03/get-product-image-from-label-magento.html
让我知道您是否有任何疑问
Let me know if you have any query
这篇关于如何获取具有特定名称的magento产品的所有图库图像?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文