diff --git a/angelleye-includes/express-checkout/class-wc-gateway-paypal-express-helper-angelleye.php b/angelleye-includes/express-checkout/class-wc-gateway-paypal-express-helper-angelleye.php index c6affa485..308fcd00f 100644 --- a/angelleye-includes/express-checkout/class-wc-gateway-paypal-express-helper-angelleye.php +++ b/angelleye-includes/express-checkout/class-wc-gateway-paypal-express-helper-angelleye.php @@ -86,11 +86,12 @@ public function __construct() { public function buy_now_button() { try { global $post, $product; + $ec_html_button = ''; if ($this->enabled == 'yes' && $this->show_on_product_page == 'yes') { if ($this->enable_tokenized_payments == 'yes') { $this->function_helper->angelleye_ec_save_payment_method_checkbox(); } - echo '
'; } + echo apply_filters('angelleye_ec_product_page_buy_now_button', $ec_html_button); } catch (Exception $ex) { } @@ -353,15 +355,19 @@ public function is_express_checkout_credentials_is_set() { public function top_cart_button() { if ($this->is_express_checkout_credentials_is_set()) { + $top_cart_button_html = ''; if ($this->button_position == 'top' || $this->button_position == 'both') { - echo ' '; + do_action('angelleye_ec_before_top_cart_button', $this); + $top_cart_button_html .= ' '; + echo apply_filters('angelleye_ec_top_cart_button', $top_cart_button_html); + do_action('angelleye_ec_after_top_cart_button', $this); } } } - public function woocommerce_paypal_express_checkout_button_angelleye() { + public function woocommerce_paypal_express_checkout_button_angelleye($return = false) { if (!AngellEYE_Utility::is_valid_for_use_paypal_express()) { return false; } @@ -369,23 +375,27 @@ public function woocommerce_paypal_express_checkout_button_angelleye() { if ($this->enable_tokenized_payments == 'yes') { $this->function_helper->angelleye_ec_save_payment_method_checkbox(); } + if($return == false) { + do_action('angelleye_ec_before_buttom_cart_button', $this); + } + $cart_button_html = ''; $angelleyeOverlay = ''; switch ($this->checkout_with_pp_button_type) { case 'textbutton': - echo '' . $this->pp_button_type_text_button . ''; - echo $angelleyeOverlay; + $cart_button_html .= '' . $this->pp_button_type_text_button . ''; + $cart_button_html .= $angelleyeOverlay; break; case 'paypalimage': - echo ''; - echo ''; - echo ""; - echo $angelleyeOverlay; + $cart_button_html .= ''; + $cart_button_html .= ''; + $cart_button_html .= ""; + $cart_button_html .= $angelleyeOverlay; break; case 'customimage': - echo ''; - echo ''; - echo ""; - echo $angelleyeOverlay; + $cart_button_html .= ''; + $cart_button_html .= ''; + $cart_button_html .= ""; + $cart_button_html .= $angelleyeOverlay; break; } if ($this->show_paypal_credit == 'yes') { @@ -393,8 +403,14 @@ public function woocommerce_paypal_express_checkout_button_angelleye() { $paypal_credit_button_markup .= ''; $paypal_credit_button_markup .= ''; $paypal_credit_button_markup .= $angelleyeOverlay; - echo $paypal_credit_button_markup; + $cart_button_html .= $paypal_credit_button_markup; + } + if($return == true) { + return $cart_button_html; + } else { + echo $cart_button_html; } + do_action('angelleye_ec_after_buttom_cart_button', $this); } } @@ -411,31 +427,33 @@ public function checkout_message() { if($this->enable_tokenized_payments == 'yes') { $this->function_helper->angelleye_ec_save_payment_method_checkbox(); } - echo ' '; echo ''; echo '';