Fixes for FraudLabs Pro Report in OpenCart 4

If you were using the OpenCart version 4 and above, you may experience difficulties like the absence of the FraudLabs Pro report tab and improper display of the report in the order details page. These issues stem from significant changes in OpenCart’s underlying architecture, introduced from version 4 onwards. It is vital to address these concerns promptly to maintain accurate fraud detection and ensure smooth operations.

In order to resolve these problems, modification of the code is required to the latest version’s architecture. The following detailed steps will guide you through the process of restoring the FraudLabs Pro report tab and rectifying the report display malfunction in OpenCart version 4.

  1. Go to the folder where OpenCart is installed.
  2. Open the sale folder in the opencart\admin\controller\sale directory.
  3. Inside the sale folder, open the order.php file with any text editor.
  4. Search for:
		$this->load->model('setting/extension');

		$extensions = $this->model_setting_extension->getExtensionsByType('fraud');

		foreach ($extensions as $extension) {
			if ($this->config->get('fraud_' . $extension['code'] . '_status')) {
				$this->load->language('extension/' . $extension['extension'] . '/fraud/' . $extension['code'], 'extension');

				$output = $this->load->controller('extension/' . $extension['extension'] . '/fraud/' . $extension['code'] . '.order');

				if (!$output instanceof \Exception) {
					$data['tabs'][] = [
						'code'    => $output,
						'title'   => $this->language->get('extension_heading_title'),
						'content' => $output
					];
				}
			}
		}
  1. Replace with:
		$this->load->model('setting/extension');

		$extensions = $this->model_setting_extension->getExtensionsByType('fraud');

		foreach ($extensions as $extension) {
			if ($this->config->get('fraud_' . $extension['code'] . '_status')) {
				$this->load->language('extension/' . $extension['extension'] . '/fraud/' . $extension['code'], 'extension');

				$output = $this->load->controller('extension/' . $extension['extension'] . '/fraud/' . $extension['code'] . '.order');

				if (!$output instanceof \Exception) {
					$data['tabs'][] = [
						'code'    => $extension['extension'],
						'title'   => $this->language->get('extension_heading_title'),
						'content' => $output
					];
				}
			}
		}
  1. Done.

By meticulously following each of the steps provided earlier, you will successfully rectify the issues, and as a result, the FraudLabs Pro report will be perfectly displayed within the OpenCart platform, ensuring seamless functionality and an enhanced user experience.

Was this article helpful?

Related Articles