2012-11-11 9 views
0

나는 단지 opencart의 초보자입니다. 나는 그것을 가진 전자 상거래 wesite를 만들었다. 해당 웹 사이트에는 다중 통화 변환기 옵션이있는 다국어 기능이 있습니다. 이제는 사용자가 자신의 언어를 클릭 할 때 통화도 해당 언어로 변환해야합니다. 따라서 Opencart으로이 작업을 수행 할 수 있습니다. 누군가가 코드 나 참조 링크를 공유 할 수있어서 그렇게 할 수 있습니다. 어떤 도움이나 제안이라도 매우 유용 할 것입니다. 감사.통화 변경 옵션을 사용하는 장바구니 변경

시스템> 현지화> 통화가

변경 및 특정 언어와 관련된 통화 옵션을 추가 할 수 있습니다 다음 opencart 관리자 패널의 통화 옵션이 있습니다

답변

1

이 경로는이 같은 것입니다. 함수에있다

+0

답장을 보내 주셔서 감사합니다.하지만 언어와 통화를 모두 변환하고 싶습니다. 그것은 단지 언어를 바꿀 것입니다. – NewUser

+0

OpenCart는 ISO 형식 만 사용 통화 –

0

: \ 시스템 \ 라이브러리 \ currency.php

public function format($number, $currency = '', $value = '', $format = true) { 
    if ($currency && $this->has($currency)) { 
     $symbol_left = $this->currencies[$currency]['symbol_left']; 

     $symbol_right = $this->currencies[$currency]['symbol_right']; 
     $decimal_place = $this->currencies[$currency]['decimal_place']; 
    } else {    
     $symbol_left = $this->currencies[$this->code]['symbol_left']; 
     $symbol_right = $this->currencies[$this->code]['symbol_right']; 
     $decimal_place = $this->currencies[$this->code]['decimal_place'];   
     $currency = $this->code; 
    } 

주의 깊게 보면 당신은 언어에 따라 여기에 통화를 변경할 수 있습니다 또는 당신이 아약스 요청을 보낼 jQuery를 사용할 수 있습니다 통화 변화.

1
if ($currency && $this->has($currency)) { 
      $symbol_left = $this->currencies[$currency]['symbol_left']; 
      $symbol_right = $this->currencies[$currency]['symbol_right']; 
      $decimal_place = $this->currencies[$currency]['decimal_place']; 
     } else { 
      if($_SESSION['language']=="es"): 

       $symbol_right = $this->currencies[$this->code]['symbol_right']; 
       else: 
    $from="USD"; 
    $to="MXN"; 
    $path = "http://www.google.com/ig/calculator?hl=en&q=1".$from."=?".$to; 
    $rawdata = file_get_contents($path); 
    $data = explode('"', $rawdata); 
    $data = explode(' ', $data['3']); 
    $var = $data['0']; 
    $e=round($var,3); 
    if ($e): 
     $number=$number/$e; 
    else: 
     $default_dollar=12.863; 
     $number=$number/$default_dollar;      
    endif;  
     $symbol_right=" USD"; 
    endif; 
      $symbol_left = $this->currencies[$this->code]['symbol_left']; 

      $decimal_place = $this->currencies[$this->code]['decimal_place']; 

      $currency = $this->code; 
     } 
관련 문제