【问题标题】:delete custom customer attribute in magento删除magento中的自定义客户属性
【发布时间】:2013-08-09 07:21:33
【问题描述】:

我在 Magento 中为客户创建了一个自定义属性。

我不小心为我的属性设置了错误的类型。

现在我想修改此属性或删除此属性,然后创建新属性。

谁能告诉我是否可以删除或修改磁电机中的自定义属性?

提前致谢。

【问题讨论】:

    标签: magento magento-1.7


    【解决方案1】:

    您可以使用以下内容在其中一个模块中创建升级脚本:

    $this->updateAttribute('customer', 'attribute_code_here', 'type', 'varchar'); //or any other type
    

    基本上,您可以像这样更改客户、类别和产品的任何属性;

    $entityType = 'customer';//or catalog_category or catalog_product
    $attributeCode = 'attribute_code_here';
    $changeWhat = 'field_name_here';
    $changeInto = 'new value here';
    $this->updateAttribute($entityType, $attributeCode, $changeWhat, $changeInto);
    

    要删除一个属性,运行这个:

    $this->removeAttribute('customer', 'attribute_code_here');
    

    它遵循与上述相同的规则。

    【讨论】:

    • 任何删除属性的想法。实际上我也必须更改一个属性的标签。
    • @Marius 你能回答这个问题吗stackoverflow.com/questions/20634111/…
    • 我们如何从 magento 2 客户注册中删除客户的税/增值税号属性?
    猜你喜欢
    • 2015-06-25
    • 2023-03-06
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2023-04-01
    • 1970-01-01
    相关资源
    最近更新 更多