Skip to content

Commit

Permalink
Merge pull request #2034 from angelleye/PFW-1792
Browse files Browse the repository at this point in the history
PFW-1792, CheckoutWC Compatibility Issues
  • Loading branch information
kcppdevelopers authored Apr 10, 2024
2 parents 11a981f + b22684c commit e95ea66
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 284 deletions.
22 changes: 19 additions & 3 deletions ppcp-gateway/class-angelleye-paypal-ppcp-smart-button.php
Original file line number Diff line number Diff line change
Expand Up @@ -869,6 +869,22 @@ public function display_paypal_button_top_checkout_page() {
}
}
}

public function display_paypal_button_top_cfw() {
if (angelleye_ppcp_is_cart_subscription()) {
return false;
}
if (angelleye_ppcp_get_order_total() === 0) {
return false;
}
if (angelleye_ppcp_has_active_session() === false) {
$this->angelleye_ppcp_smart_button_style_properties();
if (WC()->cart->needs_payment()) {
angelleye_ppcp_add_css_js();
echo apply_filters('angelleye_ppcp_checkout_top_html', '<div id="angelleye_ppcp_checkout_top"></div>' . ($this->enable_apple_pay ? '<div id="angelleye_ppcp_checkout_top_apple_pay"></div>' : '') . ($this->enable_google_pay ? '<div id="angelleye_ppcp_checkout_top_google_pay"></div>' : '') );
}
}
}

public function display_paypal_button_product_page($is_shortcode = '') {
try {
Expand Down Expand Up @@ -1832,7 +1848,7 @@ public function angelleye_ppcp_woocommerce_currency($currency) {
return $currency;
}
}

public function angelleye_ppcp_plugins_loaded() {
try {
if ($this->enable_paypal_checkout_page === true && $this->checkout_page_display_option !== 'regular') {
Expand All @@ -1843,8 +1859,8 @@ public function angelleye_ppcp_plugins_loaded() {
} else {
add_action('woocommerce_checkout_before_customer_details', array($this, 'display_paypal_button_top_checkout_page'), 1);
}
} elseif ( class_exists( \Automattic\WooCommerce\Utilities\FeaturesUtil::class ) ) {
add_action('cfw_checkout_before_order_review_container', array($this, 'display_paypal_button_top_checkout_page'), 1);
} elseif ( defined( 'CFW_VERSION' ) ) {
add_action('cfw_payment_request_buttons', array($this, 'display_paypal_button_top_cfw'), 1);
} else {
add_action('woocommerce_checkout_before_customer_details', array($this, 'display_paypal_button_top_checkout_page'), 1);
}
Expand Down
280 changes: 0 additions & 280 deletions ppcp-gateway/compatibility/ppcp-checkout-for-woocommerce.php

This file was deleted.

10 changes: 10 additions & 0 deletions ppcp-gateway/css/wc-gateway-ppcp-angelleye-public.css
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,13 @@
.angelleye_ppcp-order-review .woocommerce-billing-fields .angelleye_ppcp_billing_hide, .angelleye_ppcp-order-review .woocommerce-shipping-fields .angelleye_ppcp_shipping_hide {
display: none !important;
}
.angelleye_ppcp-order-review #cfw-customer-info .woocommerce-billing-fields .angelleye_ppcp_billing_hide, .angelleye_ppcp-order-review #cfw-customer-info .woocommerce-shipping-fields .angelleye_ppcp_shipping_hide {
display: block !important;
}
.angelleye_ppcp-order-review #cfw-shipping-same-billing .woocommerce-billing-fields .angelleye_ppcp_billing_hide, .angelleye_ppcp-order-review #cfw-shipping-same-billing .woocommerce-shipping-fields .angelleye_ppcp_shipping_hide {
display: block !important;
}

.order_review_page_description {
margin: 0 0 2em;
position: relative;
Expand Down Expand Up @@ -288,6 +295,9 @@ apple-pay-button {
.express_payment_method_ppcp #angelleye_ppcp_checkout_top_apple_pay {
margin-bottom: 10px;
}
#cfw-payment-request-buttons #angelleye_ppcp_checkout_top {
max-width: 300px !important;
}

@supports (-webkit-appearance: -apple-pay-button) {
.apple-pay-button {
Expand Down
Loading

0 comments on commit e95ea66

Please sign in to comment.