blob: 3033d1587d6dac9e835cc0085f1a879dee428095 [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">
50 {% if cart_settings.enable_checkout %}
51 <button class="btn btn-primary btn-place-order" type="button">
52 {{ _("Place Order") }}
53 </button>
54 {% else %}
55 <button class="btn btn-primary btn-request-for-quotation" type="button">
56 {{ _("Request for Quotation") }}
57 </button>
58 {% endif %}
59 </div>
60 {% endif %}
61
62 {% if doc.items %}
Faris Ansari5f8b3582019-03-19 11:48:32 +053063 {% if doc.tc_name %}
64 <div class="terms-and-conditions-link">
65 <a href class="link-terms-and-conditions" data-terms-name="{{ doc.tc_name }}">
66 {{ _("Terms and Conditions") }}
67 </a>
68 <script>
69 frappe.ready(() => {
70 $('.link-terms-and-conditions').click((e) => {
71 e.preventDefault();
72 const $link = $(e.target);
73 const terms_name = $link.attr('data-terms-name');
74 show_terms_and_conditions(terms_name);
75 })
76 });
77 function show_terms_and_conditions(terms_name) {
78 frappe.call('erpnext.shopping_cart.cart.get_terms_and_conditions', { terms_name })
79 .then(r => {
80 frappe.msgprint({
81 title: terms_name,
82 message: r.message
83 });
84 });
85 }
86 </script>
Kanchan Chauhan239b3512016-05-02 11:43:44 +053087 </div>
Faris Ansari5f8b3582019-03-19 11:48:32 +053088 {% endif %}
Kanchan Chauhan1d79f352016-05-10 17:19:47 +053089
Faris Ansari5f8b3582019-03-19 11:48:32 +053090 <div class="cart-addresses mt-5">
91 {% include "templates/includes/cart/cart_address.html" %}
92 </div>
93 {% endif %}
Faris Ansari5f8b3582019-03-19 11:48:32 +053094</div>
95
96<div class="row mt-5">
97 <div class="col-12">
98 {% if cart_settings.enable_checkout %}
99 <a href="/orders">
100 {{ _('See past orders') }}
101 </a>
102 {% else %}
103 <a href="/quotations">
104 {{ _('See past quotations') }}
105 </a>
Kanchan Chauhan1d79f352016-05-10 17:19:47 +0530106 {% endif %}
Kanchan Chauhan239b3512016-05-02 11:43:44 +0530107 </div>
Rushabh Mehta3daa49a2014-10-21 16:16:30 +0530108</div>
109
Faris Ansari5f8b3582019-03-19 11:48:32 +0530110{% endblock %}
Rushabh Mehtaa3340622016-06-23 18:25:50 +0530111
Faris Ansari5f8b3582019-03-19 11:48:32 +0530112{% block base_scripts %}
113<!-- js should be loaded in body! -->
114<script type="text/javascript" src="/assets/frappe/js/lib/jquery/jquery.min.js"></script>
115<script type="text/javascript" src="/assets/js/frappe-web.min.js"></script>
116<script type="text/javascript" src="/assets/js/control.min.js"></script>
117<script type="text/javascript" src="/assets/js/dialog.min.js"></script>
118<script type="text/javascript" src="/assets/js/bootstrap-4-web.min.js"></script>
Rushabh Mehta3daa49a2014-10-21 16:16:30 +0530119{% endblock %}