针对Shopify的特定供应商
我需要针对特定的供应商,并且该供应商的产品是否缺乏库存禁用用户添加到购物车的能力(此部分的逻辑有效,只需专注于IF语句)即可。这是我到目前为止所拥有的:
{% assign isInStock = true %}
{% if product.vendor == 'PS-Stock' and current_variant.inventory_quantity < 1 %}
{% assign isInStock = false %}
{% endif %}
当我运行{{isInstock}}以查看输出是什么时,我将获得真实。不确定产品供应商部分是否正确编写,因为我正在测试的产品具有0个库存数量,所以我知道语句正确的最后一部分
I need to target a specific vendor and if the product by this vendor is out of stock disable user ability to add to cart (logic for this part works, just need to focus on the if statement). Here is what I have so far:
{% assign isInStock = true %}
{% if product.vendor == 'PS-Stock' and current_variant.inventory_quantity < 1 %}
{% assign isInStock = false %}
{% endif %}
When I run {{isInStock}} to see what the output is, i get true. Not sure if the product vendor part is wrote correctly as the product i am testing on has 0 inventory quantity so I know the last part of if statement is correct
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
尝试其他部分
Try This with Else part