2016-01-01 11:53:12 +00:00
|
|
|
{% extends "templates/web.html" %}
|
|
|
|
|
2017-03-23 11:18:24 +00:00
|
|
|
{% block title %} {{ _("Shopping Cart") }} {% endblock %}
|
2014-10-21 10:46:30 +00:00
|
|
|
|
2019-03-19 06:18:32 +00:00
|
|
|
{% block header %}<h1>{{ _("Shopping Cart") }}</h1>{% endblock %}
|
2014-10-21 10:46:30 +00:00
|
|
|
|
2019-03-19 06:18:32 +00:00
|
|
|
<!--
|
2016-01-01 11:53:12 +00:00
|
|
|
{% block script %}
|
|
|
|
<script>{% include "templates/includes/cart.js" %}</script>
|
|
|
|
{% endblock %}
|
2019-03-19 06:18:32 +00:00
|
|
|
-->
|
2016-01-01 11:53:12 +00:00
|
|
|
|
2015-09-16 13:22:52 +00:00
|
|
|
|
|
|
|
{% block header_actions %}
|
|
|
|
{% endblock %}
|
|
|
|
|
2016-01-01 11:53:12 +00:00
|
|
|
{% block page_content %}
|
2015-09-11 13:19:59 +00:00
|
|
|
|
2015-09-16 13:22:52 +00:00
|
|
|
{% from "templates/includes/macros.html" import item_name_and_description %}
|
2015-09-11 13:19:59 +00:00
|
|
|
|
2016-05-02 06:13:44 +00:00
|
|
|
<div class="cart-container">
|
2019-03-19 06:18:32 +00:00
|
|
|
<div id="cart-error" class="alert alert-danger" style="display: none;"></div>
|
2016-05-02 06:13:44 +00:00
|
|
|
|
2019-03-19 06:18:32 +00:00
|
|
|
{% if doc.items %}
|
|
|
|
<table class="table table-bordered mt-3">
|
|
|
|
<thead>
|
|
|
|
<tr>
|
|
|
|
<th width="60%">{{ _('Item') }}</th>
|
|
|
|
<th width="20%" class="text-right">{{ _('Quantity') }}</th>
|
|
|
|
{% if cart_settings.enable_checkout %}
|
|
|
|
<th width="20%" class="text-right">{{ _('Subtotal') }}</th>
|
|
|
|
{% endif %}
|
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
<tbody class="cart-items">
|
|
|
|
{% include "templates/includes/cart/cart_items.html" %}
|
|
|
|
</tbody>
|
|
|
|
{% if cart_settings.enable_checkout %}
|
|
|
|
<tfoot class="cart-tax-items">
|
|
|
|
{% include "templates/includes/order/order_taxes.html" %}
|
|
|
|
</tfoot>
|
2016-05-10 11:49:47 +00:00
|
|
|
{% endif %}
|
2019-03-19 06:18:32 +00:00
|
|
|
</table>
|
|
|
|
{% else %}
|
|
|
|
<p class="text-muted">{{ _('Your cart is Empty') }}</p>
|
|
|
|
{% endif %}
|
2016-05-02 06:13:44 +00:00
|
|
|
|
2020-04-07 06:48:47 +00:00
|
|
|
{% if doc.items %}
|
|
|
|
<div class="place-order-container">
|
|
|
|
{% if cart_settings.enable_checkout %}
|
|
|
|
<button class="btn btn-primary btn-place-order" type="button">
|
|
|
|
{{ _("Place Order") }}
|
|
|
|
</button>
|
|
|
|
{% else %}
|
|
|
|
<button class="btn btn-primary btn-request-for-quotation" type="button">
|
|
|
|
{{ _("Request for Quotation") }}
|
|
|
|
</button>
|
|
|
|
{% endif %}
|
|
|
|
</div>
|
|
|
|
{% endif %}
|
|
|
|
|
2019-03-19 06:18:32 +00:00
|
|
|
{% if doc.items %}
|
|
|
|
{% if doc.tc_name %}
|
|
|
|
<div class="terms-and-conditions-link">
|
|
|
|
<a href class="link-terms-and-conditions" data-terms-name="{{ doc.tc_name }}">
|
|
|
|
{{ _("Terms and Conditions") }}
|
|
|
|
</a>
|
|
|
|
<script>
|
|
|
|
frappe.ready(() => {
|
|
|
|
$('.link-terms-and-conditions').click((e) => {
|
|
|
|
e.preventDefault();
|
|
|
|
const $link = $(e.target);
|
|
|
|
const terms_name = $link.attr('data-terms-name');
|
|
|
|
show_terms_and_conditions(terms_name);
|
|
|
|
})
|
|
|
|
});
|
|
|
|
function show_terms_and_conditions(terms_name) {
|
|
|
|
frappe.call('erpnext.shopping_cart.cart.get_terms_and_conditions', { terms_name })
|
|
|
|
.then(r => {
|
|
|
|
frappe.msgprint({
|
|
|
|
title: terms_name,
|
|
|
|
message: r.message
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
</script>
|
2016-05-02 06:13:44 +00:00
|
|
|
</div>
|
2019-03-19 06:18:32 +00:00
|
|
|
{% endif %}
|
2016-05-02 06:13:44 +00:00
|
|
|
|
2019-03-19 06:18:32 +00:00
|
|
|
<div class="cart-addresses mt-5">
|
|
|
|
{% include "templates/includes/cart/cart_address.html" %}
|
|
|
|
</div>
|
|
|
|
{% endif %}
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="row mt-5">
|
|
|
|
<div class="col-12">
|
|
|
|
{% if cart_settings.enable_checkout %}
|
|
|
|
<a href="/orders">
|
|
|
|
{{ _('See past orders') }}
|
|
|
|
</a>
|
|
|
|
{% else %}
|
|
|
|
<a href="/quotations">
|
|
|
|
{{ _('See past quotations') }}
|
|
|
|
</a>
|
2016-05-10 11:49:47 +00:00
|
|
|
{% endif %}
|
2016-05-02 06:13:44 +00:00
|
|
|
</div>
|
2014-10-21 10:46:30 +00:00
|
|
|
</div>
|
|
|
|
|
2019-03-19 06:18:32 +00:00
|
|
|
{% endblock %}
|
2016-06-23 12:55:50 +00:00
|
|
|
|
2019-03-19 06:18:32 +00:00
|
|
|
{% block base_scripts %}
|
|
|
|
<!-- js should be loaded in body! -->
|
|
|
|
<script type="text/javascript" src="/assets/frappe/js/lib/jquery/jquery.min.js"></script>
|
|
|
|
<script type="text/javascript" src="/assets/js/frappe-web.min.js"></script>
|
|
|
|
<script type="text/javascript" src="/assets/js/control.min.js"></script>
|
|
|
|
<script type="text/javascript" src="/assets/js/dialog.min.js"></script>
|
|
|
|
<script type="text/javascript" src="/assets/js/bootstrap-4-web.min.js"></script>
|
2014-10-21 10:46:30 +00:00
|
|
|
{% endblock %}
|