Rushabh Mehta | 51008f2 | 2016-01-01 17:23:12 +0530 | [diff] [blame] | 1 | {% extends "templates/web.html" %} |
| 2 | |
Robert Kirschner | d162eb3 | 2017-03-23 12:18:24 +0100 | [diff] [blame] | 3 | {% block title %} {{ _("Shopping Cart") }} {% endblock %} |
Rushabh Mehta | 3daa49a | 2014-10-21 16:16:30 +0530 | [diff] [blame] | 4 | |
Faris Ansari | 5f8b358 | 2019-03-19 11:48:32 +0530 | [diff] [blame] | 5 | {% block header %}<h1>{{ _("Shopping Cart") }}</h1>{% endblock %} |
Rushabh Mehta | 3daa49a | 2014-10-21 16:16:30 +0530 | [diff] [blame] | 6 | |
Faris Ansari | 5f8b358 | 2019-03-19 11:48:32 +0530 | [diff] [blame] | 7 | <!-- |
Rushabh Mehta | 51008f2 | 2016-01-01 17:23:12 +0530 | [diff] [blame] | 8 | {% block script %} |
| 9 | <script>{% include "templates/includes/cart.js" %}</script> |
| 10 | {% endblock %} |
Faris Ansari | 5f8b358 | 2019-03-19 11:48:32 +0530 | [diff] [blame] | 11 | --> |
Rushabh Mehta | 51008f2 | 2016-01-01 17:23:12 +0530 | [diff] [blame] | 12 | |
Rushabh Mehta | 3d76686 | 2015-09-16 18:52:52 +0530 | [diff] [blame] | 13 | |
| 14 | {% block header_actions %} |
Rushabh Mehta | 3d76686 | 2015-09-16 18:52:52 +0530 | [diff] [blame] | 15 | {% endblock %} |
| 16 | |
Rushabh Mehta | 51008f2 | 2016-01-01 17:23:12 +0530 | [diff] [blame] | 17 | {% block page_content %} |
Rushabh Mehta | 156ce60 | 2015-09-11 18:49:59 +0530 | [diff] [blame] | 18 | |
Rushabh Mehta | 3d76686 | 2015-09-16 18:52:52 +0530 | [diff] [blame] | 19 | {% from "templates/includes/macros.html" import item_name_and_description %} |
Rushabh Mehta | 156ce60 | 2015-09-11 18:49:59 +0530 | [diff] [blame] | 20 | |
Kanchan Chauhan | 239b351 | 2016-05-02 11:43:44 +0530 | [diff] [blame] | 21 | <div class="cart-container"> |
Faris Ansari | 5f8b358 | 2019-03-19 11:48:32 +0530 | [diff] [blame] | 22 | <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 Chauhan | 1d79f35 | 2016-05-10 17:19:47 +0530 | [diff] [blame] | 40 | {% include "templates/includes/order/order_taxes.html" %} |
Faris Ansari | 5f8b358 | 2019-03-19 11:48:32 +0530 | [diff] [blame] | 41 | </tfoot> |
Kanchan Chauhan | 1d79f35 | 2016-05-10 17:19:47 +0530 | [diff] [blame] | 42 | {% endif %} |
Faris Ansari | 5f8b358 | 2019-03-19 11:48:32 +0530 | [diff] [blame] | 43 | </table> |
| 44 | {% else %} |
| 45 | <p class="text-muted">{{ _('Your cart is Empty') }}</p> |
| 46 | {% endif %} |
Kanchan Chauhan | 1d79f35 | 2016-05-10 17:19:47 +0530 | [diff] [blame] | 47 | |
Faris Ansari | 5f8b358 | 2019-03-19 11:48:32 +0530 | [diff] [blame] | 48 | {% if doc.items %} |
Vishal Dhayagude | 24e79b1 | 2020-04-07 12:18:47 +0530 | [diff] [blame] | 49 | <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 Ansari | 5f8b358 | 2019-03-19 11:48:32 +0530 | [diff] [blame] | 63 | {% 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 Chauhan | 239b351 | 2016-05-02 11:43:44 +0530 | [diff] [blame] | 87 | </div> |
Faris Ansari | 5f8b358 | 2019-03-19 11:48:32 +0530 | [diff] [blame] | 88 | {% endif %} |
Kanchan Chauhan | 1d79f35 | 2016-05-10 17:19:47 +0530 | [diff] [blame] | 89 | |
Faris Ansari | 5f8b358 | 2019-03-19 11:48:32 +0530 | [diff] [blame] | 90 | <div class="cart-addresses mt-5"> |
| 91 | {% include "templates/includes/cart/cart_address.html" %} |
| 92 | </div> |
| 93 | {% endif %} |
Faris Ansari | 5f8b358 | 2019-03-19 11:48:32 +0530 | [diff] [blame] | 94 | </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 Chauhan | 1d79f35 | 2016-05-10 17:19:47 +0530 | [diff] [blame] | 106 | {% endif %} |
Kanchan Chauhan | 239b351 | 2016-05-02 11:43:44 +0530 | [diff] [blame] | 107 | </div> |
Rushabh Mehta | 3daa49a | 2014-10-21 16:16:30 +0530 | [diff] [blame] | 108 | </div> |
| 109 | |
Faris Ansari | 5f8b358 | 2019-03-19 11:48:32 +0530 | [diff] [blame] | 110 | {% endblock %} |
Rushabh Mehta | a334062 | 2016-06-23 18:25:50 +0530 | [diff] [blame] | 111 | |
Faris Ansari | 5f8b358 | 2019-03-19 11:48:32 +0530 | [diff] [blame] | 112 | {% 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 Mehta | 3daa49a | 2014-10-21 16:16:30 +0530 | [diff] [blame] | 119 | {% endblock %} |