diff --git a/erpnext/website/js/product_category.js b/erpnext/website/js/product_category.js index 04b7e71862b..5296029a5b8 100644 --- a/erpnext/website/js/product_category.js +++ b/erpnext/website/js/product_category.js @@ -5,12 +5,13 @@ erpnext.make_product_categories = function(wrapper) { wrapper.category_list = new wn.widgets.Listing({ parent: $(wrapper).find('.web-side-section').get(0), query: 'select label, count(t2.name) as items, t1.item_group \ - from `tabProduct Group` t1, `tabItem` t2\ + from `tabProduct Group` t1, `tabProduct` t2, tabItem t3\ where t1.parent="Products Settings" \ - and t2.item_group = t1.item_group \ - and ifnull(t2.show_in_website, 0)=1 \ - group by t2.item_group \ - order by t1.idx desc', + and t2.item = t3.name \ + and t3.item_group = t1.item_group \ + and ifnull(t2.published, 0)=1 \ + group by t1.item_group \ + order by t1.idx', hide_refresh: true, render_row: function(parent, data) { parent.innerHTML = repl('%(label)s (%(items)s)', diff --git a/erpnext/website/page/products/products.js b/erpnext/website/page/products/products.js index 0e7dec501b7..f61979b840d 100644 --- a/erpnext/website/page/products/products.js +++ b/erpnext/website/page/products/products.js @@ -54,6 +54,7 @@ erpnext.products.make_product_list = function(wrapper) { t1.page_name, t1.short_description \ from tabProduct t1, tabItem t2 \ where t1.item = t2.name \ + and ifnull(t1.published,0)=1 \ and t2.item_group="%(cat)s" \ and t1.short_description like "%%(searchstr)s%"', args) }, @@ -63,7 +64,7 @@ erpnext.products.make_product_list = function(wrapper) {
%(short_description)s