Product count not showing on bulk associate categories page

Started by Ghost, August 29, 2017, 13:07:13 PM

Previous topic - Next topic

Ghost

Getting PHP notice and product count is not shown on bulk associate categories page.

QuoteNotice: Undefined property: stdClass::$productcount in /public_html/administrator/components/com_virtuemart/views/category/tmpl/default.php on line 166

The issue was caused by this commit https://dev.virtuemart.net/projects/virtuemart/repository/diff/branches/com_virtuemart.3.0.12.4/administrator/components/com_virtuemart/views/category?utf8=%E2%9C%93&rev=9592&rev_to=9585.

Just need to add product count to /administrator/components/com_virtuemart/views/product/view.html.php (because massxref loads category template but uses data from product view):

foreach($this->categories as $i=>$c){
$this->categories[$i]->productcount = $catmodel->countProducts($this->categories[$i]->virtuemart_category_id);
}


VM 3.2.4, J! 3.7.5, PHP 7.0.21.

Milbo

Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/