2017-04-03 71 views
0

簡版:
我只想接受貝寶作爲美國境外48位以外任何人的付款方式。

我不明白這是不是一個功能已經安裝在bigcommerce付款選項下,只是基於從下拉菜單中選擇隱藏這些支付網關。

不幸的是,我不太瞭解bigcommerce,但我已經設法在x-cart等其他購物車上編碼,沒有太多問題。有沒有人遇到過這個問題,或者對我有修補程序?

目前我們已經通過我們的商戶禁止向美國以外的任何人付款,並且在註冊您的帳戶付款時在我們的網站上放置了一條橫幅,但人們會坐在那裏嘗試輸入他們的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; 
    } 
} 
相關問題