VirtueMart Forum

VirtueMart 2 + 3 + 4 => Virtuemart Development and bug reports => Topic started by: mavalentin on May 21, 2020, 12:07:00 PM

Title: router bug appearing with virtueplanet conversion tracking plugin
Post by: mavalentin on May 21, 2020, 12:07:00 PM
Hi, I have installed the third-party plugin Virtueplanet Conversion tracking, which was causing me errors on some Virtuemart pages like the cart and the user. I am using Joomla 3.9.18 and VM 3.8.2.
The third party assistance told me that the error "Call to undefined function vmdebug()" (which changed to "class vmText not found" after the update to VM 3.8 ) is caused by a bug in the virtuemart router, and I was advised to insert the two following lines in components/com_virtuemart/router.php after "defined('DS') or define('DS', DIRECTORY_SEPARATOR);"


JLoader::register('VmConfig', JPATH_ADMINISTRATOR . '/components/com_virtuemart/helpers/config.php');
VmConfig::loadConfig();


This solved the error issue appearing when the VP Conversion Tracking plugin was enabled, but I noticed that with this modification of the router, the languages don't work anymore, in the sense that if I switch the language between italian and english in the cart page or the user profile page, the language doesn't change anymore.

Are you able to tell me if this is a virtuemart bug as I was told, or if I need to further sort this out with Virtueplanet assistance?

The url of the shop is https://sviluppo.viruspower.it/it/negozio-online/profilo , the Conversion tracking plugin is active and I've changed the router.php file as described above, and if you try changing language in the cart or user login page, it will not work.

Thank you
Title: Re: router bug appearing with virtueplanet conversion tracking plugin
Post by: pinochico on May 21, 2020, 12:58:57 PM
I think,

tracking plugin must be refactoring, not router virtuemart :D
That the developers caught up with you so that they don't have to fix it their plugin :)

but we'll wait for someone from the VM DEV team
Title: Re: router bug appearing with virtueplanet conversion tracking plugin
Post by: Milbo on May 22, 2020, 15:36:04 PM
This way is not correct. It works as long you use always the same language. The problem, the router is the first who can know the language by url. Ah I just see you say the language switcher does not work anylonger.

When they use the vmdebug or vmText within their component, then they must include the vmdefines themself. As we do in our systemplugin.


if(!class_exists('VmConfig')) require(VMPATH_ROOT .'/administrator/components/com_virtuemart/helpers/config.php');
VmConfig::loadConfig(false, false, false, false);
Title: Re: router bug appearing with virtueplanet conversion tracking plugin
Post by: mavalentin on May 25, 2020, 21:26:38 PM
Thank you, at the end I was advised by the plugin developer to keep the change in the router.php file of Virtuemart, and adding the (false, false, false, false) parameters to the function call as you said, which solves the issue in switching languages. I am though aware that I will have to re-do this change after Virtuemart updates.