PHP Fatal error: Call to a member function displayMediaThumb() on null in /public_html/templates/gk_storefront/html/com_virtuemart/category/default.php on line 230
The issue arises because for some reason, VM devs have changed the way the "Products" property of the view gets loaded, so, to fix this you have to change in templates/gk_storefront/html/com_virtuemart/category/default.php
After defined('_JEXEC') or die('Restricted access'); add this:
- Code: Select all
if(vRequest::getInt('dynamic')){
if (!empty($this->products)) {
if($this->fallback){
$p = $this->products;
$this->products = array();
$this->products[0] = $p;
vmdebug('Refallback');
}
echo shopFunctionsF::renderVmSubLayout($this->productsLayout,array('products'=>$this->products,'currency'=>$this->currency,'products_per_row'=>$this->perRow,'showRating'=>$this->showRating));
}
return ;
}
Search for
- Code: Select all
$BrowseTotalProducts = count($this->products);
and chagne it to
- Code: Select all
$BrowseTotalProducts = count($this->products[0]);
After
- Code: Select all
<div class="browse-view">
<?php
// Show child categories
if (!empty($this->products)) {
Change it to
- Code: Select all
<div class="browse-view">
<?php
// Show child categories
if (!empty($this->products)) {
//revert of the fallback in the view.html.php, will be removed vm3.2
if($this->fallback){
$p = $this->products;
$this->products = array();
$this->products[0] = $p;
vmdebug('Refallback');
}
$BrowseTotalProducts = count($this->products[0]);
For some reason VM devs have loaded all products on the "0" array element of the products view property. Strange, but doing the above solves it!