0

bigcartel で e コマース サイトを構築しようとしています。商品ページに数量欄がなく、追加したいです。バックエンドへのアクセスは制限されていますが、html を変更して JavaScript を追加できます。

あまり手間をかけずに、カート ボタンにリンクされた数量フィールドを追加する方法はありますか?

カート ボタン領域のコードは次のとおりです。

 <div id="variations">
  {% if product.available? %}
    <p>
      <select id="cart_variation_id">
        <option>Select Option...</option>
        {% for variation in product.variations %}
          {% if variation.available? %}
            <option value="{{ variation.id }}">{{ variation.name }} - {{ variation.price | money }}</option>
          {% else %}
            <option disabled="disabled">{{ variation.name }} - {{ variation.price | money }} (Out of Stock)</option>
          {% endif %}
        {% endfor %}
      </select>

      <button class="btn" onclick="javascript:Store.cart.add(document.getElementById('cart_variation_id').options[document.getElementById('cart_variation_id').selectedIndex].value);return false;">Add to Cart</button>
4

1 に答える 1