我们在(1.12.0.2)中创建了一个定制的customer属性来存储用户帐户id,从而使我们的RMS与Magento保持同步。
我需要手动设置RMS id (通过PHP),然后再获得RMS id。自定义属性是一个文本字段,它的标签是rms_id。我需要做以下几点:
看起来很直截了当,但是我对Magento开发并不熟悉,无法找到解决这个问题的方法。所有搜索返回自定义产品属性的结果,这不是asme作为自定义客户属性。任何帮助都将不胜感激。
发布于 2012-12-18 00:16:58
/* @var $customer Mage_Customer_Model_Customer */
$customer = Mage::getModel('customer/customer')->load({customer id});
if (!$customer->getRmsId()) {
$customer->setRmsId({value});
//the original version of this answer was wrong; need to use the resource model.
$customer->getResource()->saveAttribute($customer,'rms_id');
} https://stackoverflow.com/questions/13923999
复制相似问题