diff --git a/assets/css/cart.css b/assets/css/cart.css index 50c03ff85..babf5e14b 100644 --- a/assets/css/cart.css +++ b/assets/css/cart.css @@ -1,44 +1,6 @@ -.cart .paypal_checkout_button img { - vertical-align: middle; -} -.paypal_box_button { - /* clear: both;*/ - float: left; - margin-left:4%; - margin-bottom:10px; -} -.woocommerce #content table.cart .paypal_box_button img, .woocommerce table.cart .paypal_box_button img, .woocommerce-page #content table.cart .paypal_box_button img, .woocommerce-page table.cart .paypal_box_button img { - width: 150px; - border-radius: 0px; - box-shadow: none; - padding: 0px; - display: inline; -} -.paypal_box_button div a img { - border: none; -} -#paypal_ec_paypal_credit_button, #paypal_ec_button, .paypal_ec_textbutton { - position: relative; -} -#paypal_ec_paypal_credit_button a { - display: block; - text-align: center; - width: 100%; -} -#paypal_ec_button, .paypal_ec_textbutton { - margin-bottom: 3px; -} -.woocommerce .cart-collaterals .cart_totals, .woocommerce-page .cart-collaterals .cart_totals { - width:100%; -} -.wc-proceed-to-checkout { +.angelleye_cart_button a.paypal_checkout_button { + clear: both; float: left; -} -.cart_totals .clear {display:none !important;} -.woocommerce-cart .wc-proceed-to-checkout { - padding: 1em 0; - - font-size: 15px; -} -.woocommerce-cart .cart-collaterals .cart_totals table {width:80%;} \ No newline at end of file + border: none; padding: 0; +} \ No newline at end of file diff --git a/assets/js/angelleye-frontend.js b/assets/js/angelleye-frontend.js index 772544848..2f34f7cd0 100644 --- a/assets/js/angelleye-frontend.js +++ b/assets/js/angelleye-frontend.js @@ -6,8 +6,7 @@ jQuery(document).ready(function ($){ $(this).attr('disabled', 'disabled'); $('form.cart').submit(); jQuery(this).parent().parent().parent().find(".angelleyeOverlay").show(); - //jQuery(".angelleyeOverlay").show(); - return false; + return false; }); } if (angelleye_frontend.is_cart == "yes"){ diff --git a/classes/wc-gateway-paypal-express-angelleye.php b/classes/wc-gateway-paypal-express-angelleye.php index d92b61ccb..644c96a97 100644 --- a/classes/wc-gateway-paypal-express-angelleye.php +++ b/classes/wc-gateway-paypal-express-angelleye.php @@ -2018,7 +2018,7 @@ static function woocommerce_before_cart() { * Triggered from the 'woocommerce_proceed_to_checkout' action. * Displays the PayPal Express button. */ - static function woocommerce_paypal_express_checkout_button_angelleye() { + static function woocommerce_paypal_express_checkout_button_angelleye_old() { global $pp_settings, $pp_pro, $pp_payflow; $payment_gateways = WC()->payment_gateways->get_available_payment_gateways(); // Pay with Credit Card @@ -2087,6 +2087,51 @@ static function woocommerce_paypal_express_checkout_button_angelleye() { echo "
"; } } + + static function woocommerce_paypal_express_checkout_button_angelleye() { + global $pp_settings; + if (@$pp_settings['enabled'] == 'yes' && (empty($pp_settings['show_on_cart']) || $pp_settings['show_on_cart'] == 'yes') && 0 < WC()->cart->total) { + if (empty($pp_settings['checkout_with_pp_button_type'])) { + $pp_settings['checkout_with_pp_button_type'] = 'paypalimage'; + } + $angelleyeOverlay = ''; + switch ($pp_settings['checkout_with_pp_button_type']) { + case "textbutton": + if (!empty($pp_settings['pp_button_type_text_button'])) { + $button_text = $pp_settings['pp_button_type_text_button']; + } else { + $button_text = __('Proceed to Checkout', 'woocommerce'); + } + echo '' . $button_text . ''; + echo $angelleyeOverlay; + break; + case "paypalimage": + echo ''; + echo "" . __("; + echo ""; + echo $angelleyeOverlay; + break; + case "customimage": + $button_img = $pp_settings['pp_button_type_my_custom']; + echo ''; + echo "" . __("; + echo ""; + echo $angelleyeOverlay; + break; + } + + /** + * Displays the PayPal Credit checkout button if enabled in EC settings. + */ + if (isset($pp_settings['show_paypal_credit']) && $pp_settings['show_paypal_credit'] == 'yes') { + $paypal_credit_button_markup = ''; + $paypal_credit_button_markup .= "Check out with PayPal Credit"; + $paypal_credit_button_markup .= ''; + $paypal_credit_button_markup .= $angelleyeOverlay; + echo $paypal_credit_button_markup; + } + } + } static function get_button_locale_code() { $locale_code = defined("WPLANG") && get_locale() != '' ? get_locale() : 'en_US'; @@ -2192,7 +2237,9 @@ public function process_refund($order_id, $amount = null, $reason = '') { function top_cart_button() { if (!empty($this->settings['button_position']) && ($this->settings['button_position'] == 'top' || $this->settings['button_position'] == 'both')) { + echo '
'; $this->woocommerce_paypal_express_checkout_button_angelleye(); + echo '
'; } } diff --git a/paypal-for-woocommerce.php b/paypal-for-woocommerce.php index b9e667a51..b4de36bf9 100644 --- a/paypal-for-woocommerce.php +++ b/paypal-for-woocommerce.php @@ -255,9 +255,9 @@ function init(){ if (!class_exists("WC_Payment_Gateway")) return; load_plugin_textdomain('paypal-for-woocommerce', false, dirname(plugin_basename(__FILE__)). '/i18n/languages/'); add_filter( 'woocommerce_payment_gateways', array($this, 'angelleye_add_paypal_pro_gateway'),1000 ); - remove_action( 'woocommerce_proceed_to_checkout', 'woocommerce_paypal_express_checkout_button', 12 ); + //remove_action( 'woocommerce_proceed_to_checkout', 'woocommerce_paypal_express_checkout_button', 12 ); if( isset($pp_settings['button_position']) && ($pp_settings['button_position'] == 'bottom' || $pp_settings['button_position'] == 'both')){ - add_action( 'woocommerce_after_cart_totals', array( 'WC_Gateway_PayPal_Express_AngellEYE', 'woocommerce_paypal_express_checkout_button_angelleye'), 12 ); + add_action( 'woocommerce_proceed_to_checkout', array( 'WC_Gateway_PayPal_Express_AngellEYE', 'woocommerce_paypal_express_checkout_button_angelleye'), 22 ); } add_action( 'woocommerce_before_cart', array( 'WC_Gateway_PayPal_Express_AngellEYE', 'woocommerce_before_cart'), 12 ); remove_action( 'init', 'woocommerce_paypal_express_review_order_page') ;