0
处理自定义大卡特尔主题和我快完成了,唯一不起作用的部分是当用户更新购物车中的产品数量时,他们可以将数字设置为一个大于剩余股票的价值。使用大卡特尔API已经变量称为产品与VARBigcartel Api获取库存中的剩余物品
product.options- Returns all of the options of a product whether they are
sold out or not.
我然后遍历所有选项,一个产品像这样
Product.find(permalink, function(product) {
console.log("I found " + product.name + "!");
var len=(product.options.length);
console.log(len);
for(var i = 0; i<len;i++){
console.log((product.options[i]));
}
});
“选项”对象,根据API有现场
option.quantity Returns the quantity left in stock for an option.
好吧,当我检查,我从循环获取对象它打印
Object {id: 153343298, name: "Small", price: 30, sold_out: false, has_custom_price: false}
并没有“数量”字段。这里是API文档的链接,有没有人有任何想法?当您单击BigCartel“Cart.html”页面上的结帐按钮 Big Cartel API Docs