blob: 876eaea8e6abe3077deb64abd61e3e2959676d3e [file] [log] [blame]
Rushabh Mehta51008f22016-01-01 17:23:12 +05301{% extends "templates/web.html" %}
2
Robert Kirschnerd162eb32017-03-23 12:18:24 +01003{% block title %} {{ _("Shopping Cart") }} {% endblock %}
Rushabh Mehta3daa49a2014-10-21 16:16:30 +05304
Faris Ansari5f8b3582019-03-19 11:48:32 +05305{% block header %}<h1>{{ _("Shopping Cart") }}</h1>{% endblock %}
Rushabh Mehta3daa49a2014-10-21 16:16:30 +05306
Faris Ansari5f8b3582019-03-19 11:48:32 +05307<!--
Rushabh Mehta51008f22016-01-01 17:23:12 +05308{% block script %}
9<script>{% include "templates/includes/cart.js" %}</script>
10{% endblock %}
Faris Ansari5f8b3582019-03-19 11:48:32 +053011-->
Rushabh Mehta51008f22016-01-01 17:23:12 +053012
Rushabh Mehta3d766862015-09-16 18:52:52 +053013
14{% block header_actions %}
Rushabh Mehta3d766862015-09-16 18:52:52 +053015{% endblock %}
16
Rushabh Mehta51008f22016-01-01 17:23:12 +053017{% block page_content %}
Rushabh Mehta156ce602015-09-11 18:49:59 +053018
Rushabh Mehta3d766862015-09-16 18:52:52 +053019{% from "templates/includes/macros.html" import item_name_and_description %}
Rushabh Mehta156ce602015-09-11 18:49:59 +053020
Kanchan Chauhan239b3512016-05-02 11:43:44 +053021<div class="cart-container">
Faris Ansari5f8b3582019-03-19 11:48:32 +053022 <div id="cart-error" class="alert alert-danger" style="display: none;"></div>
23
24 {% if doc.items %}
25 <table class="table table-bordered mt-3">
26 <thead>
27 <tr>
28 <th width="60%">{{ _('Item') }}</th>
29 <th width="20%" class="text-right">{{ _('Quantity') }}</th>
30 {% if cart_settings.enable_checkout %}
31 <th width="20%" class="text-right">{{ _('Subtotal') }}</th>
32 {% endif %}
33 </tr>
34 </thead>
35 <tbody class="cart-items">
36 {% include "templates/includes/cart/cart_items.html" %}
37 </tbody>
38 {% if cart_settings.enable_checkout %}
39 <tfoot class="cart-tax-items">
Kanchan Chauhan1d79f352016-05-10 17:19:47 +053040 {% include "templates/includes/order/order_taxes.html" %}
Faris Ansari5f8b3582019-03-19 11:48:32 +053041 </tfoot>
Kanchan Chauhan1d79f352016-05-10 17:19:47 +053042 {% endif %}
Faris Ansari5f8b3582019-03-19 11:48:32 +053043 </table>
44 {% else %}
45 <p class="text-muted">{{ _('Your cart is Empty') }}</p>
46 {% endif %}
Kanchan Chauhan1d79f352016-05-10 17:19:47 +053047
Faris Ansari5f8b3582019-03-19 11:48:32 +053048 {% if doc.items %}
Vishal Dhayagude24e79b12020-04-07 12:18:47 +053049 <div class="place-order-container">
Anupam Kumar0d9a8ae2021-01-28 17:32:57 +053050 <a class="btn btn-primary-light mr-2" href="/all-products">
51 {{ _("Continue Shopping") }}
52 </a>
Vishal Dhayagude24e79b12020-04-07 12:18:47 +053053 {% if cart_settings.enable_checkout %}
54 <button class="btn btn-primary btn-place-order" type="button">
55 {{ _("Place Order") }}
56 </button>
57 {% else %}
58 <button class="btn btn-primary btn-request-for-quotation" type="button">
59 {{ _("Request for Quotation") }}
60 </button>
61 {% endif %}
62 </div>
63 {% endif %}
64
65 {% if doc.items %}
Faris Ansari5f8b3582019-03-19 11:48:32 +053066 {% if doc.tc_name %}
67 <div class="terms-and-conditions-link">
68 <a href class="link-terms-and-conditions" data-terms-name="{{ doc.tc_name }}">
69 {{ _("Terms and Conditions") }}
70 </a>
71 <script>
72 frappe.ready(() => {
73 $('.link-terms-and-conditions').click((e) => {
74 e.preventDefault();
75 const $link = $(e.target);
76 const terms_name = $link.attr('data-terms-name');
77 show_terms_and_conditions(terms_name);
78 })
79 });
80 function show_terms_and_conditions(terms_name) {
81 frappe.call('erpnext.shopping_cart.cart.get_terms_and_conditions', { terms_name })
82 .then(r => {
83 frappe.msgprint({
84 title: terms_name,
85 message: r.message
86 });
87 });
88 }
89 </script>
Kanchan Chauhan239b3512016-05-02 11:43:44 +053090 </div>
Faris Ansari5f8b3582019-03-19 11:48:32 +053091 {% endif %}
Kanchan Chauhan1d79f352016-05-10 17:19:47 +053092
Faris Ansari5f8b3582019-03-19 11:48:32 +053093 <div class="cart-addresses mt-5">
94 {% include "templates/includes/cart/cart_address.html" %}
95 </div>
96 {% endif %}
Faris Ansari5f8b3582019-03-19 11:48:32 +053097</div>
98
99<div class="row mt-5">
100 <div class="col-12">
101 {% if cart_settings.enable_checkout %}
102 <a href="/orders">
103 {{ _('See past orders') }}
104 </a>
105 {% else %}
106 <a href="/quotations">
107 {{ _('See past quotations') }}
108 </a>
Kanchan Chauhan1d79f352016-05-10 17:19:47 +0530109 {% endif %}
Kanchan Chauhan239b3512016-05-02 11:43:44 +0530110 </div>
Rushabh Mehta3daa49a2014-10-21 16:16:30 +0530111</div>
112
Faris Ansari5f8b3582019-03-19 11:48:32 +0530113{% endblock %}
Rushabh Mehtaa3340622016-06-23 18:25:50 +0530114
Faris Ansari5f8b3582019-03-19 11:48:32 +0530115{% block base_scripts %}
116<!-- js should be loaded in body! -->
117<script type="text/javascript" src="/assets/frappe/js/lib/jquery/jquery.min.js"></script>
118<script type="text/javascript" src="/assets/js/frappe-web.min.js"></script>
119<script type="text/javascript" src="/assets/js/control.min.js"></script>
120<script type="text/javascript" src="/assets/js/dialog.min.js"></script>
121<script type="text/javascript" src="/assets/js/bootstrap-4-web.min.js"></script>
Rushabh Mehta3daa49a2014-10-21 16:16:30 +0530122{% endblock %}