Post by fadi ahmad » Thu Jan 05, 2012 2:25 pm

هل يمكن تغيير اللغة من الانجليزية الى العربية في موديل الدفع كاش يو

حيث ان اللغة الانجليزية هي المتاحة في الموديل , قرأت العديد من الردود ولاحظت هذا الرد ولكن للاسف لم اجد ما يقول عنه

Well its an english payment gateway. You can change the language code in catalog/controller/payment/cashu.php

search for 'en' and change to 'ar'
هذا المسار الذي يتحدث عنه

Code: Select all

<?php
//
class ControllerPaymentCashu extends Controller {
	protected function index() {
	      
		$this->language->load('payment/cashu');
		$this->data['button_confirm'] = $this->language->get('button_confirm');
		$this->data['button_back'] = $this->language->get('button_back');
        $this->data['products'] = array();
      
    $products = $this->cart->getProducts();
    foreach ($products as $product) {
      $this->data['products'][] = array(
         'name'        => $product['name']
      );
    }

        $vendor = $this->config->get('cashu_vendor');
		$password = $this->config->get('cashu_password');
	    $mode = $this->config->get('cashu_test');        		
		$this->load->model('checkout/order');
		
		$order_info = $this->model_checkout_order->getOrder($this->session->data['order_id']);
		
		$data = array();
		
		$data['VendorTxCode'] = $this->session->data['order_id'];
		$data['ReferrerID'] = 'E511AF91-E4A0-42DE-80B0-09C981A3FB61';
		$data['Amount'] = $this->currency->format($order_info['total'], $order_info['currency'], $order_info['value'], FALSE);
		$data['Currency'] = $order_info['currency'];
		$data['Description'] = sprintf($this->language->get('text_description'), date($this->language->get('date_format_short')), $this->session->data['order_id']);
		
		if ($this->request->get['route'] != 'checkout/guest_step_3') {
			$data['FailureURL'] = HTTPS_SERVER . 'index.php?route=checkout/payment';
		} else {
			$data['FailureURL'] = HTTPS_SERVER . 'index.php?route=checkout/guest_step_2';
		}
		
		$data['CustomerName'] = html_entity_decode($order_info['payment_firstname'] . ' ' . $order_info['payment_lastname'], ENT_QUOTES, 'UTF-8');
		$data['SendEMail'] = '1';
		$data['CustomerEMail'] = $order_info['email'];
		$data['VendorEMail'] = $this->config->get('config_email');  
		
		$data['BillingFirstnames'] = $order_info['payment_firstname'];
        $data['BillingSurname'] = $order_info['payment_lastname'];
        $data['BillingAddress1'] = $order_info['payment_address_1'];
		
		if ($order_info['payment_address_2']) {
      $data['BillingAddress2'] = $order_info['payment_address_2'];
		}
		
		$data['BillingCity'] = $order_info['payment_city'];
    $data['BillingPostCode'] = $order_info['payment_postcode'];	
    $data['BillingCountry'] = $order_info['payment_iso_code_2'];
		
		if ($order_info['payment_iso_code_2'] == 'US') {
			$data['BillingState'] = $order_info['payment_zone_code'];
		}
		
		$data['BillingPhone'] = $order_info['telephone'];
		
		if ($this->cart->hasShipping()) {
			$data['DeliveryFirstnames'] = $order_info['shipping_firstname'];
      $data['DeliverySurname'] = $order_info['shipping_lastname'];
      $data['DeliveryAddress1'] = $order_info['shipping_address_1'];
		
			if ($order_info['shipping_address_2']) {
        $data['DeliveryAddress2'] = $order_info['shipping_address_2'];
			}
		
      $data['DeliveryCity'] = $order_info['shipping_city'];
      $data['DeliveryPostCode'] = $order_info['shipping_postcode'];
      $data['DeliveryCountry'] = $order_info['shipping_iso_code_2'];
		
			if ($order_info['shipping_iso_code_2'] == 'US') {
				$data['DeliveryState'] = $order_info['shipping_zone_code'];
			}
		
			$data['DeliveryPhone'] = $order_info['telephone'];
		} else {
      $data['DeliveryFirstnames'] = $order_info['payment_firstname'];
      $data['DeliverySurname'] = $order_info['payment_lastname'];
      $data['DeliveryAddress1'] = $order_info['payment_address_1'];
      
      if ($order_info['payment_address_2']) {
        $data['DeliveryAddress2'] = $order_info['payment_address_2'];
      }
      
      $data['DeliveryCity'] = $order_info['payment_city'];
      $data['DeliveryPostCode'] = $order_info['payment_postcode'];
      $data['DeliveryCountry'] = $order_info['payment_iso_code_2'];
      
      if ($order_info['payment_iso_code_2'] == 'US') {
        $data['DeliveryState'] = $order_info['payment_zone_code'];
      }
    
      $data['DeliveryPhone'] = $order_info['telephone'];			
		}
		
		$data['AllowGiftAid'] = '0';
		
		if (!$this->config->get('cashu_transaction')) {
			$data['ApplyAVSCV2'] = '0';
		}
		
 		$data['Apply3DSecure'] = '0';
		
		$this->data['transaction'] = $this->config->get('cashu_transaction');
		$this->data['vendor'] = $vendor;
        $this->data['mode'] = $mode;
        $this->data['security_key'] = $password; 
        $this->data['Order_Id'] = $data['VendorTxCode'];
        
        $product_data = array();
	
		foreach ($this->cart->getProducts() as $product) {
      		$option_data = array();

      		foreach ($product['option'] as $option) {
        		$option_data[] = array(
					'product_option_value_id' => $option['product_option_value_id'],			   
          			'name'                    => $option['name'],
          			'value'                   => $option['value'],
		  			'prefix'                  => $option['prefix']
        		);
      		}
 
      		$product_data[] = array(
        		'product_id' => $product['product_id'],
				'name'       => $product['name'],
        		'model'      => $product['model'],
        		'option'     => $option_data,
				'download'   => $product['download'],
				'quantity'   => $product['quantity'],
				'subtract'   => $product['subtract'],
				'price'      => $product['price'],
        		'total'      => $product['total'],
				'tax'        => $this->tax->getRate($product['tax_class_id'])
      		); 
    	}
        $crypt_data = array();
   
		foreach($data as $key => $value){
   		$crypt_data[] = $key . '=' . $value;
		}

		$this->data['crypt'] = base64_encode($this->simpleXor(implode('&', $crypt_data), $password));
		
		if ($this->request->get['route'] != 'checkout/guest_step_3') {
			$this->data['back'] = HTTPS_SERVER . 'index.php?route=checkout/payment';
		} else {
			$this->data['back'] = HTTPS_SERVER . 'index.php?route=checkout/guest_step_2';
		}
		
		$this->id = 'payment';

		if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/payment/cashu.tpl')) {
			$this->template = $this->config->get('config_template') . '/template/payment/cashu.tpl';
		} else {
			$this->template = 'default/template/payment/cashu.tpl';
		}	
		
