Last active
August 29, 2015 14:01
-
-
Save mschultheiss83/9a35b077da256d0d8606 to your computer and use it in GitHub Desktop.
Magento - loadMedialGallery by Product Id and Store Id
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$backend = Mage::getResourceModel('catalog/product_attribute_backend_media'); | |
$attributeId = Mage::getResourceModel('eav/entity_attribute')->getIdByCode('catalog_product', 'media_gallery'); | |
$container = new Varien_Object(array( | |
'attribute' => new Varien_Object(array('id' => $attributeId)) | |
)); | |
$product = new Varien_Object(array( | |
'id' => 519, | |
'store_id' => Mage::app()->getStore()->getId(), | |
)); | |
$gallery = $backend->loadGallery($product, $container); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment