News:

Support the VirtueMart project and become a member

Main Menu

PayPal payment plugin problems with J4... fixed!!?

Started by koaconsulting, May 09, 2023, 22:24:47 PM

Previous topic - Next topic

koaconsulting

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
KOA Consulting is dedicated to providing high quality, professional website design, development, graphic design, Internet marketing, search engine optimization (SEO), and a variety of cutting edge web technologies to our ever-growing client-base. Our long list of satisfied clients extends across the globe.

We specialize in working with the Joomla Content Management System and custom integration of Virtuemart as well. 

Please contact us for all of your custom web design and development needs: www.koaconsulting.com

jenkinhill

Current VirtueMart release is 4.0.20

Current Paypal plugin version is 4.0.16 and uses bootstrap.tooltip  not  behavior.tooltip
Kelvyn
Lowestoft, Suffolk, UK

Retired from forum life November 2023

Please mention your VirtueMart, Joomla and PHP versions when asking a question in this forum