【发布时间】:2016-06-14 21:07:21
【问题描述】:
我正在尝试在我的 ItemsKeyMapping.js 中创建一个函数,该函数将计算客户在产品上节省的百分比。我是 javascript 新手,一直在使用教程。这就是我所拥有的:
// @property _DiscountPercent calculates the percentage between customers price and MSRP
, _DiscountPercent: function (item)
{
var attributes = item.get('onlinecustomerprice') || ('pricelevel15');
if ((pricelevel15 != 0) && (onlinecustomerprice != 0))
{
DiscountPercent = (1 - pricelevel15 / onlinecustomerprice) * 100;
}
else
{
DiscountPercent = null;
}
return 'DiscountPercent';
}
有哪位熟悉 SCA Mont Blanc 的人可以帮我完成这件事吗?谢谢。
【问题讨论】:
-
你能发布更多的上下文代码吗?
-
您好 Tony,SCA 中有大量代码。有什么帮助?该文件告诉后端在项目记录中提供 onenecustomer 价格和价格级别 15 的值。这是另一个请求文本字段中信息的调用示例:
// @property _StoreDescription grab the html in the web store description field , _StoreDescription: function(item) { return item.get('storedescription') }
标签: javascript netsuite