Page 1 of 1

Checkout gets stuck on the 'Payment Method' section

Posted: Thu May 24, 2018 7:11 pm
by VividImage
There is a quite serious bug in module: payment_method.php (OpenCartInstallFolder/catalog/controller/checkout/payment_method.php)

This bug manifests itself only when Registering a New Customer Account and then Reviewing the Shopping Cart, i.e. it will not happen when pressing 'Checkout' directly - one must first click on the 'Shopping Cart' link in the upper toolbar or on the black Cart Button, then 'View Cart' link (again, if one clicks on the black Cart Button, then on the 'Checkout' link within, without reviewing the cart, the bug won't be triggered). Also it happens irregularly, in about 50-75% of cases on average.

After agreeing to Terms & Conditions and pressing the 'Continue' button, OpenCart gets stuck on the 'Payment Method' with the error message "Warning: Payment method required!" even though the payment method is pre-selected.

I have firstly thought that this is caused by a lack of the second radio button choice (as I have started getting this error with only a single Payment Provider). But as you can see from the attached screenshot, it happens even with the two Payment Providers and two Radio Buttons to choose from.

The bug is triggered on the line:

elseif (!isset($this->session->data['payment_methods'][$this->request->post['payment_method']]))
$json['error']['warning'] = $this->language->get('error_payment');

Therefore $this->session->data['payment_methods'] is not set. (second part, i.e. $this->request->post['payment_method'] seems to be fine).

Any suggestions how to fix this, i.e. stopping $this->session->data['payment_methods'] losing its value ?

Re: Checkout gets stuck on the 'Payment Method' section

Posted: Fri May 25, 2018 2:17 am
by Qphoria
Are you using IE or Edge? This is not likely an issue with the php code in that file.
This is a known issue with either of those two browsers because of the ajax cache during checkout ... rer-cache/

The easiest solution for this is to edit catalog/view/theme/YOURTHEME/template/checkout/checkout.tpl or checkout.twig


Code: Select all


Code: Select all

$.ajax({ cache: false,
That should fix it. We'll need to find a more proper permanent fix for this in the core.

Re: Checkout gets stuck on the 'Payment Method' section

Posted: Tue Jun 12, 2018 3:28 am
by mdchun86
I seem to be having a similar issue but is happening on Google chrome mobile. Whenever selecting register account and then reviewing cart, the customer will get redirected back to select register account or guest checkout after putting in payment info. I have sent you a message Qphoria to see if you can help with this.

Re: Checkout gets stuck on the 'Payment Method' section

Posted: Mon Dec 17, 2018 9:30 pm
by pm-netti
payment_address.php lines 101,102:

Code: Select all

Deleted this Sessions too early?

Quick fix?

Code: Select all

if($this->session->data['payment_method'] != 'pp_standard'){
This script != 'pp_standard' change, what payment method your store use.