VirtueMart Forum

VirtueMart 2 + 3 + 4 => Virtuemart Development and bug reports => Topic started by: Ghost on August 29, 2017, 13:07:13 PM

Title: Product count not showing on bulk associate categories page
Post by: Ghost on August 29, 2017, 13:07:13 PM
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.
Title: Re: Product count not showing on bulk associate categories page
Post by: Milbo on August 30, 2017, 09:23:34 AM
Thank you, found and fixed.