		$this->render();
	}
	
	
  public function callback() {
    //Customer is redirected from bank's website to this page
	 	$this->load->language('payment/cashu');
		$this->load->model('checkout/order');
		$this->load->model('payment/cashu');
        $post = $this->request->post;
        $order_info = $this->model_checkout_order->getOrder($post['txt2']);
        //$this->model_checkout_order->create($order_info);
        $this->model_checkout_order->confirm($post['txt2'], 5);
        ?>
				<script type="text/javascript">
				window.location = '<?php print HTTPS_SERVER;?>/index.php?route=checkout/success';
				</script>				
				<?php
	}
    
	private function simpleXor($string, $password) {
		$data = array();

		for ($i = 0; $i < strlen(utf8_decode($password)); $i++) {
			$data[$i] = ord(substr($password, $i, 1));
		}

		$output = '';

		for ($i = 0; $i < strlen(utf8_decode($string)); $i++) {
    		$output .= chr(ord(substr($string, $i, 1)) ^ ($data[$i % strlen(utf8_decode($password))]));
		}

		return $output;		
	}
}
?>

الرجاء المساعدة ان كان بالامكان .. شكرا :joker:

New member

Posts

Joined
Sat Dec 03, 2011 1:58 am

Post by opencartArab » Thu Jan 05, 2012 4:05 pm

نعم ابحث عن رمز اللغة الانجليزية
en
واستبدله برمز اللغة العربية
ar

التعليمات باللغة العربية على الرابط التالي
https://www.opencartarab.com/docs
استضافة اوبن كارت العرب
https://host.opencartarab.com


Expert Member

Posts

Joined
Thu Apr 01, 2010 3:31 am

Post by fadi ahmad » Thu Jan 05, 2012 5:09 pm

opencartArab wrote:نعم ابحث عن رمز اللغة الانجليزية
en
واستبدله برمز اللغة العربية
ar
المشكلة ان الرمز غير موجود en
قمت بالبحث اكثر من 5 مرات دون فائدة


:choke:

New member

Posts

Joined
Sat Dec 03, 2011 1:58 am

Post by opencartArab » Thu Jan 05, 2012 5:19 pm

أخي الكريم راسل صاحب الاضافة

التعليمات باللغة العربية على الرابط التالي
https://www.opencartarab.com/docs
استضافة اوبن كارت العرب
https://host.opencartarab.com


Expert Member

Posts

Joined
Thu Apr 01, 2010 3:31 am

Post by fadi ahmad » Sat Jan 07, 2012 2:01 am

opencartArab wrote:أخي الكريم راسل صاحب الاضافة
صاحب الاضافة هي شركة كاش يو نفسها

طبعا اكيد ما راح يردون

يبدو فش امل صديقي لا مشكلة شكرا لك على المساعدة


:joker:

New member

Posts

Joined
Sat Dec 03, 2011 1:58 am

Post by basimAlarwi » Wed Feb 08, 2012 1:30 pm

ادخل على هذا الملف

Code: Select all

catalog/view/theme/default/template/payment/cashu.tpl
اذا مغير التصميم استبدل
default بالمجلد المستخدم عندك

و بدل

Code: Select all

<input type="hidden" name="language" value="en">
بهذا الكود

Code: Select all

<input type="hidden" name="language" value="ar">

Newbie

Posts

Joined
Wed Feb 08, 2012 1:24 pm
Who is online

Users browsing this forum: No registered users and 48 guests