Magento-删除产品类型选项
在Magento产品类型中,我只需要简单产品和组产品。添加新产品时,如何将其隐藏或从“产品类型”选项中删除Magento-删除产品类型选项,magento,types,product,Magento,Types,Product,在Magento产品类型中,我只需要简单产品和组产品。添加新产品时,如何将其隐藏或从“产品类型”选项中删除 非常感谢有两种方法可以解决这个问题。 方式1: 登录到您的管理员帐户。 搜索那边的“模块”选项。 卸载不需要的模块如果您在此处找不到,请搜索“模板”选项。在这种情况下,请转到“编辑模板”,并根据自己的选择进行编辑 方法2:转到您的cpanel帐户。 转到“主题/模板”文件夹。 根据您自己的选择编辑模板。不要从magento中删除任何内容,因为您的更新有问题。 最好的解决方案是只使用您需要的
非常感谢有两种方法可以解决这个问题。
方式1: 登录到您的管理员帐户。
搜索那边的“模块”选项。
卸载不需要的模块
如果您在此处找不到,请搜索“模板”选项。在这种情况下,请转到“编辑模板”,并根据自己的选择进行编辑 方法2:转到您的cpanel帐户。 转到“主题/模板”文件夹。
根据您自己的选择编辑模板。不要从magento中删除任何内容,因为您的更新有问题。
最好的解决方案是只使用您需要的选项。您需要覆盖
Mage\u Catalog\u Model\u Product\u Type
Model class
在这个调用中有一个函数静态公共函数getOptionArray()
。只需更新这个函数
遵循以下说明:
在app\etc\modules\Namespace\u producttype.xml下创建新文件
<Namespace_Producttype>
<active>true</active>
<codePool>local</codePool>
</Namespace_Producttype>
真的
地方的
在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>
1.6.1.1
名称空间\产品类型\模型\产品类型
覆盖模型函数的最后一个文件。
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;
}
}
?>
希望这会有帮助 您应该能够在没有任何“硬”更改的情况下停用一些 只有 简单的, 可配置, 分组, 虚拟产品是核心magento目录模块的一部分,其余是 自己的模块,可通过进入 app/etc/modules/Mage_Bundle.xml app/etc/modules/Mage_Downloadable.xml 并将“活动”从true设置为false。 不要忘记在这些更改后清理缓存
<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>
如果您使用的是企业版,则存在
礼品卡产品类型也是如此
对于其他产品类型:
由于不可能删除配置节点或以您需要的方式覆盖它们,因此最简单的方法可能是转到/app/code/core/Mage/Catalog/etc/config.xml并对其他产品类型进行注释,例如,magento的升级可能会恢复这些更改
<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>
简单产品
目录/产品类型\u简单
0
10
组产品
目录/产品类型分组
目录/产品类型分组价格
1.
50
目录/产品\u索引器\u价格\u分组
是!我认为你是对的。我不会改变核心。谢谢,帮个忙,不要覆盖任何核心文件。当你最终要更新magento时,你会后悔的。