如何创建一个简单的模块显示Magento中的所有产品

时间:2015-06-19 03:52:18

标签: magento

我正在学习Magento,但我找不到关于创建新模块的教程或文档显示所有产品。 有人帮帮我吗?

1 个答案:

答案 0 :(得分:0)

模块创建教程:http://www.magentocommerce.com/wiki/5_-_modules_and_development/0_-_module_development_in_magento/custom_module_with_custom_database_table

要显示所有产品,请在PHTML文件中写下以下代码:

echo "<pre>";
$productCollection = Mage::getModel('catalog/product')->getCollection();
foreach($productCollection as $product) {
   print_r($product->getData()); //You can display it in tabular structure       
}
echo "</pre>";

希望这会有所帮助!!

相关问题