Skip to content

Commit

Permalink
Merge pull request #1215 from angelleye/PFW-262
Browse files Browse the repository at this point in the history
Pfw 262
  • Loading branch information
Andrew Angell committed Oct 8, 2018
2 parents 5b708dd + 6a6190a commit 8a9ebd1
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public function __construct($version) {
if ($this->testmode == false) {
$this->testmode = AngellEYE_Utility::angelleye_paypal_for_woocommerce_is_set_sandbox_product();
}
if (substr(get_option("woocommerce_default_country"), 0, 2) == 'US') {
if (substr(get_option("woocommerce_default_country"), 0, 2) == 'US' || substr(get_option("woocommerce_default_country"), 0, 2) == 'GB') {
$this->is_paypal_credit_enable = true;
} else {
$this->is_paypal_credit_enable = false;
Expand Down
6 changes: 3 additions & 3 deletions assets/js/angelleye-admin.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jQuery(function () {
jQuery(document).ready(function ($) {
jQuery('#woocommerce_paypal_express_disallowed_funding_methods').closest('table').addClass('angelleye_smart_button_setting_left');
jQuery('.display_smart_button_previews_button').html('<input type="hidden" name="angelleye_smart_button_preview_and_refresh" class="button-primary angelleye_smart_button_preview_and_refresh" value="Preview & Refresh Smart Button">');
if (angelleye_admin.shop_based_us == "no") {
if (angelleye_admin.is_paypal_credit_enable == "no") {
jQuery("#woocommerce_paypal_express_show_paypal_credit").attr("disabled", true);
jQuery("label[for='woocommerce_paypal_express_show_paypal_credit']").css('color', '#666');
}
Expand Down Expand Up @@ -329,7 +329,7 @@ jQuery(document).ready(function ($) {
var angelleye_layout = jQuery("#woocommerce_paypal_express_button_layout").val();
var angelleye_tagline = jQuery("#woocommerce_paypal_express_button_tagline").val();
var angelleye_fundingicons = jQuery("#woocommerce_paypal_express_button_fundingicons").val();
if (angelleye_admin.shop_based_us == "no") {
if (angelleye_admin.is_paypal_credit_enable == "no") {
var angelleye_woocommerce_paypal_express_allowed_funding_methods = ['card', 'elv', 'venmo'];
} else {
var angelleye_woocommerce_paypal_express_allowed_funding_methods = ['credit', 'card', 'elv', 'venmo'];
Expand Down Expand Up @@ -370,7 +370,7 @@ jQuery(document).ready(function ($) {
return jQuery.inArray(value, angelleye_woocommerce_paypal_express_disallowed_funding_methods) < 0;
});

if (angelleye_admin.shop_based_us == "no") {
if (angelleye_admin.is_paypal_credit_enable == "no") {
angelleye_woocommerce_paypal_express_disallowed_funding_methods.push("credit");
}
if(jQuery.inArray('card', angelleye_woocommerce_paypal_express_allowed_funding_methods) > -1 === true) {
Expand Down
1 change: 1 addition & 0 deletions paypal-for-woocommerce.php
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,7 @@ public function admin_scripts()
'shop_based_us' => (substr(get_option("woocommerce_default_country"), 0, 2) == 'US') ? "yes" : "no",
'payment_method' => $payment_method,
'payment_action' => $payment_action,
'is_paypal_credit_enable' => ( substr(get_option("woocommerce_default_country"), 0, 2) == 'US' || substr(get_option("woocommerce_default_country"), 0, 2) == 'GB' ) ? "yes" : "no",
'locale' => ($this->use_wp_locale_code === 'yes' && AngellEYE_Utility::get_button_locale_code() != '') ? AngellEYE_Utility::get_button_locale_code() : ''

);
Expand Down

0 comments on commit 8a9ebd1

Please sign in to comment.