Cancelled Paypal Payment - Cart Empty

  • Posts: 242
  • Thank you received: 0
13 years 10 months ago #6325

Hello Again,

When the Paypal payment option is used and the payment is cancelled on the Paypal site, the cart is emptied. It seems that a better option would be to return to Hikashop checkout process with the cart still intact in case the customer just decided to use a different payment method. If they want to cancel the entire order, they can still do that, but at least they haven't lost their cart contents.

Is there a way to do that? I have the cancel url in the Paypal plugin set to my checkout page, but since the cart is empty, it just goes to the category menu page.

No urgent so please enjoy the weekend!
Ed

Please Log in or Create an account to join the conversation.

  • Posts: 83007
  • Thank you received: 13398
  • MODERATOR
13 years 10 months ago #6326

Hi,


You could comment out the lines:
$cartClass = hikashop::get('class.cart');
$cartClass->delete($order->cart->cart_id);
in the file administrator/components/com_hikashop/classes/order.php
But that modification won't be integrated in HikaShop as most users want to flush the cart once the order is created.

Please Log in or Create an account to join the conversation.

  • Posts: 242
  • Thank you received: 0
13 years 10 months ago #6327

As others, I would want the cart emptied once the order is complete, but when the payment process (Paypal or other) is canceled the order really isn't complete yet. The customer might change their mind and just want to pay by check. In that case, they would have to build their cart again. Another example would be the customer's credit card was not accepted for some reason so they decide to use another available payment option.

Isn't there something in the notification from Paypal that the transaction was either complete or canceled?

Ed

Please Log in or Create an account to join the conversation.

  • Posts: 83007
  • Thank you received: 13398
  • MODERATOR
13 years 10 months ago #6329

Before HikaShop redirects the user to paypal, it has to create the order. Because when paypal sends the payment notification, HikaShop needs to be able to identify the payment notification with the order of the user. The only way to do that is to precreate the order before the user goes to paypal.
Thus, it's not possible to change the payment method afterwards.
When the user returns on the website HikaShop doesn't know the status of the payment. Plus, the user could just not come back to the website after the payment.

If you do the modification I wrote that will keep the cart of the user. Then, you could some similar code in the view after_end which is used when the user comes back (unless you specify a return URL) so that the cart would be flushed at that time.

But, then, if the user pays by check, the cart wouldn't be flushed at the end of the order. So instead of removing the code of the previous post, you should add a check to do it only based on the payment method.

But then, the problem is the same: if the user changes his mind and want to pay by paypal after finishing his checkout and selected check, that's not possible either...

Please Log in or Create an account to join the conversation.

  • Posts: 242
  • Thank you received: 0
13 years 10 months ago #6332

I can see the problems involved. Thanks for your thoughts on the subject.

A little off topic, but I still have the problem of having to hit the Next button twice to move off the Address and Shipping steps (I have each as separate steps). If the page is refreshed first, I think it only takes one click but haven't verified that 100%. After I made some changes to the checkout workflow this morning, I thought the problem had gone away, but it's back.

(same website and login that you were working on yesterday with images overlapping the text)

Thanks,
Ed

Please Log in or Create an account to join the conversation.

  • Posts: 83007
  • Thank you received: 13398
  • MODERATOR
13 years 10 months ago #6333

I'll look at that tomorrow as I won't be available tonight.

Please Log in or Create an account to join the conversation.

  • Posts: 83007
  • Thank you received: 13398
  • MODERATOR
13 years 10 months ago #6413

Hi,

I tried to reproduce the problem on my end but with the same checkout workflow, I didn't get the problem on my end. I don't know what could cause the problem only on your end. I would need again an FTP access in order to put traces in the code since I works fine here.

Please Log in or Create an account to join the conversation.

  • Posts: 242
  • Thank you received: 0
13 years 10 months ago #6414

Thanks for getting back to me on this.

I've been working on it for a couple of hours and always see the problem at the Address step and most of the time I see it at the Shipping step as well. I've tried IE and FF and two or three different users (all on the same PC though).

It seems that most of the time when first going to the Checkout page after a new cart has been created, the cart shows no shipping amount, which seems right since no shipping has been selected yet.

Clicking NEXT causes the page to refresh with shipping shown in the cart.

Clicking NEXT again moves to the Shipping page, which normally requires two clicks as well, even if no changes are made to the shipping options.

The last step (Payment) always seems to work.

You should be able to use the same FTP credentials I sent yesterday. The account was just turned back on so if you have already tried and couldn't get in, please try again.

Regards,
Ed

Please Log in or Create an account to join the conversation.

  • Posts: 83007
  • Thank you received: 13398
  • MODERATOR
13 years 10 months ago #6419

Yes, I experienced the same problems on your website. there must be something.
We'll look at that tomorrow. It's already getting late here.

Please Log in or Create an account to join the conversation.

  • Posts: 242
  • Thank you received: 0
13 years 10 months ago #6420

Thanks for your help. If you are done with FTP for now I'm going to turn it back off. I can easily turn the account back on if you need it again.

Ed

Please Log in or Create an account to join the conversation.

  • Posts: 83007
  • Thank you received: 13398
  • MODERATOR
13 years 10 months ago #6480

Could you turn the FTP access back on ? I wasn't able to access it so I wasn't able to trace down the problem.

Please Log in or Create an account to join the conversation.

  • Posts: 242
  • Thank you received: 0
13 years 10 months ago #6500

Sorry I didn't get back to you right away. I just got back into the office.

FTP is back on.

Thanks
Ed

Please Log in or Create an account to join the conversation.

  • Posts: 242
  • Thank you received: 0
13 years 10 months ago #6501

Sorry I didn't get back to you right away. I just got back into the office.

FTP is back on.

Thanks
Ed

Please Log in or Create an account to join the conversation.

  • Posts: 83007
  • Thank you received: 13398
  • MODERATOR
13 years 10 months ago #6538

Hi,

The problem lies in the fact that you are already logged in with a checkout workflow in several steps with the login on a different step that the address.
That's something really rare as most users will keep the login and address step on the same view.
I changed the line:
$user_id = $app->getUserState( HIKASHOP_COMPONENT.'.user_id',0 );
to:
$user_id = hikashop::loadUser();
in the file components/com_hikashop/controllers/checkout.php in the function before_address in order to fix the problem.
It will be included in next release of HikaShop.

Please Log in or Create an account to join the conversation.

  • Posts: 242
  • Thank you received: 0
13 years 10 months ago #6571

Well, if there is something that most users would never do, I'll probably stumble on it at some point. Is there a way to go in and clear out processes that are left unfinished? While testing I am often logged in with the same username in more than one browser instance and/or browser, so from your post, are you saying that should not cause a problem in the future?

Ed

Please Log in or Create an account to join the conversation.

  • Posts: 83007
  • Thank you received: 13398
  • MODERATOR
13 years 10 months ago #6574

Yes. The problem is now fixed.

Please Log in or Create an account to join the conversation.

  • Posts: 228
  • Thank you received: 8
7 years 9 months ago #265212

Hello,

I know this is a very old post and sorry to revive it but I've encountered this issue in one of my websites. It seems that after returning to the checkout from any of my payment methods the cart is zeroed. I guess this issue was resolved by now as I have another website with Hikashop which works just fine and keeps the cart intact.

Would you have any idea on what could cause this?

Thank you in advance,


Never mind, found the "Clean cart when order is" option. Sorry about that.

Last edit: 7 years 9 months ago by theguy. Reason: Solved

Please Log in or Create an account to join the conversation.

Time to create page: 0.098 seconds
Powered by Kunena Forum