Post by skyer2000 » Fri Jul 17, 2009 10:34 am

Just downloaded a fresh copy of OpenCart and ran into a problem when "Confirm Order" is clicked.

It will pop up alerts with the error codes, however if the information is correct, or no error is found, nothing happens, other than the paypal account showing "Payment Received". Here is the code in question, in view/theme/default/template/paypal_direct.tpl

Code: Select all

<script type="text/javascript"><!--
function confirmSubmit() {
	$.ajax({
		type: 'POST',
		url: 'index.php?route=payment/paypal_direct/send',
		data: $('#paypal :input'),
		dataType: 'json',
		success: function(data) {
			if (data.error) {
				alert(data.error);
			}
			
			if (data.success) {
				alert("success2");
				location = 'index.php?route=checkout/success';
			}
		}
	});
}
//--></script>
I put the "success2" in there just to see if it will pop up, but it never does. It should though since the payments are being received on my PayPal test account, as "Payment Received From" with the payment status of "Under Review". What also worries me is that the orders never show up on the admin panel, but I believe this is because I'm using tester accounts in Paypal Sandbox.

To try and fix this I changed the code to the following:

Code: Select all

.........
			if (data.error) {
				alert(data.error);
			}else {
				alert("success2");
				location = 'index.php?route=checkout/success';
			}
..........
Then it shows the alert then redirects, like I would expect it to. Are there any concerns about doing it this way? Or is this a better way to modify this so users will be correctly forwarded to the confirmation page?

New member

Posts

Joined
Fri Jul 17, 2009 10:27 am

Post by Daniel » Sat Jul 18, 2009 10:21 am

a few people have reported a problewm with paypal directo but i don;t know why.

what browser are you using?

OpenCart®
Project Owner & Developer.


User avatar
Administrator

Posts

Joined
Fri Nov 03, 2006 6:57 pm

Post by skyer2000 » Sat Jul 18, 2009 1:30 pm

Testing on IE8 and Firefox 3.5, same results.

When you fire the success function, are you sure 'data.success' is the correct variable to look for in the if statement?

New member

Posts

Joined
Fri Jul 17, 2009 10:27 am

Post by Daniel » Mon Jul 20, 2009 1:53 am

post a link to your site please.

OpenCart®
Project Owner & Developer.


User avatar
Administrator

Posts

Joined
Fri Nov 03, 2006 6:57 pm

Post by skyer2000 » Mon Jul 20, 2009 8:06 am

edited
Last edited by skyer2000 on Mon Jul 20, 2009 8:45 am, edited 1 time in total.

New member

Posts

Joined
Fri Jul 17, 2009 10:27 am

Post by Daniel » Mon Jul 20, 2009 8:28 am

can u pm me your admin details?

OpenCart®
Project Owner & Developer.


User avatar
Administrator

Posts

Joined
Fri Nov 03, 2006 6:57 pm
Who is online

Users browsing this forum: No registered users and 1 guest