Добрый день.
Хочу сделать прием платежей paypal, использую стандартный модуль в Commerce , валют на сайте две (модуль Multi Currency)
Как сделать так чтобы все счета выставлялись в долларах?
сейчас у меня счет в paypal выставляет в текущей выбранной валюте...
Комментарии
нашел решение
в файл sites/all/modules/commerce_paypal/modules/wps/commerce_paypal_wps.module
function commerce_paypal_wps_order_form($form, &$form_state, $order, $settings) {
$wrapper = entity_metadata_wrapper('commerce_order', $order);
$currency_code = $wrapper->commerce_order_total->currency_code->value();
$amount = $wrapper->commerce_order_total->amount->value();
+ // Ensure the payment happens in a supported currency.
+ if (!in_array($currency_code,
+ array_keys(commerce_paypal_wps_currencies()))) {
+ $amount = commerce_currency_convert($amount, $currency_code, +$settings['currency_code']);
+ $currency_code = $settings['currency_code'];
+ }
// Ensure a default value for the payment_method setting.
$settings += array('payment_method' => '');