我一直在尝试为自定义属性制作升级脚本。但是,升级脚本似乎不起作用。它不会更新站点或mysql数据库。
它所要做的就是将组从“常规”切换到“ Prijzen”。
每次我尝试升级模块时,版本号都不会更改,组也不会更改。似乎找不到我所走的错误转弯。
MySQL数据库core_resources
:
topperquotation_setup | 0.1.0 | 0.1.0
模块config.xml
:
<config>
<modules>
<Topper_Quotation>
<version>1.0.0</version>
</Topper_Quotation>
</modules>
<global>
<resources>
<topperquotation_setup>
<setup>
<module>Topper_Quotation</module>
<class>Mage_Catalog_Model_Resource_Setup</class>
</setup>
<connection>
<use>core_setup</use>
</connection>
</topperquotation_setup>
</resources>
<template>
<email>
<topp...........
原件install-0.1.0.php
:
<?php
/** @var Mage_Catalog_Model_Resource_Setup $installer */
$installer = $this;
$installer->startSetup();
$installer->addAttribute('catalog_product', 'is_quotable', array(
'group' => 'General',
'type' => 'int',
'backend' => '',
'frontend' => '',
'label' => 'Offerteaanvraag',
'input' => 'select',
'class' => '',
'source' => 'eav/entity_attribute_source_boolean',
'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL,
'visible' => true,
'required' => false,
'user_defined' => false,
'default' => '0',
'searchable' => false,
'filterable' => false,
'comparable' => false,
'visible_on_front' => false,
'unique' => false,
'apply_to' => 'simple,virtual,bundle',
'is_configurable' => false,
));
$installer->endSetup();
当前upgrade-0.1.0-1.0.0.php
:
<?php
/** @var Mage_Catalog_Model_Resource_Setup $installer */
$installer = $this;
$installer->startSetup();
$installer->updateAttribute('catalog_product', 'is_quotable', 'group', 'Prijzen');
$installer->endSetup();
创建评论作为答案,因此可以将其关闭
确保已关闭并清除缓存var/cache
。Magento.xml
在缓存中保留所有配置文件的副本(实际上是所有配置文件合并在一起)-因此需要先清除此文件,然后再识别版本号已更改。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句