VirtueMart Forum

VirtueMart 2 + 3 => Plugins: Payment, Shipment and others => Topic started by: PaulLye on March 11, 2020, 22:21:42 pm

Title: Cart not diverting to PayPal redirect to home page
Post by: PaulLye on March 11, 2020, 22:21:42 pm
Changed server (Checked with hosting and the errors are pointing to VM) When adding items to cart in VM then select payment it brings up "Please wait redirecting to PayPal" all good to this point but then diverts to home page. My site s running Joomla 3.9.16 PHP 7.3 Virtuemart 3.6.10 PayPal standard is the payment plugin. Testing this after being diverted to the home page if I delete browsing history front end then select the home page it takes me to PayPal payment page!
Has anyone experience this problem and if so how to fix?
Title: Re: Cart not diverting to PayPal redirect to home page
Post by: GJC Web Design on March 11, 2020, 22:59:24 pm
Its a very simple redirect ..

just submits the form

           jQuery(document).ready(function($){
               jQuery("body").addClass("vmLoading");
              var msg="'.$msg.'";
               jQuery("body").append("<div class=\"vmLoadingDiv\"><div class=\"vmLoadingDivMsg\">"+msg+"</div></div>");
             jQuery("#vmPaymentForm").submit();
         })

so switch the paypal debug on and check all the form elements are correctly set and the form action correct
Title: Re: Cart not diverting to PayPal redirect to home page
Post by: PaulLye on March 13, 2020, 06:06:36 am
The paypal error report is not showing any problems see attached screenshot.
Title: Re: Cart not diverting to PayPal redirect to home page
Post by: GJC Web Design on March 13, 2020, 09:15:25 am
and when u subsequently submit it?

check the console Network tab for progress etc
Title: Re: Cart not diverting to PayPal redirect to home page
Post by: PaulLye on March 13, 2020, 09:29:10 am
I'm looking at the processes, is there something I should see that tells me there is a problem? see screenshots.
Title: Re: Cart not diverting to PayPal redirect to home page
Post by: PaulLye on March 13, 2020, 09:37:31 am
Here is second screenshot
Title: Re: Cart not diverting to PayPal redirect to home page
Post by: GJC Web Design on March 13, 2020, 10:41:50 am
its a simple JS triggered form submit .. nothing complex

so check if the JS is working, if the form will submit when halted by the debug etc etc
Title: Re: Cart not diverting to PayPal redirect to home page
Post by: PaulLye on March 14, 2020, 08:37:21 am
This is the error showing when it diverts to home page when submitted. Does this help to show where to fix or what is causing this problem?
Title: Re: Cart not diverting to PayPal redirect to home page
Post by: GJC Web Design on March 14, 2020, 10:59:37 am
have u tried the basic stuff like using the base template Protostar or beez?

seeing a load time of nearly 6 seconds and a payload of +6MB would be ringing alarm bells for me
Title: Re: Cart not diverting to PayPal redirect to home page
Post by: PaulLye on March 14, 2020, 23:03:39 pm
Yes that was the first thing I did still divert to home page.
Title: Re: Cart not diverting to PayPal redirect to home page
Post by: GJC Web Design on March 15, 2020, 10:21:20 am
Out of ideas -- needs some live site investigation
Title: Re: Cart not diverting to PayPal redirect to home page
Post by: jjk on March 15, 2020, 13:39:23 pm
Did you try already to unpublish your jch-optimize and purge all it's cached pages?
Title: Re: Cart not diverting to PayPal redirect to home page
Post by: PaulLye on March 15, 2020, 21:16:31 pm
I have tried un-publishing all extensions that could conflict with normal site running including jch-optimize and no difference. Also prior to change of hosting all extensions like jch were already installed and the site was working fine.

Please let me know if you require to Admin I can send password details? 
Title: Re: Cart not diverting to PayPal redirect to home page
Post by: GJC Web Design on March 15, 2020, 23:10:28 pm
Changed host?

