Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

paypal returns to empty shopping cart


cupidare

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!

Link to comment
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

Link to comment
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 CE live - developing osC Phoenix adding modules with no core changes(awesome and easy!)

Link to comment
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
Link to comment
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

osCommerce user since 2003! :thumbsup:

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...