开发者

Magento product types

开发者 https://www.devze.com 2023-02-15 18:14 出处:网络
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 :

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号