简体   繁体   English

如何使用 Shopify Plus 脚本编辑器应用程序限制产品/变体数量?

[英]How to limit product/variant quantity using Shopify Plus Script Editor app?

I'm looking for help to limit product/variant quantity using script editor app in Shopify Plus .我正在寻找帮助以使用Shopify Plus 中的脚本编辑器应用程序限制产品/变体数量。 The goal is to only allow one quantity to be able to add to cart per checkout for some specific variant ids in different products.目标是在每次结账时只允许将一个数量添加到购物车中,以获取不同产品中的某些特定变体 ID。

没有支持的 API,但您可以直接更新行项目对象实例变量:

line_item.instance_variable_set(:@quantity, max_quantity)

I'm looking for help to limit product/variant quantity using script editor app in Shopify Plus .我正在寻找使用Shopify Plus中的脚本编辑器应用程序来限制产品/品种数量的帮助。 The goal is to only allow one quantity to be able to add to cart per checkout for some specific variant ids in different products.目标是针对不同产品中的某些特定变体ID,每次结帐时只能添加一个数量到购物车中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM