Post by saeed1000 » Mon Feb 03, 2014 11:17 pm

hello every one i need to enable or disable payment methods of the specific module for example module for celling Charge-code for simcards (consider that for a basket including Charge-code i need just online payments and other payments be unraisable)
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

				);
			}
		}
the code " $text_link = $this->language->get('text_' . $extension); " lode files in ( /admin/language/*/payment ) that in not suitible for my project


please help
thank you

Newbie

Posts

Joined
Wed Dec 11, 2013 4:04 am

Post by saeed1000 » Fri Feb 07, 2014 12:47 am

thank you every one :crazy: ??? ??? ??? ??? :-\ :-\ :-\ :crazy:



The problem solved by using peyment methods file name!!!!

Newbie

Posts

Joined
Wed Dec 11, 2013 4:04 am
Who is online

Users browsing this forum: No registered users and 7 guests