如何在php magento上获取数组值以显示magento wishlist图像

如何在php magento上获取数组值以显示magento wishlist图像,php,arrays,magento,Php,Arrays,Magento,您好,我正在定制magento wishlist,我想在我的wishlist上的每个产品上显示图像。 当前产品显示默认图像(无图像)。 在wishlist目录下的my view.phtml中,这是我的代码 foreach($this->getWishlist() as $item){ // ... some code <img src="<?php echo $this->helper('catalog/image')->init($item,

您好,我正在定制magento wishlist,我想在我的wishlist上的每个产品上显示图像。 当前产品显示默认图像(无图像)。 在wishlist目录下的my view.phtml中,这是我的代码

foreach($this->getWishlist() as $item){
     // ... some code

     <img src="<?php echo $this->helper('catalog/image')->init($item, 'small_image')->resize(113, 113)*/?>" alt="<?php echo $item->getName();?>" width="113"/>
     // the image that always shows the no image, it does not display the product image..
     // I think there is something wrong with  $this->helper('catalog/image')->init($item, 'small_image')->resize(113, 113)

     // i try to print thr $item
     print_r($item);

}
foreach($this->getWishlist()作为$item){
//…一些代码
帮助器('catalog/image')->init('item,'small_image')->调整大小(113113)*/?>“alt=”“width=“113”/>
//始终显示无图像的图像不显示产品图像。。
//我认为$this->helper('catalog/image')->init($item,'small_image')->resize(113113)有问题
//我尝试打印thr$项目
打印(项目);
}
这就是结果

Mage_Wishlist_Model_Item Object
(
    [_customOptionDownloadUrl:protected] => wishlist/index/downloadCustomOption
    [_eventPrefix:protected] => wishlist_item
    [_eventObject:protected] => item
    [_options:protected] => Array
        (
            [0] => Mage_Wishlist_Model_Item_Option Object
                (
                    [_item:protected] => Mage_Wishlist_Model_Item Object
 *RECURSION*
                    [_product:protected] => 
                    [_eventPrefix:protected] => core_abstract
                    [_eventObject:protected] => object
                    [_resourceName:protected] => wishlist/item_option
                    [_resource:protected] => 
                    [_resourceCollectionName:protected] => wishlist/item_option_collection
                    [_cacheTag:protected] => 
                    [_dataSaveAllowed:protected] => 1
                    [_isObjectNew:protected] => 
                    [_data:protected] => Array
                        (
                            [option_id] => 26
                            [wishlist_item_id] => 26
                            [product_id] => 6767
                            [code] => info_buyRequest
                            [value] => a:1:{s:7:"product";s:4:"6767";}
                        )

                    [_hasDataChanges:protected] => 1
                    [_origData:protected] => Array
                        (
                            [option_id] => 26
                            [wishlist_item_id] => 26
                            [product_id] => 6767
                            [code] => info_buyRequest
                            [value] => a:1:{s:7:"product";s:4:"6767";}
                        )

                    [_idFieldName:protected] => option_id
                    [_isDeleted:protected] => 
                    [_oldFieldsMap:protected] => Array
                        (
                        )

                    [_syncFieldsMap:protected] => Array
                        (
                        )

                )

        )

    [_optionsByCode:protected] => Array
        (
            [info_buyRequest] => Mage_Wishlist_Model_Item_Option Object
                (
                    [_item:protected] => Mage_Wishlist_Model_Item Object
 *RECURSION*
                    [_product:protected] => 
                    [_eventPrefix:protected] => core_abstract
                    [_eventObject:protected] => object
                    [_resourceName:protected] => wishlist/item_option
                    [_resource:protected] => 
                    [_resourceCollectionName:protected] => wishlist/item_option_collection
                    [_cacheTag:protected] => 
                    [_dataSaveAllowed:protected] => 1
                    [_isObjectNew:protected] => 
                    [_data:protected] => Array
                        (
                            [option_id] => 26
                            [wishlist_item_id] => 26
                            [product_id] => 6767
                            [code] => info_buyRequest
                            [value] => a:1:{s:7:"product";s:4:"6767";}
                        )

                    [_hasDataChanges:protected] => 1
                    [_origData:protected] => Array
                        (
                            [option_id] => 26
                            [wishlist_item_id] => 26
                            [product_id] => 6767
                            [code] => info_buyRequest
                            [value] => a:1:{s:7:"product";s:4:"6767";}
                        )

                    [_idFieldName:protected] => option_id
                    [_isDeleted:protected] => 
                    [_oldFieldsMap:protected] => Array
                        (
                        )

                    [_syncFieldsMap:protected] => Array
                        (
                        )

                )

        )

    [_notRepresentOptions:protected] => Array
        (
            [0] => info_buyRequest
        )

    [_flagOptionsSaved:protected] => 
    [_resourceName:protected] => wishlist/item
    [_resource:protected] => 
    [_resourceCollectionName:protected] => wishlist/item_collection
    [_cacheTag:protected] => 
    [_dataSaveAllowed:protected] => 1
    [_isObjectNew:protected] => 
    [_data:protected] => Array
        (
            [wishlist_item_id] => 26
            [wishlist_id] => 5
            [product_id] => 6767
            [store_id] => 1
            [added_at] => 2013-06-11 03:14:04
            [description] => 
            [qty] => 1.0000
            [product] => Mage_Catalog_Model_Product Object
                (
                    [_cacheTag:protected] => catalog_product
                    [_eventPrefix:protected] => catalog_product
                    [_eventObject:protected] => product
                    [_canAffectOptions:protected] => 
                    [_typeInstance:protected] => 
                    [_typeInstanceSingleton:protected] => 
                    [_linkInstance:protected] => 
                    [_customOptions:protected] => Array
                        (
                        )

                    [_urlModel:protected] => 
                    [_errors:protected] => Array
                        (
                        )

                    [_optionInstance:protected] => 
                    [_options:protected] => Array
                        (
                        )

                    [_reservedAttributes:protected] => 
                    [_isDuplicable:protected] => 1
                    [_calculatePrice:protected] => 1
                    [_defaultValues:protected] => Array
                        (
                        )

                    [_storeValuesFlags:protected] => Array
                        (
                        )

                    [_lockedAttributes:protected] => Array
                        (
                        )

                    [_isDeleteable:protected] => 1
                    [_isReadonly:protected] => 
                    [_resourceName:protected] => catalog/product
                    [_resource:protected] => 
                    [_resourceCollectionName:protected] => catalog/product_collection
                    [_dataSaveAllowed:protected] => 1
                    [_isObjectNew:protected] => 
                    [_data:protected] => Array
                        (
                            [entity_id] => 6767
                            [entity_type_id] => 4
                            [attribute_set_id] => 4
                            [type_id] => simple
                            [sku] => sku6768
                            [has_options] => 0
                            [required_options] => 0
                            [created_at] => 2011-07-25 19:46:25
                            [updated_at] => 2013-06-03 21:08:50
                            [cat_index_position] => 80000
                            [price] => 0.0000
                            [tax_class_id] => 2
                            [final_price] => 0.0000
                            [minimal_price] => 0.0000
                            [min_price] => 0.0000
                            [max_price] => 0.0000
                            [tier_price] => 
                            [image_label] => Amplifier +15V Input
                            [manufacturer2] => 130
                            [name] => Amplifier +15V Input
                            [small_image] => /d/s/dsc00394.jpg
                            [small_image_label] => Amplifier +15V Input
                            [thumbnail] => /d/s/dsc00394.jpg
                            [thumbnail_label] => Amplifier +15V Input
                            [url_key] => amplifier-15v-input
                            [url_path] => amplifier-15v-input.html
                            [short_description] => <p>&#160;</p>
                            [status] => 1
                            [visibility] => 4
                            [is_salable] => 1
                            [stock_item] => Varien_Object Object
                                (
                                    [_data:protected] => Array
                                        (
                                            [is_in_stock] => 1
                                        )

                                    [_hasDataChanges:protected] => 
                                    [_origData:protected] => 
                                    [_idFieldName:protected] => 
                                    [_isDeleted:protected] => 
                                    [_oldFieldsMap:protected] => Array
                                        (
                                        )

                                    [_syncFieldsMap:protected] => Array
                                        (
                                        )

                                )

                            [request_path] => amplifier-15v-input.html
                        )

                    [_hasDataChanges:protected] => 1
                    [_origData:protected] => 
                    [_idFieldName:protected] => entity_id
                    [_isDeleted:protected] => 
                    [_oldFieldsMap:protected] => Array
                        (
                        )

                    [_syncFieldsMap:protected] => Array
                        (
                        )

                )

            [product_name] => Amplifier +15V Input
            [name] => Amplifier +15V Input
            [price] => 0.0000
        )

    [_hasDataChanges:protected] => 
    [_origData:protected] => Array
        (
            [wishlist_item_id] => 26
            [wishlist_id] => 5
            [product_id] => 6767
            [store_id] => 1
            [added_at] => 2013-06-11 03:14:04
            [description] => 
            [qty] => 1.0000
        )

    [_idFieldName:protected] => wishlist_item_id
    [_isDeleted:protected] => 
    [_oldFieldsMap:protected] => Array
        (
        )

    [_syncFieldsMap:protected] => Array
        (
        )

)
Mage\u Wishlist\u Model\u项目对象
(
[\u customOptionDownloadUrl:protected]=>wishlist/index/downloadCustomOption
[\u eventPrefix:protected]=>wishlist\u项目
[\u eventObject:protected]=>项
[\u选项:受保护]=>阵列
(
[0]=>Mage\u Wishlist\u Model\u Item\u选项对象
(
[\u项目:受保护]=>Mage\u Wishlist\u Model\u项目对象
*递归*
[\u产品:受保护]=>
[\u eventPrefix:protected]=>core\u abstract
[\u eventObject:protected]=>对象
[\u resourceName:protected]=>愿望列表/项目选项
[\u资源:受保护]=>
[\u resourceCollectionName:protected]=>wishlist/item\u选项\u集合
[\u cacheTag:protected]=>
[\u dataSaveAllowed:protected]=>1
[\u isObjectNew:受保护]=>
[\u数据:受保护]=>阵列
(
[选项id]=>26
[愿望列表项目id]=>26
[产品id]=>6767
[代码]=>信息购买请求
[value]=>a:1:{s:7:“产品”;s:4:“6767”}
)
[\u hasDataChanges:protected]=>1
[\u origData:protected]=>阵列
(
[选项id]=>26
[愿望列表项目id]=>26
[产品id]=>6767
[代码]=>信息购买请求
[value]=>a:1:{s:7:“产品”;s:4:“6767”}
)
[\u idFieldName:protected]=>选项\u id
[\u已删除:受保护]=>
[\u oldFieldsMap:protected]=>阵列
(
)
[\u syncFieldsMap:protected]=>阵列
(
)
)
)
[\u选项按代码:受保护]=>阵列
(
[info\u buyRequest]=>Mage\u Wishlist\u Model\u Item\u选项对象
(
[\u项目:受保护]=>Mage\u Wishlist\u Model\u项目对象
*递归*
[\u产品:受保护]=>
[\u eventPrefix:protected]=>core\u abstract
[\u eventObject:protected]=>对象
[\u resourceName:protected]=>愿望列表/项目选项
[\u资源:受保护]=>
[\u resourceCollectionName:protected]=>wishlist/item\u选项\u集合
[\u cacheTag:protected]=>
[\u dataSaveAllowed:protected]=>1
[\u isObjectNew:受保护]=>
[\u数据:受保护]=>阵列
(
[选项id]=>26
[愿望列表项目id]=>26
[产品id]=>6767
[代码]=>信息购买请求
[value]=>a:1:{s:7:“产品”;s:4:“6767”}
)
[\u hasDataChanges:protected]=>1
[\u origData:protected]=>阵列
(
[选项id]=>26
[愿望列表项目id]=>26
[产品id]=>6767
[代码]=>信息购买请求
[value]=>a:1:{s:7:“产品”;s:4:“6767”}
)
[\u idFieldName:protected]=>选项\u id
[\u已删除:受保护]=>
[\u oldFieldsMap:protected]=>阵列
(
)
[\u syncFieldsMap:protected]=>阵列
(
)
)
)
[\u notRepresentOptions:受保护]=>阵列
(
[0]=>信息购买请求
)
[\u FlagOptions保存:受保护]=>
[\u resourceName:protected]=>愿望列表/项目
[\u资源:受保护]=>
[\u resourceCollectionName:protected]=>wishlist/item\u集合
[\u cacheTag:protected]=>
[\u dataSaveAllowed:protected]=>1
[\u isObjectNew:受保护]=>
[\u数据:受保护]=>阵列
(
[愿望列表项目id]=>26
[wishlist_id]=>5
[产品id]=>6767
[商店id]=>1
[新增地址]=>2013-06-1103:14:04
[说明]=>
[数量]=>1.0000
[产品]=>图像\目录\模型\产品对象
(
[\u cacheTag:protected]=>目录\u产品
[\u eventPrefix:protected]=>目录\u产品
[\u eventObject:protected]=>产品
[\u canAffectOptions:受保护]=>
[\u typeInstance:protected]=>
[\u typeInstanceSingleton:protected]=>
[\u linkInstance:受保护]=>
[\u customOptions:protected]=>阵列
(
)
[\u urlMode
foreach ($item->_data as $item_img){
        echo $item_img->_data[small_image];
    }