Hello,
i have installed virtuemart 3.8.6 and i have this error : 0 - Call to undefined method VirtueMartCart::getCardCategoryId()
My mod_virtuemart_cart.php file
<?php
defined('_JEXEC') or die( 'Direct Access to '.basename(__FILE__).' is not allowed.' );
/*
* Best selling Products module for VirtueMart
* @version $Id: mod_virtuemart_category.php 1160 2014-05-06 20:35:19Z milbo $
* @package VirtueMart
* @subpackage modules
*
* @copyright (C) 2011-2015 The Virtuemart Team
*
*
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
* VirtueMart is Free Software.
* VirtueMart comes with absolute no warranty.
*
* www.virtuemart.net
*----------------------------------------------------------------------
* This code creates a list of the bestselling products
* and displays it wherever you want
*----------------------------------------------------------------------
*/
defined('DS') or define('DS', DIRECTORY_SEPARATOR);
if (!class_exists( 'VmConfig' )) require(JPATH_ROOT.DS.'administrator'.DS.'components'.DS.'com_virtuemart'.DS.'helpers'.DS.'config.php');
VmConfig::loadConfig();
VmConfig::loadJLang('mod_virtuemart_category_tf', true);
vmJsApi::jQuery();
vmJsApi::cssSite();
/* Setting */
$categoryModel = VmModel::getModel('Category');
$category_id = $params->get('Parent_Category_id', 0);
$class_sfx = $params->get('class_sfx', '');
$moduleclass_sfx = $params->get('moduleclass_sfx','');
$layout = $params->get('layout','default');
$active_category_id = vRequest::getInt('virtuemart_category_id', '0');
$vendorId = '1';
$enable = $params->get('enable_tolltips', 0);
$enableimg = $params->get('enable_images', 0);
$xOffset = $params->get ('row_xOffset', 50);
$yOffset = $params->get ('row_yOffset', -150);
$categories = $categoryModel->getChildCategoryList($vendorId, $category_id);
// We dont use image here
//$categoryModel->addImages($categories);
if(empty($categories)) return false;
$level = $params->get('level','2');
//print_r($level);
if($level>1){
foreach ($categories as $i => $category) {
$categories[$i]->childs = $categoryModel->getChildCategoryList($vendorId, $category->virtuemart_category_id) ;
// No image used here
//$categoryModel->addImages($category->childs);
//Yehyeh, very cheap done.
if($level>2){
foreach ($categories[$i]->childs as $j => $cat) {
$categories[$i]->childs[$j]->childs = $categoryModel->getChildCategoryList( $vendorId, $cat->virtuemart_category_id );
}
}
}
}
//vmdebug('my categories',$categories);
$parentCategories = $categoryModel->getCategoryRecurse($active_category_id,0);
/* Load tmpl default */
require(JModuleHelper::getLayoutPath('mod_virtuemart_category_tf',$layout));
?>
Thank you for your help.
remove the function call getCardCategoryId()
this is not used now
Thank you Jhon for your answer. Indeed i delete this function in vm2_cart plugin and now it's work fine :)
Excellent
Hi because i have the same problem could you please tell me where to find the fuction and delete it ( the path)??? I use vp onepage checkout plugin.
connect to ftp by terminal and use function grep for find function in code
It will be in an old 3rd party extension as this function is no longer in the VM core.. it used to be in the cart helper
thank you all for your responses. I erase line 6 $category_id = $cart->getCardCategoryId($product->virtuemart_product_id);
in html/mod_virtuemart_cart/default.php and now everything works fine. Thanks again
Quote from: afentiko2000 on November 23, 2020, 15:32:15 PM
Hi because i have the same problem could you please tell me where to find the fuction and delete it ( the path)??? I use vp onepage checkout plugin.
This has no relation with VP One Page Checkout plugin. The plugin is fully compatible to VirtueMart 3.8.6.
It is a problem with VM cart module's layout override in your template.
I got confused by this - the OP wrote My mod_virtuemart_cart.php file but then shows the code of mod_virtuemart_category.php
Would be good to know which template contains the module overrides with the code error. It's likely to cause problems for other users.
Hi,
i know this is an old thread but for anyone looking for answers:
I could not find the function getCardCategoryId in the template/html/mod_virtuemart_cart/default.php
What i did was to change the language from norwegian to english and it worked again. Maybe there was a lack of translations in the norwegian file that was the cause of this... ? Anyways the english file was 100% translated and worked.
Correction: it did not after all help with the language file. But what did help was to change the joomla standard template to the home3 newly installed template.
Therefore -- as explained above .. your template has an old over ride which is still calling the now deleted function getCardCategory()