PluginProbe
SellKit – Funnel builder and checkout optimizer for WooCommerce to sell more, faster / 2.7.0
SellKit – Funnel builder and checkout optimizer for WooCommerce to sell more, faster v2.7.0
2.7.0 2.6.0 trunk 1.1.0 1.1.4 1.2.1 1.2.2 1.2.3 1.2.5 1.2.9 1.3.1 1.3.2 1.5.0 1.5.1 1.5.4 1.5.7 1.5.8 1.5.9 1.6.2 1.6.5 1.6.8 1.7.2 1.7.4 1.7.5 1.7.9 All 43 releases
sellkit / includes / elementor / modules / checkout / integrations / paypal-for-woocommerce.php

paypal-for-woocommerce.php in SellKit – Funnel builder and checkout optimizer for WooCommerce to sell more, faster 2.7.0, at includes/elementor/modules/checkout/integrations/paypal-for-woocommerce.php

86 lines 2.0 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace Sellkit\Elementor\Modules\Checkout\Integrations;
4
5 defined( 'ABSPATH' ) || die();
6
7 use Sellkit\Elementor\Modules\Checkout\Integrations\Integration;
8
9 /**
10 * Integration class to integrate paypal for WooCommerce gateway with sellkit checkout widget.
11 *
12 * @since 1.1.0
13 */
14 class Paypal_For_Woocommerce extends Integration {
15 /**
16 * Integrated gateway instance.
17 *
18 * @var \AngellEYE_PayPal_PPCP_Smart_Button
19 * @since 1.8.9
20 */
21 public $parent;
22
23 /**
24 * Check requirement to enable gateway in sellkit checkout widget.
25 *
26 * @return bool
27 * @since 1.1.0
28 */
29 protected function requirements() {
30 // Plugin is not installed.
31 if ( ! class_exists( 'AngellEYE_PayPal_PPCP_Smart_Button' ) ) {
32 return false;
33 }
34
35 $this->parent = \AngellEYE_PayPal_PPCP_Smart_Button::instance();
36
37 // Gateway is not active.
38 if ( 'no' === $this->parent->enabled ) {
39 return false;
40 }
41
42 return true;
43 }
44
45 /**
46 * Content of express checkout methods.
47 *
48 * @return void
49 * @since 1.1.0
50 */
51 public function content() {
52 $this->parent->display_paypal_button_top_checkout_page();
53 }
54
55 /**
56 * Angelleye button wrapper
57 *
58 * @since 1.8.9
59 */
60 public function customized_buttons() {
61 ob_start();
62 ?>
63 <div class="wc_ppcp_express_checkout_gateways angelleye-integrated-by-sellkit">
64 <div class="angelleye_ppcp-gateway express_payment_method_ppcp">
65 <div class="angelleye_ppcp-button-container angelleye_ppcp_<?php echo esc_attr( $this->parent->style_layout ); ?>_<?php echo esc_attr( $this->parent->style_size ); ?>">
66 <div id="angelleye_ppcp_checkout_top"></div>
67 <div id="angelleye_ppcp_checkout_top_apple_pay"></div>
68 </div>
69 </div>
70 </div>
71 <?php
72 return ob_get_clean();
73 }
74
75 /**
76 * Hooks to integrate current gateway with sellkit checkout widget.
77 *
78 * @return void
79 * @since 1.1.0
80 */
81 public function hooks() {
82 add_filter( 'angelleye_ppcp_checkout_top_html', [ $this, 'customized_buttons' ], 10, 1 );
83 remove_action( 'woocommerce_checkout_before_customer_details', [ $this->parent, 'display_paypal_button_top_checkout_page' ], 1 );
84 }
85 }
86