From f65cd39183455b0d8658d6279e9bfe8ee16a9471 Mon Sep 17 00:00:00 2001 From: kcppdevelopers Date: Thu, 6 Dec 2018 13:32:59 +0530 Subject: [PATCH] Checkout WC Compatibility, PFW-305 --- ...ateway-paypal-express-helper-angelleye.php | 66 +++++++++---------- 1 file changed, 30 insertions(+), 36 deletions(-) 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 59a22aa58..6682c4aff 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 @@ -17,7 +17,7 @@ class Angelleye_PayPal_Express_Checkout_Helper { protected static $_instance = null; /** - * Main WC_Emails Instance. + * Main Angelleye_PayPal_Express_Checkout_Helper Instance. * * Ensures only one instance of Angelleye_PayPal_Express_Checkout_Helper is loaded or can be loaded. * @@ -209,9 +209,6 @@ public function buy_now_button() { } $button_dynamic_class = 'single_variation_wrap_angelleye_' . $product->get_id(); $hide = ''; - if ($_product->is_type('variation') || $_product->is_type('variable') || $_product->get_price() == 0 || $_product->get_price() == '') { - //$hide = 'display:none;'; - } $ec_html_button .= '
'; if ($this->enable_in_context_checkout_flow == 'no') { $add_to_cart_action = esc_url(add_query_arg('express_checkout', '1')); @@ -381,40 +378,39 @@ public function ec_formatted_address($type) { return; } ?> -
- WC()->checkout->get_value($type . '_first_name'), - 'last_name' => WC()->checkout->get_value($type . '_last_name'), - 'company' => WC()->checkout->get_value($type . '_company'), - 'address_1' => WC()->checkout->get_value($type . '_address_1'), - 'address_2' => WC()->checkout->get_value($type . '_address_2'), - 'city' => WC()->checkout->get_value($type . '_city'), - 'state' => WC()->checkout->get_value($type . '_state'), - 'postcode' => WC()->checkout->get_value($type . '_postcode'), - 'country' => WC()->checkout->get_value($type . '_country'), - ); + WC()->checkout->get_value($type . '_first_name'), + 'last_name' => WC()->checkout->get_value($type . '_last_name'), + 'company' => WC()->checkout->get_value($type . '_company'), + 'address_1' => WC()->checkout->get_value($type . '_address_1'), + 'address_2' => WC()->checkout->get_value($type . '_address_2'), + 'city' => WC()->checkout->get_value($type . '_city'), + 'state' => WC()->checkout->get_value($type . '_state'), + 'postcode' => WC()->checkout->get_value($type . '_postcode'), + 'country' => WC()->checkout->get_value($type . '_country'), + ); - $shipping_details = $this->ec_get_session_data('shipping_details'); - $email = WC()->checkout->get_value($type . '_email'); - if (empty($email)) { - $email = !empty($shipping_details['email']) ? $shipping_details['email'] : ''; - } - $phone = WC()->checkout->get_value($type . '_phone'); - if (empty($phone)) { - $phone = !empty($shipping_details['phone']) ? $shipping_details['phone'] : ''; - } - $formatted_address = WC()->countries->get_formatted_address($address); - $formatted_address = str_replace('
-
', '
', $formatted_address); - echo $formatted_address; - if (!empty($shipping_details)) { - echo!empty($email) ? '

' . $email . '

' : ''; - echo!empty($phone) ? '

' . $phone . '

' : ''; - } - ?> + $shipping_details = $this->ec_get_session_data('shipping_details'); + $email = WC()->checkout->get_value($type . '_email'); + if (empty($email)) { + $email = !empty($shipping_details['email']) ? $shipping_details['email'] : ''; + } + $phone = WC()->checkout->get_value($type . '_phone'); + if (empty($phone)) { + $phone = !empty($shipping_details['phone']) ? $shipping_details['phone'] : ''; + } + $formatted_address = WC()->countries->get_formatted_address($address); + $formatted_address = str_replace('
-
', '
', $formatted_address); + echo $formatted_address; + if (!empty($shipping_details)) { + echo!empty($email) ? '

' . $email . '

' : ''; + echo!empty($phone) ? '

' . $phone . '

' : ''; + } + ?>
@@ -628,7 +624,6 @@ public function woocommerce_paypal_express_checkout_button_angelleye($return = f $cart_button_html .= apply_filters('angelleye_proceed_to_checkout_button_separator', $angelleye_proceed_to_checkout_button_separator); } if ($this->enable_in_context_checkout_flow == 'no') { - switch ($this->checkout_with_pp_button_type) { case 'textbutton': $cart_button_html .= '' . $this->pp_button_type_text_button . ''; @@ -651,7 +646,6 @@ public function woocommerce_paypal_express_checkout_button_angelleye($return = f $cart_button_html .= $paypal_credit_button_markup; } } else { - $cart_button_html .= "
"; } if ($this->enable_tokenized_payments == 'yes') {