Perhaps this forum thread may help you to fix related issues on your websites:
https://forum.x-cart.com/showthread.php?t=74006
When you face the "Call to a member function ....{your function name there}.... on a non-object", you should
1) locate the place where it is called in your custom module/theme
2) use \XLite\Logger::logCustom('debug', var_export($your_variable_name, true)); line to print the structure of the variable that triggers the error
3) replace the broken method call with getting the value from the array key that seems to be related to that method (for instance, "$c->getCategoryId()" => "$c['id']").