Jump to content
cupidare

paypal returns to empty shopping cart

Recommended Posts

Hello, 

I installed a fresh the (latest bs-) oscommerce and configured Paypal. Everything is working (order is processed, order status set, email send) but Paypal returns to an empty cart. 

Of course I added PDT, set checkout_process in the return url

(Indeed, if the PDT is not entered into the configuration, the checkout_process doesn't load at all with an error). 

 

I have no idea how to proceed. the only way the checkout confirmation.php is shown is when changing

 

checkout_process.php;

// if there is nothing in the customers cart, redirect them to the shopping cart page
  if ($cart->count_contents() < 1) {
    // tep_redirect(tep_href_link('shopping_cart.php'));  }
    tep_redirect(tep_href_link('checkout_success.php'));  }

But this should not be the right way. It seems that the cart is emptied somewhere and then forwarding the user to the empty cart. 

Any hints? Thank you!

Share this post


Link to post
Share on other sites

Thank you for your reply

I am using the paypal app of course. 

the error is in my opinion in includes/modules/payment/paypal_standard.php

    function after_process() {
      global $cart;

      $cart->reset(true);

// unregister session variables used during checkout
      tep_session_unregister('sendto');
      tep_session_unregister('billto');
      tep_session_unregister('shipping');
      tep_session_unregister('payment');
      tep_session_unregister('comments');

      tep_session_unregister('cart_PayPal_Standard_ID');

      //wrong
	  //tep_redirect(tep_href_link('checkout_process.php', '', 'SSL'));
      //right
	  tep_redirect(tep_href_link('checkout_success.php', '', 'SSL'));
    }

It should be changed in the git-respository

Share this post


Link to post
Share on other sites

i'm running 2.3.4 BS Gold, and the tep_redirect points to checkout_success.php.

My paypal version is app v5.018

What version are you using?


osC BS gold live - osC CE in development (awesome)

Share this post


Link to post
Share on other sites

it only affects the out-of-the-box bs installation... 

As far as I know v5.018 is not really official bs-compatible. It seems that the patches are still pushed out in the "old-fashion"

After this tiny change everything works well for me

Edited by cupidare

Share this post


Link to post
Share on other sites

The official includes/modules/payment/paypal_standard.php from https://github.com/haraldpdl/oscommerce2/blob/23/catalog/includes/modules/payment/paypal_standard.php shows

    function after_process() {
      global $cart;

      $cart->reset(true);

// unregister session variables used during checkout
      tep_session_unregister('sendto');
      tep_session_unregister('billto');
      tep_session_unregister('shipping');
      tep_session_unregister('payment');
      tep_session_unregister('comments');

      tep_session_unregister('cart_PayPal_Standard_ID');

      tep_redirect(tep_href_link(FILENAME_CHECKOUT_SUCCESS, '', 'SSL'));
    }

So it looks like an error in the Bootstrap version


Let's make things easier for new osCommerce users http://forums.oscommerce.com/topic/402638-discussion-about-hard-coded-database-tables/?p=1718900  Getting there with osCommerce 2.4! :thumbsup:

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×