~misterio/BSI-SCC0560

ref: bd1dcc38158affdd350486d31e1a978ee8efa529 BSI-SCC0560/_layouts/shop-product.html -rw-r--r-- 1.8 KiB
bd1dcc38Gabriel Fontes fix product size variable 1 year, 4 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
---
layout: shop
---

<header>
  <nav aria-label="breadcrumbs" class="breadcrumb">
    <ol>
      <li><a href="/shops/{{ page.shop.slug }}">Home</a></li>
      <li>
        <a href="/shops/{{ page.shop.slug }}#{{ page.product.category.slug }}"
          >{{ page.product.category.name }}</a
        >
      </li>
      <li><a href="#" aria-current="page">{{ page.product.name }}</a></li>
    </ol>
  </nav>
</header>

<div class="detail">
<section class="product">
  <figure>
    <img alt="{{ page.product.name }}" src="{{ page.product.image }}" />
  </figure>
  <form method="get" action="/shops/{{ page.shop.slug }}/cart">
    <h1>{{ page.product.name }}</h1>
    <p class="price">{{ page.product.price }}</p>
    <hr />
    <input
      type="hidden"
      id="product"
      name="produto"
      value="{{ page.product.slug }}"
    />
    {% if page.product.sizes == true %}
    <label for="size">Tamanho:</label>
    <select
      name="tamanho"
      id="size"
      {% if page.product.available == 0 %}
      disabled
      {% endif %}
    >
      <option value="XS">PP</option>
      <option value="S">P</option>
      <option value="M" selected>M</option>
      <option value="L">G</option>
      <option value="L">GG</option>
      <option value="XL">GG</option>
      <option value="XXL">XGG</option>
    </select>
    {% endif %}
    <label for="amount">Unidades:</label>
    <input
      type="number"
      name="unidades"
      id="amount"
      value="1"
      min="1"
      max="{% if page.product.available %}{{page.product.available}}{% else %}99{% endif %}"
      {% if page.product.available == 0 %}
      disabled
      {% endif %}
    />
    {% if page.product.available == 0 %}
    <button type="submit" disabled>Indisponível</button>
    {% else %}
    <button type="submit">Adicionar ao carrinho</button>
    {% endif %}
  </form>
</section>
</div>