2019-03-19 11:48:32 +05:30
|
|
|
$(() => {
|
|
|
|
class ProductListing {
|
|
|
|
constructor() {
|
2021-05-17 20:44:41 +05:30
|
|
|
let me = this;
|
2021-05-13 01:22:05 +05:30
|
|
|
let is_item_group_page = $(".item-group-content").data("item-group");
|
2021-05-17 20:44:41 +05:30
|
|
|
this.item_group = is_item_group_page || null;
|
2021-05-13 01:22:05 +05:30
|
|
|
|
2021-06-29 11:22:27 +05:30
|
|
|
let view_type = localStorage.getItem("product_view") || "List View";
|
2021-05-25 01:35:22 +05:30
|
|
|
|
2021-06-01 12:44:49 +05:30
|
|
|
// Render Product Views, Filters & Search
|
2022-02-01 00:03:08 +05:30
|
|
|
new erpnext.ProductView({
|
|
|
|
view_type: view_type,
|
|
|
|
products_section: $('#product-listing'),
|
|
|
|
item_group: me.item_group
|
2021-05-13 01:22:05 +05:30
|
|
|
});
|
|
|
|
|
2021-03-11 21:24:47 +05:30
|
|
|
this.bind_card_actions();
|
2019-03-19 11:48:32 +05:30
|
|
|
}
|
|
|
|
|
2021-03-11 21:24:47 +05:30
|
|
|
bind_card_actions() {
|
2021-08-26 19:14:10 +05:30
|
|
|
erpnext.e_commerce.shopping_cart.bind_add_to_cart_action();
|
|
|
|
erpnext.e_commerce.wishlist.bind_wishlist_action();
|
2021-03-14 17:28:49 +05:30
|
|
|
}
|
2019-03-19 11:48:32 +05:30
|
|
|
}
|
|
|
|
|
|
|
|
new ProductListing();
|
|
|
|
});
|