0

我正在尝试在购物车表单中设置 Shopify 变体下拉菜单。由于某种原因,信息没有通过。我不断收到:“我们无法将此商品添加到您的购物车,因为没有将变体 ID 传递给我们。”

有任何想法吗?

        <form action="/cart/add" method="post" enctype="multipart/form-data" style="width: 100%">

                    <h2>Order Your Painting</h2>
                    <div id="order-form">
                        <div class="steps left">
                          <h3>1. Choose your canvas size</h3>
                          <div class="selector-wrapper">
                            <select class="single-option-selector" id="product-select-option-0">
                            <option value="11“x14” Canvas">11“x14” Canvas</option>
                            <option value="12”x16” Canvas">12”x16” Canvas</option>
                            </select>
                          </div>

                        </div>

                        <div class="steps right">
                            <h3>2. Select a color family</h3>
                          <div class="selector-wrapper">
                            <select class="single-option-selector" id="product-select-option-1">
                              <option value="Blue Tones">Blue Tones</option>
                              <option value="Sepia Tones">Sepia Tones</option>
                            </select>
                          </div>
                        </div>

                        <div class="steps left">
                          <h3>3. Upload your photo</h3>
                          <div>Select a File to Upload</div>
                          <p><input type="file" id="photo" name="properties[Photo]" /></p>
                        </div>

                        <div class="steps right" id="payment">
                          <h3>4. Checkout with payment</h3>
                          <div id="cc">
                            <input type="hidden" name="return_to" value="/checkout" />
                            <input type="submit" name="add" id="add" value="Add to cart">
                          </div>

                        </div>
                    </div>


                </form>
4

2 回答 2

0

戴夫说的。请参阅此文档:http: //docs.shopify.com/support/your-website/5-themes/can-i-make-my-theme-use-products-with-multiple-options

于 2013-10-11T16:16:36.760 回答
0

从您的代码:

<select class="single-option-selector" id="product-select-option-0">
   <option value="11“x14” Canvas">11“x14” Canvas</option>
   <option value="12”x16” Canvas">12”x16” Canvas</option>
</select>

您那里有有效的变体 ID 吗?似乎没有。Shopify 不知道 value="11“x14” Canvas" 是什么。尝试使用变体 ID,而不是渲染它。您的表单将提交,Shopify 将知道将什么放入购物车,并且该错误将消失。

于 2013-10-10T19:11:35.417 回答