File size: 3,020 Bytes
366d6fd
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
72
73
74
75
76
77
78
79
80
{% extends "base.html" %}
{% block title %}Bag - Apple{% endblock %}
{% block content %}
<div class="wrap">
  {% if lines %}
  <div class="bag-head">
    <h1>Review your bag.</h1>
    <p>Free delivery and free returns.</p>
  </div>

  {% for line in lines %}
  <div class="bag-line" data-sku="{{ line.sku }}">
    <img src="{{ line.image }}" alt="{{ line.name }}" width="890" height="890">
    <div>
      <a href="{{ line.href }}">{{ line.name }}</a>
      <form class="qty" method="post" action="/shop/bag">
        <input type="hidden" name="sku" value="{{ line.sku }}">
        <label>
          <span class="visually-hidden">Quantity of {{ line.name }}</span>
          <input type="number" name="quantity" min="0" max="99" step="1"
                 value="{{ line.quantity }}" data-testid="quantity"
                 aria-label="Quantity of {{ line.name }}">
        </label>
        <button type="submit" name="intent" value="update">Update</button>
        <button type="submit" name="intent" value="remove"
                aria-label="Remove {{ line.name }}">Remove</button>
      </form>
    </div>
    <div>{{ line.line_total_display }}</div>
  </div>
  {% endfor %}

  <div class="bag-totals">
    <div><span>Subtotal</span><span data-testid="subtotal">{{ totals.subtotal_display }}</span></div>
    <div><span>Shipping</span><span>FREE</span></div>
    <div><span>Estimated tax</span><span>{{ totals.tax_display }}</span></div>
    <div class="grand"><span>Total</span><span data-testid="total">{{ totals.total_display }}</span></div>
    <p><a class="pill" href="/shop/checkout">Check Out</a></p>
    <p class="finance">Free delivery and free returns.</p>
  </div>
  {% else %}
  <div class="bag-head">
    <h1>Your bag is empty.</h1>
    <p>Sign in to see if you have any saved items. Or continue shopping.</p>
    <div class="cta-row">
      <a class="pill" href="/shop/signin">Sign In</a>
      <a class="pill ghost" href="/shop/accessories/all/cases-protection">Continue Shopping</a>
    </div>
  </div>
  {% endif %}

  {% if saved_products %}
  <section class="section">
    <h2 style="font-size:32px;line-height:36px;">Saved items</h2>
    <ul class="product-grid">
      {% for product in saved_products %}
      <li class="product-card">
        <a href="{{ product.href }}"><img src="{{ product.image }}" alt="{{ product.name }}" loading="lazy" width="890" height="890"></a>
        <a class="name" href="{{ product.href }}">{{ product.name }}</a>
        <span class="price">{{ product.price_display }}</span>
      </li>
      {% endfor %}
    </ul>
  </section>
  {% endif %}

  <section class="section">
    <h2 style="font-size:32px;line-height:36px;">Questions About Buying</h2>
    <div class="accordion" style="text-align:left;max-width:700px;margin:0 auto;">
      {% for faq in faqs %}
      <details>
        <summary>{{ faq.question }}</summary>
        <div class="body"><p>{{ faq.answer }}</p></div>
      </details>
      {% endfor %}
    </div>
  </section>
</div>
{% endblock %}