load->model('setting/extension'); $results = $this->model_setting_extension->getExtensionsByType('payment'); foreach ($results as $result) { if ($this->config->get('payment_' . $result['code'] . '_status')) { $this->load->model('extension/' . $result['extension'] . '/payment/' . $result['code']); $payment_methods = $this->{'model_extension_' . $result['extension'] . '_payment_' . $result['code']}->getMethods($payment_address); if ($payment_methods) { $method_data[$result['code']] = $payment_methods; } } } $sort_order = []; foreach ($method_data as $key => $value) { $sort_order[$key] = $value['sort_order']; } array_multisort($sort_order, SORT_ASC, $method_data); return $method_data; } }