Magento product types
How do know开发者_StackOverflow which product type to use in Magento? Especially, when should I use simple and configurable products?
Get product collection by type :
$collectionSimple = Mage::getResourceModel('catalog/product_collection')
->addAttributeToFilter('type_id', array('eq' => 'simple'));
$collectionConfigurable = Mage::getResourceModel('catalog/product_collection')
->addAttributeToFilter('type_id', array('eq' => 'configurable'));
$collectionBundle = Mage::getResourceModel('catalog/product_collection')
->addAttributeToFilter('type_id', array('eq' => 'bundle'));
$collectionGrouped = Mage::getResourceModel('catalog/product_collection')
->addAttributeToFilter('type_id', array('eq' => 'grouped'));
$collectionVirtual = Mage::getResourceModel('catalog/product_collection')
->addAttributeToFilter('type_id', array('eq' => 'virtual'));
This wiki page describes the different product types.
If you have options to select before adding the product to cart, then use configurable product. For example, Shoes. In shoes, you have the option to select size.
If you don't have any option to set before adding product to cart, then use simple product.
精彩评论