blob: 262b86f130bfeb901dde8fac14df470314ba28b6 [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
prssannab00eb1b2021-01-20 17:52:54 +05305{% block header %}<h3 class="shopping-cart-header mt-2 mb-6">{{ _("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
prssannab00eb1b2021-01-20 17:52:54 +053021{% if doc.items %}
Kanchan Chauhan239b3512016-05-02 11:43:44 +053022<div class="cart-container">
prssannab00eb1b2021-01-20 17:52:54 +053023 <div class="row m-0">
marination53bb7a92021-05-27 18:53:11 +053024 <div class="col-md-8 frappe-card p-5 mb-4">
prssannab00eb1b2021-01-20 17:52:54 +053025 <div>
26 <div id="cart-error" class="alert alert-danger" style="display: none;"></div>
27 <div class="cart-items-header">
28 {{ _('Items') }}
29 </div>
30 <table class="table mt-3 cart-table">
31 <thead>
32 <tr>
marination53bb7a92021-05-27 18:53:11 +053033 <th class="item-column">{{ _('Item') }}</th>
prssannab00eb1b2021-01-20 17:52:54 +053034 <th width="20%">{{ _('Quantity') }}</th>
35 {% if cart_settings.enable_checkout %}
marination53bb7a92021-05-27 18:53:11 +053036 <th width="20" class="text-right column-sm-view">{{ _('Subtotal') }}</th>
prssannab00eb1b2021-01-20 17:52:54 +053037 {% endif %}
marination53bb7a92021-05-27 18:53:11 +053038 <th width="10%" class="column-sm-view"></th>
prssannab00eb1b2021-01-20 17:52:54 +053039 </tr>
40 </thead>
41 <tbody class="cart-items">
42 {% include "templates/includes/cart/cart_items.html" %}
43 </tbody>
44 {% if cart_settings.enable_checkout %}
45 <tfoot class="cart-tax-items">
46 {% include "templates/includes/order/order_taxes.html" %}
47 </tfoot>
48 {% endif %}
49 </table>
50 </div>
marination53bb7a92021-05-27 18:53:11 +053051
52 <div class="row mt-2">
53 <div class="col-3">
prssannab00eb1b2021-01-20 17:52:54 +053054 {% if cart_settings.enable_checkout %}
marination53bb7a92021-05-27 18:53:11 +053055 <a class="btn btn-outline-primary" href="/orders">
56 {{ _('Past Orders') }}
57 </a>
prssannab00eb1b2021-01-20 17:52:54 +053058 {% else %}
marination53bb7a92021-05-27 18:53:11 +053059 <a class="btn btn-outline-primary" href="/quotations">
60 {{ _('See past quotations') }}
61 </a>
prssannab00eb1b2021-01-20 17:52:54 +053062 {% endif %}
63 </div>
marination53bb7a92021-05-27 18:53:11 +053064 <div class="col-9">
prssannab00eb1b2021-01-20 17:52:54 +053065 {% if doc.items %}
66 <div class="place-order-container">
Anupamd7f4aef2021-02-05 16:17:20 +053067 <a class="btn btn-primary-light mr-2" href="/all-products">
marination53bb7a92021-05-27 18:53:11 +053068 {{ _('Back to Shop') }}
Anupamd7f4aef2021-02-05 16:17:20 +053069 </a>
prssannab00eb1b2021-01-20 17:52:54 +053070 {% if cart_settings.enable_checkout %}
71 <button class="btn btn-primary btn-place-order" type="button">
marination53bb7a92021-05-27 18:53:11 +053072 {{ _('Place Order') }}
prssannab00eb1b2021-01-20 17:52:54 +053073 </button>
74 {% else %}
75 <button class="btn btn-primary btn-request-for-quotation" type="button">
marination53bb7a92021-05-27 18:53:11 +053076 {{ _('Request for Quotation') }}
prssannab00eb1b2021-01-20 17:52:54 +053077 </button>
78 {% endif %}
79 </div>
80 {% endif %}
81 </div>
82 </div>
Faris Ansari5f8b3582019-03-19 11:48:32 +053083
Kanchan Chauhan1d79f352016-05-10 17:19:47 +053084
prssannab00eb1b2021-01-20 17:52:54 +053085 {% if doc.items %}
86 {% if doc.tc_name %}
87 <div class="terms-and-conditions-link">
88 <a href class="link-terms-and-conditions" data-terms-name="{{ doc.tc_name }}">
89 {{ _("Terms and Conditions") }}
90 </a>
91 <script>
92 frappe.ready(() => {
93 $('.link-terms-and-conditions').click((e) => {
94 e.preventDefault();
95 const $link = $(e.target);
96 const terms_name = $link.attr('data-terms-name');
97 show_terms_and_conditions(terms_name);
98 })
99 });
100 function show_terms_and_conditions(terms_name) {
marination22f41a12021-02-25 13:56:38 +0530101 frappe.call('erpnext.e_commerce.shopping_cart.cart.get_terms_and_conditions', { terms_name })
prssannab00eb1b2021-01-20 17:52:54 +0530102 .then(r => {
103 frappe.msgprint({
104 title: terms_name,
105 message: r.message
106 });
107 });
108 }
109 </script>
110 </div>
Vishal Dhayagude24e79b12020-04-07 12:18:47 +0530111 {% endif %}
112 </div>
Vishal Dhayagude24e79b12020-04-07 12:18:47 +0530113
prssannab00eb1b2021-01-20 17:52:54 +0530114 <div class="col-md-4">
115 <div class="cart-addresses">
116 {% include "templates/includes/cart/cart_address.html" %}
117 </div>
Kanchan Chauhan239b3512016-05-02 11:43:44 +0530118 </div>
prssannab00eb1b2021-01-20 17:52:54 +0530119 {% endif %}
Faris Ansari5f8b3582019-03-19 11:48:32 +0530120 </div>
Faris Ansari5f8b3582019-03-19 11:48:32 +0530121</div>
prssannab00eb1b2021-01-20 17:52:54 +0530122{% else %}
123<div class="cart-empty frappe-card">
124 <div class="cart-empty-state">
125 <img src="/assets/erpnext/images/ui-states/cart-empty-state.png" alt="Empty State">
126 </div>
127 <div class="cart-empty-message mt-4">{{ _('Your cart is Empty') }}</p>
128 {% if cart_settings.enable_checkout %}
129 <a class="btn btn-outline-primary" href="/orders">
Faris Ansari5f8b3582019-03-19 11:48:32 +0530130 {{ _('See past orders') }}
131 </a>
132 {% else %}
prssannab00eb1b2021-01-20 17:52:54 +0530133 <a class="btn btn-outline-primary" href="/quotations">
Faris Ansari5f8b3582019-03-19 11:48:32 +0530134 {{ _('See past quotations') }}
135 </a>
prssannab00eb1b2021-01-20 17:52:54 +0530136 {% endif %}
Rushabh Mehta3daa49a2014-10-21 16:16:30 +0530137</div>
prssannab00eb1b2021-01-20 17:52:54 +0530138{% endif %}
Rushabh Mehta3daa49a2014-10-21 16:16:30 +0530139
Faris Ansari5f8b3582019-03-19 11:48:32 +0530140{% endblock %}
Rushabh Mehtaa3340622016-06-23 18:25:50 +0530141
Faris Ansari5f8b3582019-03-19 11:48:32 +0530142{% block base_scripts %}
143<!-- js should be loaded in body! -->
Faris Ansari464d8382021-05-07 14:53:42 +0530144{{ include_script("frappe-web.bundle.js") }}
145{{ include_script("controls.bundle.js") }}
146{{ include_script("dialog.bundle.js") }}
Rushabh Mehta3daa49a2014-10-21 16:16:30 +0530147{% endblock %}