attributes = $this->parse_attributes( $attributes ); } /** * Get shortcode attributes. * * @since 3.2.0 * @return array */ public function get_attributes() { return $this->attributes; } /** * Parse attributes * * @param $attributes * * @return array */ protected function parse_attributes( $attributes ) { $attributes = shortcode_atts( array( 'type' => 'two-column', 'order_bump' => 'yes', 'class' => '' ), $attributes ); return $attributes; } /** * Get wrapper classes * * @return array */ protected function get_wrapper_classes() { $classes = array( 'wpfnl', 'wpfnl-order-details-wrapper' ); return $classes; } /** * Content of optin form * * @return string */ public function get_content() { if( Wpfnl_functions::check_if_this_is_step_type('checkout') ) { //===Coupon Enabler===// $coupon_enabler = get_post_meta(get_the_ID(), '_wpfnl_checkout_coupon', true); if ( $coupon_enabler != 'yes' ) { remove_action('woocommerce_before_checkout_form', 'woocommerce_checkout_coupon_form', 10); } $checkout_layout = ''; $session_value = ''; if( esc_html($this->attributes['type']) == 'one-column' ){ $checkout_layout = 'wpfnl-col-1'; $session_value = 'wpfnl-col-1'; }elseif( esc_html($this->attributes['type']) == 'two-column' ){ $checkout_layout = 'wpfnl-col-2'; $session_value = 'wpfnl-col-2'; }else{ if( Wpfnl_functions::is_wpfnl_pro_activated() && 'multistep' === esc_html($this->attributes['type']) ){ $checkout_layout = 'wpfnl-multistep'; $session_value = 'wpfnl-multistep'; }if( Wpfnl_functions::is_wpfnl_pro_activated() && 'wpfnl-two-step' === esc_html($this->attributes['type']) ){ $checkout_layout = 'wpfnl-2-step wpfnl-multistep '; $session_value = 'wpfnl-2-step'; }elseif( !Wpfnl_functions::is_wpfnl_pro_activated() && 'multistep' === esc_html($this->attributes['type']) ) { $checkout_layout = 'wpfnl-col-2'; $session_value = 'wpfnl-col-2'; }elseif( Wpfnl_functions::is_wpfnl_pro_activated() && 'wpfnl-express-checkout' === esc_html($this->attributes['type']) ) { $checkout_layout = 'wpfnl-express-checkout'; $session_value = 'wpfnl-express-checkout'; } } if( PHP_SESSION_DISABLED == session_status() ) { session_start(); } $_SESSION[ 'checkout_layout' ] = $session_value; if( Wpfnl_functions::is_wpfnl_pro_activated() && 'wpfnl-express-checkout' === $checkout_layout ) { $checkout_layout .= ' wpfnl-multistep'; } query_posts('post_type="checkout"'); if(sanitize_text_field($this->attributes['order_bump']) == 'yes'){ do_action( 'wpfunnels/before_checkout_form', get_the_ID() ); } $class = ''; if (isset($this->attributes['class']) && NUll != (esc_html($this->attributes['class']))){ $class = esc_html($this->attributes['class']); } $html = ''; $html .= '