我想在下订单的时候给制造商发电子邮件。为此,我想在制造商产品属性中添加制造商的电子邮件地址?如何做到这一点?
发布于 2014-09-30 01:15:51
我假设你是在问如何在代码中做到这一点?无论如何,只需构建一个带有安装脚本的小模块(web上的所有教程),并使安装脚本看起来像这样:
$installer = $this;
$installer->startSetup();
// check if the attribute exists
if (Mage::getModel('catalog/resource_eav_attribute')->loadByCode('catalog_product','calculated_sold')->getId() !== NULL) {
$installer->removeAttribute('catalog_product', 'calculated_sold');
}
// not anymore, that's for sure!
// Note! For product attributes the XML set class needs to be "Mage_Catalog_Model_Resource_Setup"
// instead of "Mage_Customer_Model_Entity_Setup" as you would usually go with.
$installer->addAttribute('catalog_product','calculated_sold', array (
'type' => 'decimal',
'label' => 'Calculated sold',
'input' => 'price', // for filtering to work only certain input types allowed
'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_STORE,
'searchable' => true,
'filterable' => true,
'visible' => false,
'required' => false,
'visible_in_advanced_search' => true,
'used_in_product_listing' => true,
'used_for_sort_by' => true,
'apply_to' => 'configurable', // yeah!
));
$installer->endSetup();
这个示例添加了一个属性来跟踪售出的商品数量,但它将让您了解如何根据自己的需要进行更改。
https://stackoverflow.com/questions/26094090
复制相似问题