VirtueMart Forum

VirtueMart 2 + 3 + 4 => Plugins: Payment, Shipment and others => Topic started by: koaconsulting on May 09, 2023, 22:24:47 PM

Title: PayPal payment plugin problems with J4... fixed!!?
Post by: koaconsulting on May 09, 2023, 22:24:47 PM
I've just upgraded a client's site from J3 and VM3 to the latest version of both (4.x).  Things *seemed* to work at first but now I'm realizing that the PayPal Payments Pro feature in the plugin was broken.  Even just logging into the site as a front-end user and viewing the Cart page displays the error "behavior::tooltip not found." which is clearly showing that the plugin was never upgraded to work with J4 as the "behavior.tooltip" functionality has been removed from Joomla.  This tooltip code is at the top of the "creditcardform.php" file in /plugins/vmpayment/paypal/tmpl .  I've tried commenting out that code but then get another error on the next line about using the HTML::script() function being outdated...  I then commented out that function and replaced it with:

vmJsApi::addJScript('components/com_virtuemart/assets/js/vmcreditcard.js');

I was then able to place an order using PayPal Payments Pro.  The issue I faced at that point is if you enter in an incorrect credit card number or expiration date, then you get a 500 Error.  Anyway I was able to fix that by editing the file /plugins/vmpayment/paypal/paypal.php, look for the "redirectToCart()" function and commenting out the redirect code and replacing it with this:

JFactory::getApplication()->enqueueMessage($msg);
$app->redirect('index.php?option=com_virtuemart&view=cart&Itemid=' . vRequest::getInt('Itemid'));

Now both standard and payments pro seem to be working properly.

Hope this helps someone or some variation of this gets integrated into the actual codebase.

PayPal plugin version: 4.0.12
Joomla Version: 4.2.9
VM Version: 4.0.12 10777
Title: Re: PayPal payment plugin problems with J4... fixed!!?
Post by: jenkinhill on May 10, 2023, 11:18:40 AM
Current VirtueMart release is 4.0.20

Current Paypal plugin version is 4.0.16 and uses bootstrap.tooltip  not  behavior.tooltip