如何添加变种到我的购物车 - Storenvy

时间:2016-06-12 01:21:30

标签: javascript html forms

我很难将我的变种带到我的定制商店商店产品页面上的购物车中。

任何帮助将不胜感激!我不是一个程序员。我想我很亲密,但我错了。

以下是我使用的代码,实时页面的链接是:http://apricotmantle.storenvy.com/collections/259687-merch/products/17058861-bloody-beach-zombie-limited-edition-pinup-print

CODE:

  <div class="slide products_{{product.id}} active">
  <div class="home-content">

    <a href="{{ product.photo.url }}"><img class="artwork" src     {{product.photo.url}}" alt="{{product.name | escape }}" /></a>


<div class="artworkContent">
  <h1>{{ product.name }}</h1>
  <div id="add_notice" style="display:none;"></div>

  {% if product.description != blank %}
    {{ product.description | auto_link | paragraphs }}
  {% endif %}
  {% if product.image_count > 1 %}
    <div id="slider-code">
          <div class="viewport">
          <ul class="overview" id="thumbs">
            {% for photo in product.photos offset:1 limit:3 %}
            <li>
              <a href="{{photo.url}}" class="product_thumb" {%if forloop.first %}id="first_thumb" {%endif%} rel="product_photos">
                <img src="{{photo.medium_url}}" height="100" width="145" alt="{{product.name | h}} - Thumbnail {{forloop.index}}"/>
              </a>
            </li>
            {% endfor %}
          </ul>
          </div>
          {% endif %}

  {% if product.coming_soon %}
    <h3>Coming soon!</h3>
  {% else %}
    {% for variant in product.variants limit:1 %}
        <div class="add {{ variant.status }}">
          {% if variant.quantity < 1 %}
          <img src="/themes/default/images/btn_sold_out-v2.png" />
          {% else %}
           <p id="price">{{ product.price | money_with_sign }}</p>
            <form id="add-to-cart" action="/cart/add" method="post" >
   <select id="variant-select">
      <option>Product Options</option>
         {% for variant in product.variants %}
          <option value="{{ variant.id }}">{{variant.title }} for {{ variant.price | money}}</option>
           {% endfor %}
    </select>
    <input type="image" name="add" value="Purchase" id="purchase" src="{{ 'purchase.png' | asset_url}}" />
    <span id="product-price">{{ product.price | money }}</span>
</form>
          {% endif %}
        </div><!-- end .add -->
        <div class="{{ product.css_class }}">
    {% if product.on_sale %}<div class="sale">On Sale</div>{% endif %}
    {% if product.preorder %}<div class="preorder">Pre-Order</div>{% endif %}
    {% if product.coming_soon %}<div class="soon">Coming Soon</div>{% endif %}
    {% if product.sold_out %}<div class="soldout">Sold Out</div>{% endif %}
  </div>

      {% endfor %}
  {% endif %}

<a href="{{ product.marketplace_url }}" {% if product.sold_out %}style="margin:20px 0px"{% endif %} class="product_profile">Storenvy Marketplace Page</a>
  <!--<h6>Share This</h6>
  <div id="share_product">
    {{ product | facebook_like_button }}
    {{ product | tweet_button }}
    {{ product | wanelo_button }}
    {{ product | pinterest_button }}
    <hr/>

  </div>-->
</div><!-- end .product_info --></div>
  </div>

0 个答案:

没有答案