2017-04-03 18 views
0

短いバージョン:
米国の下位48社以外の方の支払い方法としてのみPayPalを受け入れたいと思っています。

これは、支払いオプションの下でbigcommerceに既にインストールされている機能ではなく、ドロップダウンの国のメニューからの選択に基づいて支払いゲートウェイを隠すだけの機能はありません。

残念ながら、私はbigcommerceをよく知っていませんが、私はこれを他のカートでも問題なくコード化することができました。誰かがこれを経験したことがありますか?

現在、米国以外の国にお住まいのお客様からの支払いは無効になっており、お支払いのアカウントにサインアップする際にGoogleのサイトにバナーを配置していますが、人々はそこに座ってCC情報を12,000回キャプチャアラート-_-事前に
おかげで自分のメールボックス

Currnetly礎石1.5テーマを実行しているBigCommerce:国によって支払方法が制限される

答えて

0

一つの可能​​な解決策は、出荷または請求国のいずれかを読み、関連する支払いを表示するにはJavaScriptを使用することができメソッド。

ここでは、特定の要素を(あなたのターゲット要素のための適切なセレクタを決定するには、ブラウザの開発者ツールを使用)を選択する方法を知っていると仮定概念例です。..

/** 
* This example binds a change event to the shipping country input dropdown, 
* so whenever a country is selected or changed, this code will show the relevant 
* payment methods. 
* NOTE: The change method here might not work if the payment methods section 
* is inaccessible at the time of country selection, at which point you should 
* modify the code to read the country at the time of DOM load for the payment methods. 
*/ 

//** Whenever the shipping country is selected or changed **// 
$("#shipping_country_dropdown").change(function() { 
    // Hide/Clear all visible payment options: 
    $(".payment_methods :input").each(function() { 
    $(this).hide(); 
    }); 
    togglePaymentMethodsByCountry($(this).find('option:selected').text()); 
}); 

/** 
* Displays specific payment methods depending on the customer's selected billing or shipping country. 
* You set the list of countries and their allowed payment methods here. 
* @param country String - The customer selected country. 
* @return Void 
*/ 
function togglePaymentMethodsByCountry(country) { 
    //** Define your country/payment options here, countries in caps **// 
    switch(country.toUpperCase()) { 
    case "UNITED STATES OF AMERICA": 
     $('#payment_method_1').show(); 
     $('#payment_method_2').show(); 
     $('#payment_method_3').show(); 
     break; 
    case "CANADA": 
     $('#payment_method_1').show(); 
     $('#payment_method_2').show(); 
     break; 
    default: 
     // For all other countries not listed above: 
     $('#payment_method_3').show(); 
     break; 
    } 
} 
関連する問題