In Magento Product type, I only need Simple product and Group Product. How can I hide it or remove it from Product type option when I add new product?
Thank you so much
You need to override Mage_Catalog_Model_Product_Type
Model class.
In this call there is function static public function getOptionArray()
. Just update this function.
Follow below instruction:
Create new file under app\etc\modules\Namespace_producttype.xml
<Namespace_Producttype>
<active>true</active>
<codePool>local</codePool>
</Namespace_Producttype>
Create new file under app\code\local\Namespace\Producttype\etc\config.xml
<?xml version="1.0"?>
<config>
<modules>
<Namespace_Producttype>
<version>1.6.1.1</version>
</Namespace_Producttype>
</modules>
<global>
<models>
<catalog>
<rewrite>
<product_type>Namespace_Producttype_Model_Product_Type</product_type>
</rewrite>
</catalog>
</models>
</global>
</config>
Last file to override Model function. app\code\local\Namespace\Producttype\Model\Product\Type.php
<<?php
class Namespace_Producttype_Model_Product_Type extends Mage_Catalog_Model_Product_Type
{
static public function getOptionArray()
{
$options = array();
foreach(self::getTypes() as $typeId=>$type) {
if($typeId == 'simple' || $typeId == 'grouped'):
$options[$typeId] = Mage::helper('catalog')->__($type['label']);
endif;
}
return $options;
}
}
?>
Hope this will help!
There are two ways to solve this problem.
Way 1:
Login to your admin account.
Search for option 'Module' over there.
Uninstall the module that you don't want.
If you dont find over here, search for 'template' option. In that go to 'edit Template' and edit it as per your own choice.
Way 2: Go to your cpanel account.
Go to 'themes/template' folder.
Edit the template as per your own choice.
You should he able to deactivate a few without any "hard" change.
Only simples, configurables, grouped, virtual products are part of the core magento catalog module, the rest are own modules that can be deactivated completely by going into app/etc/modules/Mage_Bundle.xml app/etc/modules/Mage_Downloadable.xml
and setting "active" from true to false. dont forget cleaning the cache after these changes
if you are using the enterprise version there is a giftcard product type too
for the other product types: since it is not possible to remove config nodes or overwrite them in the way you need it, the maybe easiest way is to go to /app/code/core/Mage/Catalog/etc/config.xml and comment the other product types like this, how ever an upgrade of magento will maybe revert these changes
<catalog>
<product>
<type>
<simple translate="label" module="catalog">
<label>Simple Product</label>
<model>catalog/product_type_simple</model>
<composite>0</composite>
<index_priority>10</index_priority>
</simple>
<grouped translate="label" module="catalog">
<label>Grouped Product</label>
<model>catalog/product_type_grouped</model>
<price_model>catalog/product_type_grouped_price</price_model>
<composite>1</composite>
<allow_product_types>
<simple/>
<virtual/>
</allow_product_types>
<index_priority>50</index_priority>
<price_indexer>catalog/product_indexer_price_grouped</price_indexer>
</grouped>
<!--
<configurable translate="label" module="catalog">
<label>Configurable Product</label>
<model>catalog/product_type_configurable</model>
<price_model>catalog/product_type_configurable_price</price_model>
<composite>1</composite>
<allow_product_types>
<simple/>
<virtual/>
</allow_product_types>
<index_priority>30</index_priority>
<price_indexer>catalog/product_indexer_price_configurable</price_indexer>
</configurable>
<virtual translate="label" module="catalog">
<label>Virtual Product</label>
<model>catalog/product_type_virtual</model>
<composite>0</composite>
<index_priority>20</index_priority>
</virtual>
-->
</type>