2014-03-26 57 views

回答

3

catalog_product_entity_media_gallery表中,您獲得有關商品圖像信息

請檢查圖像

Image

簡單的MySQL查詢從DATABSE獲取圖像

$connection = Mage::getSingleton('core/resource')->getConnection('core_read'); 
    $sql= "Select value from catalog_product_entity_media_gallery WHERE entity_id=1"; 
    $rows  = $connection->fetchAll($sql); 

entity_idpropductId

讓我知道如果您有任何疑問

+0

謝謝配合! –

+0

但是在這張表中我遇到了一些麻煩,找不到具有空'值'的行,所以我需要檢查所有產品並獲取沒有圖像的產品。謝謝! –

+1

產品無圖像dosent存儲在這張表中意味着當您調用$ product-> getImageUrl()時您獲得no_selection –

0

還與Magento的

<!-- 
<?php 
$products123321 = Mage::getModel('catalog/product') 
->getCollection() 
->addAttributeToSelect('*') 
->addAttributeToFilter('image', 'no_selection'); 

foreach($products123321 as $product123321) 
{ 
    echo $product123321->getSku() . " has no image \n<br />\n"; 
    //var_dump($product->getData()); //uncomment to see all product attributes 
            //remove ->addAttributeToFilter('image', 'no_selection'); 
            //from above to see all images and get an idea of 
            //the things you may query for 
}  
?> 
--> 
相關問題