나는 제품 페이지에서 모든 제품의 옵션은 장바구니 버튼에 추가 한 후 매진되는 경우 인수를 만들기 위해 노력하고있어 부족하고 옵션 드롭 다운이 표시되지 않은 경우 모든 옵션을 숨기기 매진 된 div가 대신 표시됩니다. 옵션이 없으면 제품에 재고가있는 경우 장바구니에 추가 버튼이 표시되지만 제대로 작동하지는 않습니다. 정말 가까운 것 같은큰 카르텔 - 하나 개의 옵션 재고
는 느낌. 나는 제품이 제품은 '판매'를 보여줍니다 어떤 선택의 여지가 판매되는 경우는, 카드 추가 버튼을 표시 한 후 아무런 옵션이없는 경우 그것이 작동되도록 할 수있었습니다 만, 모든 옵션 재고가있는 경우는 표시됩니다 옵션이 있기 때문에 옵션을 선택하고 장바구니 버튼을 여러 번 추가 (예 : 제품이 2 옵션이있는 경우 페이지가 표시됩니다 :
옵션 선택
장바구니 버튼에 추가
선택기
장바구니 버튼에 추가 옵션)
{% when 'active' %}
<form id="product-form" method="post" action="/cart">
{% for option in product.options %}
{% if product.has_default_option %}
{{ product.option | hidden_option_input }}
<button class="button" id="product-addtocart" name="submit"
type="submit">Add to cart</button>
{% endif %}
{% if option.sold_out %}
{{ product.option | hidden_option_input }}
<div class="sold">
<h4><span>Sold</span></h4>
</div>
{% endif %}
{% if option.sold_out == false %}
<div id="product-options" class="options">
{{ product.options | options_select }}
</div><br>
<button class="button" id="product-addtocart" name="submit"
type="submit">Add to cart</button>
{% endif %}
{% endfor %}
{% if product.on_sale %}<div>On Sale</div>{% endif %}
</form>
는 그와 같은 변수 할당을하고 생각하지 않았다. 고맙습니다. 이것은 완벽하게 작동합니다. –