PluginProbe
SellKit – Funnel builder and checkout optimizer for WooCommerce to sell more, faster / trunk
SellKit – Funnel builder and checkout optimizer for WooCommerce to sell more, faster vtrunk
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-continue / class.php

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

73 lines 2.7 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 * Checkout_Payment_Continue class.
8 *
9 * @since 2.3.0
10 * @package Sellkit\Blocks\Inner_Block
11 */
12 class Checkout_Payment_Continue {
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 continue.
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_continue( $content, $attributes ) {
33 add_filter( 'sellkit_block_checkout_place_order_btn_text', function() {
34 return esc_html( $attributes['paymentContinueButtonText'] );
35 } );
36
37 ob_start();
38 ?>
39 <section class="place-order sellkit-one-page-checkout-place-order <?php echo esc_attr( $attributes['customClassName'] ); ?>">
40 <noscript>
41 <?php
42 //phpcs:disable
43 /* translators: $1 and $2 opening and closing emphasis tags respectively */
44 printf( esc_html__( 'Since your browser does not support JavaScript, or it is disabled, please ensure you click the %1$sUpdate Totals%2$s button before placing your order. You may be charged more than the amount stated above if you fail to do so.', 'sellkit' ), '<em>', '</em>' );
45 //phpcs:enable
46 ?>
47 <br/><button type="submit" class="button alt sellkit-checkout-widget-primary-button" name="woocommerce_checkout_update_totals" value="<?php esc_attr_e( 'Update totals', 'sellkit' ); ?>"><?php esc_html_e( 'Update totals', 'sellkit' ); ?></button>
48 </noscript>
49
50 <?php $order_button_text = $attributes['paymentContinueButtonText']; ?>
51
52 <?php do_action( 'woocommerce_review_order_before_submit' ); ?>
53
54 <?php echo apply_filters( 'woocommerce_order_button_html', '<button type="submit" class="button alt sellkit-checkout-widget-primary-button" name="woocommerce_checkout_place_order" id="place_order" value="' . esc_attr( $order_button_text ) . '" data-value="' . esc_attr( $order_button_text ) . '">' . esc_html( $order_button_text ) . '</button>' ); // @codingStandardsIgnoreLine ?>
55
56 <?php do_action( 'woocommerce_review_order_after_submit' ); ?>
57
58 <?php wp_nonce_field( 'woocommerce-process_checkout', 'woocommerce-process-checkout-nonce' ); ?>
59 <?php do_action( 'sellkit_block_checkout_required_hidden_fields' ); ?>
60 <?php /* Hide place order button container after ajax call update. we already have it at bottom */ ?>
61 <script>
62 jQuery( document ).ajaxComplete( function() {
63 jQuery( '#payment > .place-order' ).css( 'display', 'none' ).hide();
64 } );
65 </script>
66 </section>
67 <?php
68 $final_content = ob_get_clean();
69
70 return str_replace( '</div>', $final_content . '</div>', $content );
71 }
72 }
73