| 1 |
<?php |
| 2 |
/** |
| 3 |
* Checkout Form |
| 4 |
* |
| 5 |
* This template can be overridden by copying it to yourtheme/woocommerce/checkout/form-checkout.php. |
| 6 |
* |
| 7 |
* HOWEVER, on occasion WooCommerce will need to update template files and you |
| 8 |
* (the theme developer) will need to copy the new files to your theme to |
| 9 |
* maintain compatibility. We try to do this as little as possible, but it does |
| 10 |
* happen. When this occurs the version of the template file will be bumped and |
| 11 |
* the readme will list any important changes. |
| 12 |
* |
| 13 |
* @see https://docs.woocommerce.com/document/template-structure/ |
| 14 |
* @package WooCommerce\Templates |
| 15 |
* @version 3.5.0 |
| 16 |
*/ |
| 17 |
|
| 18 |
|
| 19 |
if ( ! defined( 'ABSPATH' ) ) { |
| 20 |
exit; |
| 21 |
} |
| 22 |
$hide_section_settings = \WPFunnels\Wpfnl_functions::get_checkout_section_heading_settings( 'order' , get_the_ID() ); |
| 23 |
$billing_active_cls =''; |
| 24 |
if( is_user_logged_in() ){ |
| 25 |
$billing_active_cls ='current'; |
| 26 |
}else { |
| 27 |
if( 'no' === get_option( 'woocommerce_enable_checkout_login_reminder' ) ){ |
| 28 |
$billing_active_cls ='current'; |
| 29 |
}else{ |
| 30 |
$billing_active_cls =''; |
| 31 |
} |
| 32 |
} |
| 33 |
|
| 34 |
|
| 35 |
$get_checkout_fields = get_post_meta(get_the_ID(),'wpfnl_checkout_additional_fields',true); |
| 36 |
$is_order_comments_enable = isset($get_checkout_fields['order_comments']['enable']) ? $get_checkout_fields['order_comments']['enable'] : true; |
| 37 |
?> |
| 38 |
<?php if( class_exists( '\WPFunnels\Wpfnl_functions' ) && \WPFunnels\Wpfnl_functions::is_wpfnl_pro_activated() && isset( $_SESSION[ 'checkout_layout' ] ) && ( 'wpfnl-express-checkout' === $_SESSION[ 'checkout_layout' ] || 'wpfnl-multistep' === $_SESSION[ 'checkout_layout' ] || 'wpfnl-2-step' === $_SESSION[ 'checkout_layout' ] )){?> |
| 39 |
<ul class="wpfnl-multistep-wizard"> |
| 40 |
<?php if( ! is_user_logged_in() && 'yes' === get_option( 'woocommerce_enable_checkout_login_reminder' ) ){ ?> |
| 41 |
<li class="login current"> |
| 42 |
<button type="button" data-target="login"> |
| 43 |
<span class="step-icon"> |
| 44 |
<?php include WPFNL_DIR.'public/assets/icons/icon-login.php'; ?> |
| 45 |
</span> |
| 46 |
<span class="step-title"> |
| 47 |
<?php esc_html_e( 'Login', 'wpfnl' ); ?> |
| 48 |
</span> |
| 49 |
</button> |
| 50 |
</li> |
| 51 |
<?php } ?> |
| 52 |
|
| 53 |
<?php if( is_user_logged_in() ){ ?> |
| 54 |
<li class="billing <?php echo $billing_active_cls; ?>"> |
| 55 |
<button type="button" data-target="billing"> |
| 56 |
<span class="step-icon"> |
| 57 |
<?php include WPFNL_DIR.'public/assets/icons/icon-billing.php'; ?> |
| 58 |
</span> |
| 59 |
<span class="step-title"> |
| 60 |
<?php esc_html_e( 'Billing', 'wpfnl' ); ?> |
| 61 |
</span> |
| 62 |
</button> |
| 63 |
</li> |
| 64 |
<?php if( $is_order_comments_enable || WC()->cart->needs_shipping_address()) { ?> |
| 65 |
<li class="shipping"> |
| 66 |
<button type="button" data-target="shipping"> |
| 67 |
<span class="step-icon"> |
| 68 |
<?php include WPFNL_DIR.'public/assets/icons/icon-shipping.php'; ?> |
| 69 |
</span> |
| 70 |
<?php if( WC()->cart->needs_shipping_address() ){ ?> |
| 71 |
<span class="step-title"> |
| 72 |
<?php esc_html_e( 'Shipping', 'wpfnl' ); ?> |
| 73 |
</span> |
| 74 |
<?php }else{ ?> |
| 75 |
<span class="step-title"> |
| 76 |
<?php esc_html_e( 'Additional Information', 'wpfnl' ); ?> |
| 77 |
</span> |
| 78 |
<?php } ?> |
| 79 |
</button> |
| 80 |
</li> |
| 81 |
<?php } ?> |
| 82 |
|
| 83 |
|
| 84 |
<li class="order-review"> |
| 85 |
<button type="button" data-target="order-review"> |
| 86 |
<span class="step-icon"> |
| 87 |
<?php include WPFNL_DIR.'public/assets/icons/icon-order-review.php'; ?> |
| 88 |
</span> |
| 89 |
<span class="step-title"> |
| 90 |
<?php esc_html_e( 'Your order', 'wpfnl' ); ?> |
| 91 |
</span> |
| 92 |
</button> |
| 93 |
</li> |
| 94 |
<?php }else{ |
| 95 |
|
| 96 |
if( ! $checkout->is_registration_required() || 'yes' === get_option( 'woocommerce_enable_checkout_login_reminder' ) || $checkout->is_registration_enabled() ){ |
| 97 |
?> |
| 98 |
<li class="billing <?php echo $billing_active_cls; ?>"> |
| 99 |
<button type="button" data-target="billing"> |
| 100 |
<span class="step-icon"> |
| 101 |
<?php include WPFNL_DIR.'public/assets/icons/icon-billing.php'; ?> |
| 102 |
</span> |
| 103 |
<span class="step-title"> |
| 104 |
<?php esc_html_e( 'Billing', 'wpfnl' ); ?> |
| 105 |
</span> |
| 106 |
</button> |
| 107 |
</li> |
| 108 |
<?php if( $is_order_comments_enable || WC()->cart->needs_shipping_address()) { ?> |
| 109 |
<li class="shipping"> |
| 110 |
<button type="button" data-target="shipping"> |
| 111 |
<span class="step-icon"> |
| 112 |
<?php include WPFNL_DIR.'public/assets/icons/icon-shipping.php'; ?> |
| 113 |
</span> |
| 114 |
<?php if( WC()->cart->needs_shipping_address() ){ ?> |
| 115 |
<span class="step-title"> |
| 116 |
<?php esc_html_e( 'Shipping', 'wpfnl' ); ?> |
| 117 |
</span> |
| 118 |
<?php }else{ ?> |
| 119 |
<span class="step-title"> |
| 120 |
<?php esc_html_e( 'Additional Information', 'wpfnl' ); ?> |
| 121 |
</span> |
| 122 |
<?php } ?> |
| 123 |
</button> |
| 124 |
</li> |
| 125 |
<?php } ?> |
| 126 |
<li class="order-review"> |
| 127 |
<button type="button" data-target="order-review"> |
| 128 |
<span class="step-icon"> |
| 129 |
<?php include WPFNL_DIR.'public/assets/icons/icon-order-review.php'; ?> |
| 130 |
</span> |
| 131 |
<span class="step-title"> |
| 132 |
<?php esc_html_e( 'Your order', 'wpfnl' ); ?> |
| 133 |
</span> |
| 134 |
</button> |
| 135 |
</li> |
| 136 |
<?php |
| 137 |
} |
| 138 |
} |
| 139 |
?> |
| 140 |
|
| 141 |
</ul> |
| 142 |
<?php } ?> |
| 143 |
|
| 144 |
<?php |
| 145 |
do_action( 'woocommerce_before_checkout_form', $checkout ); |
| 146 |
|
| 147 |
|
| 148 |
// If checkout registration is disabled and not logged in, the user cannot checkout. |
| 149 |
if ( ! $checkout->is_registration_enabled() && $checkout->is_registration_required() && ! is_user_logged_in() ) { |
| 150 |
echo esc_html( apply_filters( 'woocommerce_checkout_must_be_logged_in_message', __( 'You must be logged in to checkout.', 'wpfnl' ) ) ); |
| 151 |
return; |
| 152 |
} |
| 153 |
|
| 154 |
$loged_in_cls = ''; |
| 155 |
$create_acc_field = ''; |
| 156 |
if( ! is_user_logged_in() && 'yes' === get_option( 'woocommerce_enable_checkout_login_reminder' ) ){ |
| 157 |
$loged_in_cls = ' user-not-logedin '; |
| 158 |
} |
| 159 |
|
| 160 |
if( ! is_user_logged_in() && 'no' === get_option( 'woocommerce_enable_checkout_login_reminder' ) && $checkout->is_registration_required() ){ |
| 161 |
$create_acc_field = ' no-create-acc-field '; |
| 162 |
} |
| 163 |
|
| 164 |
|
| 165 |
// ---------- Instant checkout step include --------- |
| 166 |
$funnel_id = get_post_meta(get_the_ID(), '_funnel_id', true); |
| 167 |
$is_store_checkout = get_post_meta($funnel_id, '_wpfnl_funnel_type', true) === 'store_checkout'; |
| 168 |
|
| 169 |
$is_instant_checkout = true; |
| 170 |
if( isset( $_SESSION['checkout_layout'] ) && ( 'wpfnl-express-checkout' !== isset( $_SESSION['checkout_layout']) && 'wpfnl-multistep' !== isset( $_SESSION['checkout_layout']) && 'wpfnl-2-step' !== isset( $_SESSION['checkout_layout']) && 'wpfnl-modern-multistep' !== isset( $_SESSION['checkout_layout']) ) && $is_instant_checkout && $is_store_checkout){ |
| 171 |
include WPFNL_DIR.'public/modules/checkout/templates/instant-checkout-step.php'; |
| 172 |
} |
| 173 |
|
| 174 |
?> |
| 175 |
|
| 176 |
<form name="checkout" method="post" class="checkout woocommerce-checkout <?php echo $loged_in_cls.' '.$create_acc_field; ?>" action="<?php echo esc_url( wc_get_checkout_url() ); ?>" enctype="multipart/form-data"> |
| 177 |
|
| 178 |
<?php if ( $checkout->get_checkout_fields() ) : ?> |
| 179 |
|
| 180 |
<?php do_action( 'woocommerce_checkout_before_customer_details' ); ?> |
| 181 |
|
| 182 |
<div class="col2-set" id="customer_details"> |
| 183 |
<?php |
| 184 |
/** |
| 185 |
* Fires before customer details in checkout page |
| 186 |
* @since 2.8.21 |
| 187 |
*/ |
| 188 |
do_action( 'wpfunnels/before_customer_details' ); |
| 189 |
?> |
| 190 |
<div class="col-1" id="wpfnl_checkout_billing"> |
| 191 |
<?php do_action( 'woocommerce_checkout_billing' ); ?> |
| 192 |
|
| 193 |
</div> |
| 194 |
|
| 195 |
<div class="col-2" id="wpfnl_checkout_shipping"> |
| 196 |
<?php do_action( 'woocommerce_checkout_shipping' ); ?> |
| 197 |
</div> |
| 198 |
<?php |
| 199 |
/** |
| 200 |
* Fires after customer details in checkout page |
| 201 |
* @since 2.8.21 |
| 202 |
*/ |
| 203 |
do_action( 'wpfunnels/after_customer_details' ); |
| 204 |
?> |
| 205 |
</div> |
| 206 |
|
| 207 |
<?php do_action( 'woocommerce_checkout_after_customer_details' ); ?> |
| 208 |
|
| 209 |
<?php endif; ?> |
| 210 |
|
| 211 |
<?php do_action( 'woocommerce_checkout_before_order_review_heading' ); ?> |
| 212 |
|
| 213 |
<?php do_action( 'woocommerce_checkout_before_order_review' ); ?> |
| 214 |
|
| 215 |
<div id="order_review" class="woocommerce-checkout-review-order"> |
| 216 |
<?php if( !$hide_section_settings || ( isset($hide_section_settings['custom_heading']) && $hide_section_settings['custom_heading'] != '' ) ) { ?> |
| 217 |
<h3 id="order_review_heading"> |
| 218 |
<?php |
| 219 |
if( isset($hide_section_settings['custom_heading']) && $hide_section_settings['custom_heading'] != '' ){ |
| 220 |
esc_html_e( $hide_section_settings['custom_heading'] ); |
| 221 |
}else{ |
| 222 |
esc_html_e( 'Your order', 'wpfnl' ); |
| 223 |
} |
| 224 |
?> |
| 225 |
</h3> |
| 226 |
<?php } ?> |
| 227 |
|
| 228 |
<?php do_action( 'woocommerce_checkout_order_review' ); ?> |
| 229 |
</div> |
| 230 |
|
| 231 |
<?php do_action( 'woocommerce_checkout_after_order_review' ); ?> |
| 232 |
|
| 233 |
</form> |
| 234 |
<?php if(class_exists( '\WPFunnels\Wpfnl_functions' ) && \WPFunnels\Wpfnl_functions::is_wpfnl_pro_activated() && isset( $_SESSION[ 'checkout_layout' ] ) && ( 'wpfnl-express-checkout' === $_SESSION[ 'checkout_layout' ] || 'wpfnl-multistep' === $_SESSION[ 'checkout_layout' ] || 'wpfnl-2-step' === $_SESSION[ 'checkout_layout' ] ) ){ ?> |
| 235 |
<div class="wpfnl-multistep-navigation"> |
| 236 |
<button type="button" class="previous btn-default" data-target="" disabled><?php echo __( 'Previous', 'wpfnl' ); ?></button> |
| 237 |
<?php if( !is_user_logged_in() && 'yes' === get_option( 'woocommerce_enable_checkout_login_reminder' ) ){ ?> |
| 238 |
<button type="button" class="next btn-default" data-target="billing"><?php echo __( 'Next', 'wpfnl' ); ?></button> |
| 239 |
<?php }else{ ?> |
| 240 |
<button type="button" class="next btn-default" data-target="shipping"><?php echo __( 'Next', 'wpfnl' ); ?></button> |
| 241 |
<?php } ?> |
| 242 |
</div> |
| 243 |
<?php } ?> |
| 244 |
<?php do_action( 'woocommerce_after_checkout_form', $checkout ); ?> |
| 245 |
|