我一直在我的网站中实施 Snipcart,我想用复选框提示用户,并根据用户是否选中它来提高产品价格。这是我的代码:
<button
class="snipcart-add-item btn btn-primary"
[attr.data-item-id]="selectedService._id"
[attr.data-item-price]="mainPrice"
data-item-url="http://localhost:4200/"
[attr.data-item-description]="selectedService.jsonData.description.en"
[attr.data-item-name]="selectedService.name"
data-item-custom1-name="Number of additional employees"
data-item-custom1-options="0|1[+25.00]|2[+50.00]|3[+75.00]|4[+100.00]|5[+125.00]|6[+150.00]|7[+175.00]|8[+200.00]|9[+225.00]|10[+250.00]"
data-item-custom2-name="Procure employment pass for USD 1,650.00 to allow a foreigner to serve as the local director."
data-item-custom2-options="false|true[+1650.00]"
>
在您的文档中,它说如果“data-item-options”的值为“true|false”,那么它将显示为一个复选框,但它显示为一个下拉列表,其值为“true”和“'错误的”。我做错了什么,还有其他方法可以实现吗?我也尝试过使用“data-item-custom-type”="checkbox",但是我没有选择增加产品价格的价值(或者我只是没有找到如何做到这一点) .