代码:
function totalIt() {
var input = document.getElementsByName("product");
var total = 0;
for (var i = 0; i < input.length; i++) {
if (input[i].checked) {
total += parseFloat(input[i].value);
}
}
document.getElementsByName("total")[0].value = "₹" +
在我的WooCommerce网站上,我有几种产品的价格与80美元相同。
我想按产品数量加上折扣。
逻辑是这样的:
if (Products Quantity is 2){
// the original product price change from 80$ to 75$ each.
}
if(Products Quantity is 3 or more){
//the original product price change from 80$ to 70$ each.
}
例如,
如果客户选择2种产品,原价将是(80$ x 2) => 160$.But
我昨天开始研究FsCheck,我正在试着写一个简单的测试,DiscountAmount的任何实例都会有负值。我的问题是,在一个测试中有多个断言可以吗?例如,这里我说的是创建discountAmount的金额加上折扣金额应该是0。但我也要说,折扣金额应该小于0。这应该是2个测试还是1个?
public class DiscountAmountTests
{
[Property()]
public void value_or_created_discountAmount_should_be_negative()
{