2011-10-07 3 views
3

가 Ubercart 3에 대한 솔루션을합니까 Ubercart 3 (드루팔 7)에 대한 Mulitcurrency (드루팔 7) 같은 것은 더 잘 실현을위한 (같은 Drupal Ubercart: multi-currency?) 또는 팁을 존재 하는가?

+1

되었습니다, 난 두려워 순간에 거기에 아무것도 전혀 없다. 당신이 [Ubercart에 대한 다중 통화 지원] 드루팔 7 – Clive

+0

에 (http://drupal.org/project/multicurrency) 모듈의 사용자 지정 포트를 수행하는 얻을 것이다 가장 가까운 그렇게 보인다. 내가 만드는 유일한 해결책은 -이 솔루션에 대한 복수 통화 – m0rg0t

답변

1

내가하지 않는 것이 좋습니다. 다음 업데이트로 모든 변경 사항을 잃어 버리게됩니다. 이 주제를 확인하십시오 : 내 친구가 http://drupal.org/node/1434470#comment-5582812

+0

그것은 다음를 하드 더 나은 것 같은데,의 감사합니다! – m0rg0t

1

솔루션 중 하나로서, 내가 찾아이 사용 예를 들어, 정의 새로운 추가 uc_store.module ubercart/저장소에

을/

define('RUR',0.33); 

경우 0.33 - 기본 통화와 새 사이의 차이점은 통화 (RUR). RUR/달러 =

0.33 및 uc_currency_format 기능에 이것을 추가 :

global $language; 
    if ($language->language=='ru') { 
    $sign = ' RUB'; 
    $thou = ','; 
    $dec = '.';  
    $value = $value/RUR; 
    $sign_after = FALSE; 
    }; 

그리고 전체 기능 : 당신이 그것을 하드 코딩하는 것이

function uc_currency_format($value, $sign = NULL, $thou = NULL, $dec = NULL) { 
    if ($value === NULL) { 
    return NULL; 
    } 

    $output = ''; 

    $sign_after = variable_get('uc_sign_after_amount', FALSE); 
    $prec = variable_get('uc_currency_prec', 2); 
    if (is_null($sign)) { 
    $sign = variable_get('uc_currency_sign', '$'); 
    } 
    if (is_null($thou)) { 
    $thou = variable_get('uc_currency_thou', ','); 
    } 
    if (is_null($dec)) { 
    $dec = variable_get('uc_currency_dec', '.'); 
    }; 

    // If the value is significantly less than the minimum precision, zero it. 
    if ($prec > 0 && round(abs($value), $prec + 1) < pow(10, -$prec)) { 
    $value = 0; 
    } 

    global $language; 
    if ($language->language=='ru') { 
    $sign = '$'; 
    $thou = ','; 
    $dec = '.';  
    $value = $value/RUR; 
    $sign_after = FALSE; 
    }; 

    // Force the price to a positive value and add a negative sign if necessary. 
    if ($value < 0) { 
    $value = abs($value); 
    $output .= '-'; 
    } 

    // Add the currency sign first if specified. 
    if ($sign && !$sign_after) { 
    $output .= $sign; 
    } 

    // Format the number, like 1234.567 => 1,234.57 
    $output .= number_format($value, $prec, $dec, $thou); 

    // Add the currency sign last if specified. 
    if ($sign && $sign_after) { 
    $output .= $sign; 
    }; 

    if ($value=='0') { 
    $output = t('free'); 
    }; 
    return $output; 
} 
+1

10 배 같은 것을 제공하기 위해 해킹 uc_store.module 파일입니다. 너무 단순하고 깨끗하게 보입니다. 이 방법을 사용하면 단점이 있습니까? –

+0

단점 : 그것은 핵심 변경의 예에서 . Ubercart의 관리자 및 다른 부분에서도 매장의 기본 설정입니다. – m0rg0t