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 | |
prssanna | b00eb1b | 2021-01-20 17:52:54 +0530 | [diff] [blame] | 5 | {% block header %}<h3 class="shopping-cart-header mt-2 mb-6">{{ _("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 | |
prssanna | b00eb1b | 2021-01-20 17:52:54 +0530 | [diff] [blame] | 21 | {% if doc.items %} |
Kanchan Chauhan | 239b351 | 2016-05-02 11:43:44 +0530 | [diff] [blame] | 22 | <div class="cart-container"> |
prssanna | b00eb1b | 2021-01-20 17:52:54 +0530 | [diff] [blame] | 23 | <div class="row m-0"> |
marination | 53bb7a9 | 2021-05-27 18:53:11 +0530 | [diff] [blame] | 24 | <div class="col-md-8 frappe-card p-5 mb-4"> |
prssanna | b00eb1b | 2021-01-20 17:52:54 +0530 | [diff] [blame] | 25 | <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> |
marination | 53bb7a9 | 2021-05-27 18:53:11 +0530 | [diff] [blame] | 33 | <th class="item-column">{{ _('Item') }}</th> |
prssanna | b00eb1b | 2021-01-20 17:52:54 +0530 | [diff] [blame] | 34 | <th width="20%">{{ _('Quantity') }}</th> |
| 35 | {% if cart_settings.enable_checkout %} |
marination | 53bb7a9 | 2021-05-27 18:53:11 +0530 | [diff] [blame] | 36 | <th width="20" class="text-right column-sm-view">{{ _('Subtotal') }}</th> |
prssanna | b00eb1b | 2021-01-20 17:52:54 +0530 | [diff] [blame] | 37 | {% endif %} |
marination | 53bb7a9 | 2021-05-27 18:53:11 +0530 | [diff] [blame] | 38 | <th width="10%" class="column-sm-view"></th> |
prssanna | b00eb1b | 2021-01-20 17:52:54 +0530 | [diff] [blame] | 39 | </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> |
marination | 53bb7a9 | 2021-05-27 18:53:11 +0530 | [diff] [blame] | 51 | |
| 52 | <div class="row mt-2"> |
| 53 | <div class="col-3"> |
prssanna | b00eb1b | 2021-01-20 17:52:54 +0530 | [diff] [blame] | 54 | {% if cart_settings.enable_checkout %} |
marination | aca3c8f | 2021-06-08 19:40:26 +0530 | [diff] [blame] | 55 | <a class="btn btn-outline-primary font-md" href="/orders"> |
marination | 53bb7a9 | 2021-05-27 18:53:11 +0530 | [diff] [blame] | 56 | {{ _('Past Orders') }} |
| 57 | </a> |
prssanna | b00eb1b | 2021-01-20 17:52:54 +0530 | [diff] [blame] | 58 | {% else %} |
marination | aca3c8f | 2021-06-08 19:40:26 +0530 | [diff] [blame] | 59 | <a class="btn btn-outline-primary font-md" href="/quotations"> |
marination | 53bb7a9 | 2021-05-27 18:53:11 +0530 | [diff] [blame] | 60 | {{ _('See past quotations') }} |
| 61 | </a> |
prssanna | b00eb1b | 2021-01-20 17:52:54 +0530 | [diff] [blame] | 62 | {% endif %} |
| 63 | </div> |
marination | 53bb7a9 | 2021-05-27 18:53:11 +0530 | [diff] [blame] | 64 | <div class="col-9"> |
prssanna | b00eb1b | 2021-01-20 17:52:54 +0530 | [diff] [blame] | 65 | {% if doc.items %} |
| 66 | <div class="place-order-container"> |
marination | aca3c8f | 2021-06-08 19:40:26 +0530 | [diff] [blame] | 67 | <a class="btn btn-primary-light mr-2 font-md" href="/all-products"> |
marination | 53bb7a9 | 2021-05-27 18:53:11 +0530 | [diff] [blame] | 68 | {{ _('Back to Shop') }} |
Anupam | d7f4aef | 2021-02-05 16:17:20 +0530 | [diff] [blame] | 69 | </a> |
prssanna | b00eb1b | 2021-01-20 17:52:54 +0530 | [diff] [blame] | 70 | {% if cart_settings.enable_checkout %} |
marination | aca3c8f | 2021-06-08 19:40:26 +0530 | [diff] [blame] | 71 | <button class="btn btn-primary btn-place-order font-md" type="button"> |
marination | 53bb7a9 | 2021-05-27 18:53:11 +0530 | [diff] [blame] | 72 | {{ _('Place Order') }} |
prssanna | b00eb1b | 2021-01-20 17:52:54 +0530 | [diff] [blame] | 73 | </button> |
| 74 | {% else %} |
marination | aca3c8f | 2021-06-08 19:40:26 +0530 | [diff] [blame] | 75 | <button class="btn btn-primary btn-request-for-quotation font-md" type="button"> |
marination | 53bb7a9 | 2021-05-27 18:53:11 +0530 | [diff] [blame] | 76 | {{ _('Request for Quotation') }} |
prssanna | b00eb1b | 2021-01-20 17:52:54 +0530 | [diff] [blame] | 77 | </button> |
| 78 | {% endif %} |
| 79 | </div> |
| 80 | {% endif %} |
| 81 | </div> |
| 82 | </div> |
Faris Ansari | 5f8b358 | 2019-03-19 11:48:32 +0530 | [diff] [blame] | 83 | |
Kanchan Chauhan | 1d79f35 | 2016-05-10 17:19:47 +0530 | [diff] [blame] | 84 | |
prssanna | b00eb1b | 2021-01-20 17:52:54 +0530 | [diff] [blame] | 85 | {% 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) { |
marination | 22f41a1 | 2021-02-25 13:56:38 +0530 | [diff] [blame] | 101 | frappe.call('erpnext.e_commerce.shopping_cart.cart.get_terms_and_conditions', { terms_name }) |
prssanna | b00eb1b | 2021-01-20 17:52:54 +0530 | [diff] [blame] | 102 | .then(r => { |
| 103 | frappe.msgprint({ |
| 104 | title: terms_name, |
| 105 | message: r.message |
| 106 | }); |
| 107 | }); |
| 108 | } |
| 109 | </script> |
| 110 | </div> |
Vishal Dhayagude | 24e79b1 | 2020-04-07 12:18:47 +0530 | [diff] [blame] | 111 | {% endif %} |
| 112 | </div> |
Vishal Dhayagude | 24e79b1 | 2020-04-07 12:18:47 +0530 | [diff] [blame] | 113 | |
prssanna | b00eb1b | 2021-01-20 17:52:54 +0530 | [diff] [blame] | 114 | <div class="col-md-4"> |
| 115 | <div class="cart-addresses"> |
| 116 | {% include "templates/includes/cart/cart_address.html" %} |
| 117 | </div> |
Kanchan Chauhan | 239b351 | 2016-05-02 11:43:44 +0530 | [diff] [blame] | 118 | </div> |
prssanna | b00eb1b | 2021-01-20 17:52:54 +0530 | [diff] [blame] | 119 | {% endif %} |
Faris Ansari | 5f8b358 | 2019-03-19 11:48:32 +0530 | [diff] [blame] | 120 | </div> |
Faris Ansari | 5f8b358 | 2019-03-19 11:48:32 +0530 | [diff] [blame] | 121 | </div> |
prssanna | b00eb1b | 2021-01-20 17:52:54 +0530 | [diff] [blame] | 122 | {% 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 Ansari | 5f8b358 | 2019-03-19 11:48:32 +0530 | [diff] [blame] | 130 | {{ _('See past orders') }} |
| 131 | </a> |
| 132 | {% else %} |
prssanna | b00eb1b | 2021-01-20 17:52:54 +0530 | [diff] [blame] | 133 | <a class="btn btn-outline-primary" href="/quotations"> |
Faris Ansari | 5f8b358 | 2019-03-19 11:48:32 +0530 | [diff] [blame] | 134 | {{ _('See past quotations') }} |
| 135 | </a> |
prssanna | b00eb1b | 2021-01-20 17:52:54 +0530 | [diff] [blame] | 136 | {% endif %} |
Rushabh Mehta | 3daa49a | 2014-10-21 16:16:30 +0530 | [diff] [blame] | 137 | </div> |
prssanna | b00eb1b | 2021-01-20 17:52:54 +0530 | [diff] [blame] | 138 | {% endif %} |
Rushabh Mehta | 3daa49a | 2014-10-21 16:16:30 +0530 | [diff] [blame] | 139 | |
Faris Ansari | 5f8b358 | 2019-03-19 11:48:32 +0530 | [diff] [blame] | 140 | {% endblock %} |
Rushabh Mehta | a334062 | 2016-06-23 18:25:50 +0530 | [diff] [blame] | 141 | |
Faris Ansari | 5f8b358 | 2019-03-19 11:48:32 +0530 | [diff] [blame] | 142 | {% block base_scripts %} |
| 143 | <!-- js should be loaded in body! --> |
Faris Ansari | 464d838 | 2021-05-07 14:53:42 +0530 | [diff] [blame] | 144 | {{ include_script("frappe-web.bundle.js") }} |
| 145 | {{ include_script("controls.bundle.js") }} |
| 146 | {{ include_script("dialog.bundle.js") }} |
Rushabh Mehta | 3daa49a | 2014-10-21 16:16:30 +0530 | [diff] [blame] | 147 | {% endblock %} |