我已经以编程方式添加了price属性,它到目前为止工作但是无法保存带小数的价格.
例如,如果我在保存产品后在后端输入99.99,则filialpreis为99.00如果我手动添加属性,一切都像预期的那样工作.
有没有人知道我必须做什么才能使它与编程添加的价格属性一起工作?
<?php
/** @var $installer My_DBSetup_Model_Resource_Setup */
$installer = $this;
$installer->startSetup();
//NJ add product attributes
$attributeId = $installer->getAttributeId('catalog_product','my_filialpreis');
if($attributeId){
$installer->removeAttribute('catalog_product',$attributeId);
}
$installer->addAttribute('catalog_product', 'my_filialpreis', array(
'input' => 'price',
'type' => 'int',
'user_defined' => true,
'label' => 'Filialpreis',
'scope' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL,
'visible' => false,
'is_required' => '0',
'is_comparable' => '0',
'is_searchable' => '0',
'is_unique' => '0',
'is_configurable' => '0',
'unique' => false,
'used_in_product_listing' => false,
'required' => false,
'searchable' => false,
'comparable' => false,
'visible_on_front' => false,
)
);
$installer->updateAttribute('catalog_product', …Run Code Online (Sandbox Code Playgroud) 我使用此代码在每一侧都有一个js弹出窗口,告诉访问者该商店效率不高:
<?php
$ip = $_SERVER['REMOTE_ADDR'];
if ($ip == 'xxx.xxx.xxx.xxx' OR $ip == 'xxx.xxx.xxx.xx') { ?>
You are a developer
<?php } else { ?>
You are a visitor
<?php } ?>
Run Code Online (Sandbox Code Playgroud)
我的问题是,如何在此代码中使用来自magento后端的开发人员Ip - >系统 - >配置 - >开发人员 - >开发人员客户端限制