M
M
Muvka2018-08-31 20:00:40
opencart
Muvka, 2018-08-31 20:00:40

What can cause payment_method to be lost?

Already desperate. Approximately once a day, the following thing pops up in the log:
PHP Notice: Undefined index: payment_method in catalog/controller/extension/payment/cod.php on line 10
Considering that there are 400-1000 orders per day, then for some serious error rarely. Payment module standard OC cod. I do not know what to do. Because of this, the order is cancelled. An order with empty data is sent to the mobile (
The value is taken from the session. The hoster turned off the session reset by the server. Set it for 2 nights when the store is closed. And again, the same nonsense.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
K
ktozdes, 2019-11-06
@ktozdes

I got this error in OpenCart 3, when a person in the process of placing an order is already at the final stage, and decided to add something to the cart on another page, then returned to the checkout window, and clicked "Order Confirmation".
Even minus one order is unfortunate, because it can be both a mower and a five, so I really want to understand how experts would recommend solving this problem.
Line 10 is if ($this->session->data['payment_method']['code'] == 'cod') {
in such a pahap
<?php
class ControllerExtensionPaymentCod extends Controller {
public function index() {
return $this ->load->view('extension/payment/cod');
if ($this->session->data['payment_method']['code'] == 'cod') {
$this->load->model('checkout/order');
$this->model_checkout_order->addOrderHistory($this->session->data['order_id'], $this->config->get('payment_cod_order_status_id'));
$json['redirect'] = $this->url->link('checkout/success');
}
$this->response->addHeader('Content-Type: application/json');
$this->response->setOutput(json_encode($json));
}
}

X
xakepynet, 2020-06-13
@xakepynet

Cut off <Free shipping>
I have opencart 3.0

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question