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 / block-editor / blocks / checkout / inner-blocks / payment / class.php

class.php in SellKit – Funnel builder and checkout optimizer for WooCommerce to sell more, faster 2.7.0, at includes/block-editor/blocks/checkout/inner-blocks/payment/class.php

93 lines 3.0 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 namespace Sellkit\Blocks\Inner_Block;
3
4 defined( 'ABSPATH' ) || exit;
5
6 /**
7 * Payment class.
8 *
9 * @since 2.3.0
10 * @package Sellkit\Blocks\Inner_Block
11 */
12 class Checkout_Payment {
13 /**
14 * Register block meta.
15 *
16 * @since 2.3.0
17 */
18 public function register_block_meta() {
19 register_block_type_from_metadata(
20 __DIR__
21 );
22 }
23
24 /**
25 * Render payment.
26 *
27 * @param string $content Block content.
28 * @param array $attributes Block attributes.
29 * @since 2.3.0
30 * @return string
31 */
32 public function checkout_payment( $content, $attributes ) {
33 add_filter( 'sellkit_checkout_block_secure_transaction_text', function() {
34 return esc_html( $attributes['paymentDescriptionText'] );
35 } );
36
37 ob_start();
38
39 if ( ! wp_doing_ajax() ) {
40 do_action( 'woocommerce_review_order_before_payment' );
41
42 $custom_class = ! empty( $attributes['customClass'] ) ? esc_attr( $attributes['customClassName'] ) : '';
43
44 echo '<section class="' . esc_attr( $custom_class ) . '">';
45 }
46
47 if ( ! wp_doing_ajax() ) {
48 ?>
49 <div id="payment_method_title" class="sellkit-one-page-checkout-payment-heading heading"><?php echo esc_html( $attributes['paymentHeadingText'] ); ?></div>
50 <p class="sellkit-one-page-checkout-payment-desc sub-heading">
51 <?php echo esc_html( $attributes['paymentDescriptionText'] ); ?>
52 </p>
53 <?php
54 }
55 ?>
56 <div id="payment" class="woocommerce-checkout-payment sellkit-one-page-checkout-payment-methods sellkit-checkout-widget-divider">
57 <?php if ( ! empty( WC()->cart ) && WC()->cart->needs_payment() ) : ?>
58 <ul class="wc_payment_methods payment_methods methods">
59 <?php
60 $available_gateways = WC()->payment_gateways->get_available_payment_gateways();
61
62 if ( ! empty( $available_gateways ) ) {
63 foreach ( $available_gateways as $gateway ) {
64 wc_get_template( 'checkout/payment-method.php', array( 'gateway' => $gateway ) );
65 echo '<hr class="sellkit-checkout-widget-divider">';
66 }
67 } else {
68 $wc_no_available_payment = apply_filters( 'woocommerce_no_available_payment_methods_message', WC()->customer->get_billing_country() ? esc_html__( 'Sorry, it seems that there are no available payment methods for your state. Please contact us if you require assistance or wish to make alternate arrangements.', 'sellkit' ) : esc_html__( 'Please fill in your details above to see available payment methods.', 'sellkit' ) );
69
70 echo '<li class="woocommerce-notice woocommerce-notice--info woocommerce-info">' . wp_kses_post( $wc_no_available_payment ) . '</li>';
71 }
72 ?>
73 </ul>
74 <?php endif; ?>
75 </div>
76 <?php
77 if ( ! wp_doing_ajax() ) {
78 ?>
79 <div class="sellkit-one-page-checkout-payment-desc sub-heading">
80 <?php wc_get_template( 'checkout/terms.php' ); ?>
81 </div>
82 <?php do_action( 'sellkit_block_checkout_after_term_and_condition' ); ?>
83 <?php
84 echo '</section>';
85 do_action( 'woocommerce_review_order_after_payment' );
86 }
87
88 $final_content = ob_get_clean();
89
90 return str_replace( '</div>', $final_content . '</div>', $content );
91 }
92 }
93