VirtueMart Forum

VirtueMart 2 + 3 + 4 => Installation, Migration & Upgrade => Topic started by: dogmansa on November 25, 2020, 14:51:13 PM

Title: Error after updating to latest version [solved]
Post by: dogmansa on November 25, 2020, 14:51:13 PM
Hi

Am getting the following after updating VM

0 - Call to undefined method VirtueMartCart::getCardCategoryId()

User goes into the site and it looks OK. Soon as they click on a product category this happens. After that, no page on the front end is accessible.

Domain https://www.sqclothing.co.za

Versions

Joomla! 3.9.21

VirtueMart 3.8.6 10373

Would appreciate any help

Thanks
Title: Re: Error after updating to latest version
Post by: Jumbo! on November 25, 2020, 14:55:26 PM
It sounds like a problem of your template. Refer - https://forum.virtuemart.net/index.php?topic=145834.msg518290#msg518290

Open - templates/YOUR-TEMPLATE/html/mod_virtuemart_cart/default.php

Find and remove the following codes -

$category_id = $cart->getCardCategoryId($product->virtuemart_product_id);
Title: Re: Error after updating to latest version
Post by: dogmansa on November 25, 2020, 15:17:17 PM
Wow... Thank you for your speedy response. I will certainly follow your instructions. Much appreciated!! :) :) :) :)
Title: Re: Error after updating to latest version
Post by: dogmansa on November 25, 2020, 15:29:27 PM
Hi

Have looked but no mod_virtuemart_cart folder ... Can I perhaps do a search for getCardCategoryId to see where it's located?
Title: Re: Error after updating to latest version
Post by: Jumbo! on November 25, 2020, 19:26:01 PM
Then you probably be having a 3rd party extension which is generating this issue. First try out by switching to another template.
Title: Re: Error after updating to latest version [solved]
Post by: dogmansa on November 26, 2020, 07:20:42 AM
Good morning

Thank you for your help. I managed to resolve the problem. Found the code on plugins/system/vm2_cart

removed the line as you recommended and the site is back

Many thanks

T
Title: Re: Error after updating to latest version [solved]
Post by: _stu on December 02, 2020, 16:40:40 PM
I had the same problem with CMSMart's Ajax Drop Down Cart for Virtuemart 3.0.0. 
Problem: Everything worked normally until the customer went to the cart. Then all of VirtueMart showed a white screen with only "Error" displayed.

Solution: Turning on debug, I got the same error: Call to undefined method VirtueMartCart::getCardCategoryId().
Disabling either the plugin or the module for CMSMart's Ajax Drop Down Cart for Virtuemart corrected the error, but prevented the drop down cart module from working.
The code that Jumbo! highlighted (mega thanks!) was not in the plugin code; it was in the module code. Location: /modules/mod_virtuemart_ajax_cart/helper.php. Commenting out the single line of code fixed the problem.

Note that there is a newer version 3.0.2, but I don't have access to it at the moment (paid component) to see if it solves this problem.
Title: Re: Error after updating to latest version [solved]
Post by: jstratos on January 04, 2021, 00:39:34 AM
Thanks DogmanSA... it worked also for VM3_cart.php in the plugin/system/vm3_cart folder.
Title: Re: Error after updating to latest version [solved]
Post by: stawebnice on March 19, 2021, 23:31:15 PM
This solution with removing the line
$categoryid = $this->cart->getCardCategoryId($product->virtuemartproductid);
from plugins/system/vm3_cart/vm3_cart.php
.
worked for me so far with all Templatemonster templates but on this site it does remove the error with VM 3.8.8, but then add to cart button stops working completely :(

e.g. here:
https://www.u-car.cz/vysledky-hledani/10426/43/aditiva/do-motoru/metabond-start-stop-spirit-do-3-5t-250ml

and in console I see this error:
POST https://www.u-car.cz/index.php?option=com_virtuemart&nosef=1&view=cart&task=addJS&format=json&lang=cz&Itemid=680   [HTTP/2 500 Internal Server Error 923ms]
Title: Re: Error after updating to latest version [solved]
Post by: GJC Web Design on March 21, 2021, 09:34:15 AM
and the 500 error is?