main project :
need the array including the "payment modules names" as a array key with 0 or 1 value
In payment tpl will be the condition that checking the current payment with this array. and let it shown or skip the payment
problem:
we can access the names of payment modules ( /admin/language/*/payment ) but we cant use this names because this names are shown in admin and are different from names of payment modules in customer checkout( /catalog/language/*/payment)
This procedures can be done:
accessing (/catalog/language/*/payment) and using it
I copy this code from payment.php it works but i need to access catalog folder instead of admin
Code: Select all
$this->data['extensions'] = array();
$files = glob(DIR_APPLICATION . 'controller/payment/*.php');
if ($files) {
foreach ($files as $file) {
$extension = basename($file, '.php');
$this->language->load('payment/' . $extension);
$action = array();
if (!in_array($extension, $extensions)) {
$action[] = array(
'text' => $this->language->get('text_install'),
'href' => $this->url->link('extension/payment/install', 'token=' . $this->session->data['token'] . '&extension=' . $extension, 'SSL')
);
} else {
$action[] = array(
'text' => $this->language->get('text_edit'),
'href' => $this->url->link('payment/' . $extension . '', 'token=' . $this->session->data['token'], 'SSL')
);
$action[] = array(
'text' => $this->language->get('text_uninstall'),
'href' => $this->url->link('extension/payment/uninstall', 'token=' . $this->session->data['token'] . '&extension=' . $extension, 'SSL')
);
}
$text_link = $this->language->get('text_' . $extension);
if ($text_link != 'text_' . $extension) {
$link = $this->language->get('text_' . $extension);
} else {
$link = '';
}
$this->data['extensions'][] = array(
'name' => $this->language->get('heading_title'),
'link' => $link,
'status' => $this->config->get($extension . '_status'),
'status_txt' => $this->config->get($extension . '_status') ? $this->language->get('text_enabled') : $this->language->get('text_disabled'),
'sort_order' => $this->config->get($extension . '_sort_order'),
'action' => $action
);
}
}
please help
thank you