PluginProbe
WPFunnels – Funnel Builder for WooCommerce with Checkout & One Click Upsell / 3.13.3
WPFunnels – Funnel Builder for WooCommerce with Checkout & One Click Upsell v3.13.3
3.13.3 3.13.2 3.13.1 3.13.0 3.12.13 3.12.12 3.12.11 3.12.10 3.12.9 3.12.8 3.12.7 3.12.6 3.12.5 3.12.4 3.12.3 3.12.1 3.12.2 3.12.0 3.11.1 3.11.0 3.10.9 3.10.8 3.10.7 3.10.6 2.8.16 All 261 releases
wpfunnels / public / modules / checkout / templates / checkout-template.php

checkout-template.php in WPFunnels – Funnel Builder for WooCommerce with Checkout & One Click Upsell 3.13.3, at public/modules/checkout/templates/checkout-template.php

62 lines 2.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 // Exit if accessed directly.
3 use WPFunnels\Wpfnl;
4 use WPFunnels\Wpfnl_functions;
5
6 if ( ! defined( 'ABSPATH' ) ) {
7 exit;
8 }
9
10 $checkout_layout = Wpfnl_functions::get_checkout_layout( $checkout_id );
11
12 $floating_label = Wpfnl_functions::get_checkout_step_setting( $checkout_id, 'wpfnl_floating_label', 'wpfnl-col-2' );
13
14 if( PHP_SESSION_DISABLED == session_status() ) {
15 session_start();
16 }
17 $_SESSION[ 'checkout_layout' ] = $checkout_layout;
18
19 if( \WPFunnels\Wpfnl_functions::is_wpfnl_pro_activated() && 'wpfnl-express-checkout' === $checkout_layout ) {
20 $checkout_layout .= ' wpfnl-multistep';
21 }
22
23 if( \WPFunnels\Wpfnl_functions::is_wpfnl_pro_activated() && 'wpfnl-2-step' === $checkout_layout ) {
24 $checkout_layout .= ' wpfnl-multistep';
25 }
26
27 // Add shared modern checkout class for both modern layouts
28 if( 'wpfnl-modern-one-column' === $checkout_layout || 'wpfnl-modern-checkout' === $checkout_layout ) {
29 if( false === strpos( $checkout_layout, 'wpfnl-modern-checkout' ) ) {
30 $checkout_layout .= ' wpfnl-modern-checkout';
31 }
32 }
33
34 if( 'wpfnl-modern-multistep' === $checkout_layout ) {
35 $checkout_layout .= ' wpfnl-modern-checkout';
36 }
37
38 ?>
39
40 <div id="wpfnl-checkout-form" class="wpfnl-checkout <?php echo esc_attr( $checkout_layout ); ?> <?php echo esc_attr( $floating_label ); ?> ">
41 <?php
42 if ( WC()->cart && WC()->cart->is_empty() ) {
43 // WC shortcode redirects to cart when empty — bypass it and render the
44 // checkout form template directly so the design is visible without products.
45 // Set a session flag so the woocommerce_checkout_update_order_review_expired
46 // filter can suppress the "session expired" AJAX response for this session.
47 wc_clear_notices();
48 WC()->session->set( 'wpfnl_checkout_preview_mode', true );
49 ob_start();
50 wc_get_template( 'checkout/form-checkout.php', array( 'checkout' => WC()->checkout() ) );
51 echo ob_get_clean(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
52 } else {
53 $checkout_html = do_shortcode( '[woocommerce_checkout]' );
54 if ( empty( $checkout_html ) || trim( $checkout_html ) === '<div class="woocommerce"></div>' ) {
55 echo esc_html__( 'Your cart is currently empty.', 'wpfnl' );
56 } else {
57 echo $checkout_html; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
58 }
59 }
60 ?>
61 </div>
62