Didn't see that bit .. well .. worked before - changed hosts - stopped working - everyone else's on the planet is working - conclusion?
Title: Re: Cart not diverting to PayPal redirect to home page
Post by: PaulLye on March 15, 2020, 23:27:38 pm
I should have clarified a bit more, I didn't change hosting companies I change the type of hosting platform. I went from a VPS server to a shared server, I asked my the hosting company to check errors and their reply was no hosting errors but errors pointing to VirtueMart. Hence why I am here!   
Title: Re: Cart not diverting to PayPal redirect to home page
Post by: jjk on March 15, 2020, 23:31:44 pm
I'm out of ideas, too. Did you check already, if the same happens with the Beez3 or Prototype template? I guess you are using the T3 framework, but it's difficult to see what's loaded if jch-optimize is active. Maybe look into your error.logs?
Title: Re: Cart not diverting to PayPal redirect to home page
Post by: lumis on March 16, 2020, 03:39:28 am
I would check your old VPS php.ini settings for things like memory or max_input or whatever you might be using excess resources of. In a shared environment, you are only allocated basic resources, some of which you can manually increase via php.ini files. This may cause unexpected results, and you may now have lower limits on some settings than you did before when everything worked correctly.
Title: Re: Cart not diverting to PayPal redirect to home page
Post by: GJC Web Design on March 16, 2020, 09:39:07 am
what are the specs of your new hosting? -- I like to run VM on +256MB memory for best results
Title: Re: Cart not diverting to PayPal redirect to home page
Post by: PaulLye on March 16, 2020, 10:00:01 am
Just looking at settings of PHP ini 512M is the memory limit, max_execution_time 90, max_input_time 90, max_input_vars 1420, post_max_size 128M, upload_max_filesize 64M
The errors are attached
Title: Re: Cart not diverting to PayPal redirect to home page
Post by: jenkinhill on March 16, 2020, 10:51:34 am
wp-admin  wordpress ???
Title: Re: Cart not diverting to PayPal redirect to home page
Post by: PaulLye on March 16, 2020, 12:04:45 pm
Please have a look at the first post I made
Title: Re: Cart not diverting to PayPal redirect to home page
Post by: Jörgen on March 16, 2020, 14:32:56 pm
Changed server (Checked with hosting and the errors are pointing to VM) When adding items to cart in VM then select payment it brings up "Please wait redirecting to PayPal" all good to this point but then diverts to home page. My site s running Joomla 3.9.16 PHP 7.3 Virtuemart 3.6.10 PayPal standard is the payment plugin. Testing this after being diverted to the home page if I delete browsing history front end then select the home page it takes me to PayPal payment page!
Has anyone experience this problem and if so how to fix?

Your first post does not explain why You have wp-admin and wordpress errors on the same URL ??

Are these errors from the correct install ?

Jörgen @ Kreativ Fotografi
Title: Re: Cart not diverting to PayPal redirect to home page
Post by: GJC Web Design on March 16, 2020, 14:57:39 pm
I also don't think any errors will appear here .. the paypal plugin JS is trying to post a simple html form to paypal.com

You have still never answered what happens when you manually post the form from the debug
Title: Re: Cart not diverting to PayPal redirect to home page
Post by: PaulLye on March 16, 2020, 22:05:02 pm
Sorry I misunderstood. When I test the payment plugin I cannot see the error. How do you find the error loading when testing at inspect page?
Title: Re: Cart not diverting to PayPal redirect to home page
Post by: jjk on March 17, 2020, 00:52:13 am
More guesses:
Your template JD Boston claims: "JD Boston has inbuilt Virtuemart Integration that allows you to create highly functional and responsive online store". Sounds to me like it contains custom features, which might not be compatible with the latest VirtueMart version. According to the changelog of the free version it was last tested with Joomla 3.9.12 and VirtueMart 3.6.2. In case of doubt, ask the developer if it's tested with the latest VirtueMart.

In my Firefox inspector I noticed that you probably have a 'lazyload' plugin enabled. Check if switching it off helps.
Also I noticed K2 stuff, which you probably don't need. And perhaps temporarily disable the slideshow to check if it makes a difference.
Title: Re: Cart not diverting to PayPal redirect to home page
Post by: PaulLye on March 17, 2020, 01:29:36 am
Thank you, I will ask the developer of JD Boston. I have tried disabling Lazyload and I had turned of K2 store neither made a difference. If I cannot sort this out soon I will start with a fresh temple and start over as I cannot afford to have the site not working.
Title: Re: Cart not diverting to PayPal redirect to home page
Post by: GJC Web Design on March 17, 2020, 10:42:53 am
I am still not clear what happens when u have Paypal debug on?

The page loads with all the relevant info and a large button to click to go further to Paypal .. does this work?
Do u go to paypal or back to the home page?

If homepage then u have some sort of redirect that is preventing u going to Paypal .. if Paypal then u have some sort of JS problem that is not submitting the form

Have u tried http://dev.virtuemart.net/attachments/1243/VirtueMart3.6.10_Joomla_3.9.13-Stable-Full_Package.zip ?
Throw it in a subfolder and see if it works..

The most suspicious part is u say it worked as a VPS and now doesn't as a shared .. so I think this points to the host