我想在Magento中检索默认产品缩略图以将其应用于产品以外的其他内容,因此我无法访问$product。可能吗?
谢谢Krt_Malta
未经测试,但这应该有效:
/**
* Get the resource model
*/
$resource = Mage::getSingleton('core/resource');
/**
* Retrieve the read connection
*/
$readConnection = $resource->getConnection('core_read');
$query = 'SELECT thumbnail FROM ' . $resource->getTableName('catalog/product_flat') . ' WHERE sku = "(insert your product SKU here)"'; // Insert SKU here
/**
* Execute the query and store the results in $results
*/
$results = $readConnection->fetchAll($query);
/**
* Print out the results
*/
echo sprintf('<pre>%s</pre>' print_r($results, true));