【问题标题】:Shopify Max Quantity SelectorShopify 最大数量选择器
【发布时间】:2021-12-15 16:41:37
【问题描述】:

早上好,我一直在网上做一些研究,似乎找不到任何答案。我正在创建一个 Shopify 网络应用程序,我的目标是在数量值等于库存值时禁用添加增量器。 Aka,不允许客户订购的数量超过我们的库存数量。

这是我尝试过的解决方案,也许您可​​以帮助我了解我需要做什么。我对shopify很陌生,所以我还在学习。

              <div id="qv-quantity-selector" class="product-form__input product-form__quantity">
            <quantity-input class="quantity">
              <button class="quantity__button no-js-hidden" name="minus" type="button">
                <span class="visually-hidden">{{ 'products.product.quantity.decrease' | t: product: product.title | escape }}</span>
               {% include 'icons' with 'minus' %}
              </button>
              <input type="number" id="Quantity-{{ section.id }}" name="quantity" value="1" min="1" max="current_variant.inventory_quantity == 1" class="product-form__input product-form__input--quantity" data-quantity-input>
              <button class="quantity__button no-js-hidden" name="plus" type="button">
                <span class="visually-hidden">{{ 'products.product.quantity.increase' | t: product: product.title | escape }}</span>
                 {% include 'icons' with 'plus' %}
              </button>
            </quantity-input>
          </div>

【问题讨论】:

    标签: javascript html shopify liquid


    【解决方案1】:

    经过更多研究,我确实找到了可行的解决方案。如果其他人遇到此问题,我强烈建议您查看此资源,因为它对我有用。

    https://community.shopify.com/c/shopify-design/limit-quantity-selector/m-p/606554#M151983

    【讨论】:

      猜你喜欢
      • 2010-10-02
      • 1970-01-01
      • 2017-03-23
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-04-24
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多