2021-04-20 21:54:52 +05:30
{% from "erpnext/templates/includes/macros.html" import attribute_filter_section, field_filter_section, discount_range_filters %}
2019-03-19 11:48:32 +05:30
{% extends "templates/web.html" %}
2021-04-20 21:54:52 +05:30
2019-03-19 11:48:32 +05:30
{% block title %}{{ _('Products') }}{% endblock %}
{% block header %}
2021-06-01 12:44:49 +05:30
< div class = "row mb-6" style = "width: 65vw" >
< div class = "mb-6 col-4 order-1" > {{ _('Products') }}< / div >
2019-03-19 11:48:32 +05:30
2021-06-01 12:44:49 +05:30
< div class = "input-group mb-6 col-8 order-2" >
< div class = "dropdown w-100" id = "dropdownMenuSearch" >
< input type = "search" name = "query" id = "search-box" class = "form-control" placeholder = "Search for products..." aria-label = "Product" aria-describedby = "button-addon2" >
<!-- Results dropdown rendered in product_search.js -->
2019-03-19 11:48:32 +05:30
< / div >
< / div >
2021-06-01 12:44:49 +05:30
< / div >
{% endblock header %}
2019-03-19 11:48:32 +05:30
2021-06-01 12:44:49 +05:30
{% block page_content %}
2019-03-19 11:48:32 +05:30
< div class = "row" >
2021-05-17 20:44:41 +05:30
<!-- Items section -->
2021-05-13 01:22:05 +05:30
< div id = "product-listing" class = "col-12 order-2 col-md-9 order-md-2 item-card-group-section" >
<!-- Rendered via JS -->
2019-03-19 11:48:32 +05:30
< / div >
2021-05-13 01:22:05 +05:30
<!-- Filters Section -->
< div class = "col-12 order-1 col-md-3 order-md-1" >
2020-12-24 11:40:33 +05:30
< div class = "collapse d-md-block mr-4 filters-section" id = "product-filters" >
< div class = "d-flex justify-content-between align-items-center mb-5 title-section" >
< div class = "mb-4 filters-title" > {{ _('Filters') }} < / div >
< a class = "mb-4 clear-filters" href = "/all-products" > {{ _('Clear All') }}< / a >
< / div >
2021-04-20 21:54:52 +05:30
<!-- field filters -->
2021-02-19 15:56:52 +05:30
{% if field_filters %}
2021-04-20 21:54:52 +05:30
{{ field_filter_section(field_filters) }}
2021-02-19 15:56:52 +05:30
{% endif %}
2019-03-19 11:48:32 +05:30
2021-04-20 21:54:52 +05:30
<!-- attribute filters -->
2021-02-19 15:56:52 +05:30
{% if attribute_filters %}
2021-04-20 21:54:52 +05:30
{{ attribute_filter_section(attribute_filters) }}
{% endif %}
2019-03-19 11:48:32 +05:30
< / div >
< script >
frappe.ready(() => {
$('.product-filter-filter').on('keydown', frappe.utils.debounce((e) => {
const $input = $(e.target);
const keyword = ($input.val() || '').toLowerCase();
const $filter_options = $input.next('.filter-options');
$filter_options.find('.custom-control').show();
$filter_options.find('.custom-control').each((i, el) => {
const $el = $(el);
const value = $el.data('value').toLowerCase();
if (!value.includes(keyword)) {
$el.hide();
}
});
}, 300));
})
< / script >
< / div >
< / div >
2021-05-13 01:22:05 +05:30
2019-03-19 11:48:32 +05:30
< script >
frappe.ready(() => {
$('.btn-prev, .btn-next').click((e) => {
const $btn = $(e.target);
$btn.prop('disabled', true);
const start = $btn.data('start');
let query_params = frappe.utils.get_query_params();
query_params.start = start;
let path = window.location.pathname + '?' + frappe.utils.get_url_from_dict(query_params);
window.location.href = path;
});
});
< / script >
2020-12-24 11:40:33 +05:30
{% endblock %}