class-cartflows-checkout.php000066600000001635152142140530012175 0ustar00utils->get_checkout_id_from_post_data(); if ( ! $checkout_id ) { return $args; } // Set cancel return URL. $args['cancel_return'] = esc_url_raw( $order->get_cancel_order_url_raw( get_permalink( $checkout_id ) ) ); return $args; } /** * Modify WooCommerce paypal arguments. * * @param string $product_name product name. * @param object $cart_item cart item. * @param string $cart_item_key cart item key. * @return string */ public function wcf_add_remove_label( $product_name, $cart_item, $cart_item_key ) { $checkout_id = get_the_ID(); if ( ! $checkout_id ) { $checkout_id = ( isset( $_POST['option']['checkout_id'] ) ) ? wp_unslash( $_POST['option']['checkout_id'] ) : '';//phpcs:ignore } if ( ! empty( $checkout_id ) ) { $is_remove_product_option = wcf()->options->get_checkout_meta_value( $checkout_id, 'wcf-remove-product-field' ); if ( 'checkout' === get_post_meta( $checkout_id, 'wcf-step-type', true ) && ( 'yes' === $is_remove_product_option ) ) { $remove_label = apply_filters( 'woocommerce_cart_item_remove_link', sprintf( '', esc_attr( $cart_item['product_id'] ), $cart_item_key ), $cart_item_key ); $product_name = $remove_label . $product_name; } } return $product_name; } /** * Change order button text . * * @param string $woo_button_text place order. * @return string */ public function place_order_button_text( $woo_button_text ) { $checkout_id = get_the_ID(); if ( ! $checkout_id ) { $checkout_id = ( isset( $_POST['option']['checkout_id'] ) ) ? intval( $_POST['option']['checkout_id'] ) : 0; //phpcs:ignore } $wcf_order_button_text = wcf()->options->get_checkout_meta_value( $checkout_id, 'wcf-checkout-place-order-button-text' ); if ( ! empty( $wcf_order_button_text ) ) { $woo_button_text = $wcf_order_button_text; } return $woo_button_text; } /** * Display all WooCommerce notices. * * @since 1.1.5 */ public function display_woo_notices() { if ( null != WC()->session && function_exists( 'woocommerce_output_all_notices' ) ) { woocommerce_output_all_notices(); } } /** * Redirect from default to the global checkout page * * @since 1.0.0 */ public function global_checkout_template_redirect() { if ( ! is_checkout() ) { return; } if ( wcf()->utils->is_step_post_type() ) { return; } // Return if the key OR Order paramater is found in the URL for certain Payment gateways. if ( isset( $_GET['key'] ) || isset( $_GET['order'] ) ) { //phpcs:ignore return; } // redirect only for cartflows checkout pages. $order_pay_endpoint = get_option( 'woocommerce_checkout_pay_endpoint', 'order-pay' ); $order_received_endpoint = get_option( 'woocommerce_checkout_order_received_endpoint', 'order-received' ); $common = Cartflows_Helper::get_common_settings(); $global_checkout = $common['global_checkout']; if ( isset( $_SERVER['REQUEST_URI'] ) && // ignore on order-pay. false === wcf_mb_strpos( esc_url_raw( wp_unslash( $_SERVER['REQUEST_URI'] ) ), '/' . $order_pay_endpoint . '/' ) && // ignore on TY page. false === wcf_mb_strpos( esc_url_raw( wp_unslash( $_SERVER['REQUEST_URI'] ) ), '/' . $order_received_endpoint . '/' ) && // ignore if order-pay in query param. false === wcf_mb_strpos( esc_url_raw( wp_unslash( $_SERVER['REQUEST_URI'] ) ), $order_pay_endpoint . '=' ) ) { if ( '' !== $global_checkout ) { $link = apply_filters( 'cartflows_global_checkout_url', get_permalink( $global_checkout ) ); if ( ! empty( $link ) ) { wp_safe_redirect( $link ); die(); } } } } /** * Check for checkout flag * * @param bool $is_checkout is checkout. * * @return bool */ public function woo_checkout_flag( $is_checkout ) { if ( ! is_admin() ) { if ( _is_wcf_checkout_type() || _is_wcf_checkout_shortcode() ) { $is_checkout = true; } } return $is_checkout; } /** * Render checkout shortcode markup. * * @param array $atts attributes. * @return string */ public function checkout_shortcode_markup( $atts ) { if ( ! function_exists( 'wc_print_notices' ) ) { $notice_out = '

' . __( 'WooCommerce functions do not exist. If you are in an IFrame, please reload it.', 'cartflows' ) . '

'; $notice_out .= ''; return $notice_out; } $atts = shortcode_atts( array( 'id' => 0, ), $atts ); $checkout_id = intval( $atts['id'] ); if ( empty( $checkout_id ) ) { if ( ! _is_wcf_checkout_type() ) { return '

' . __( 'Checkout ID not found', 'cartflows' ) . '

'; } global $post; $checkout_id = intval( $post->ID ); } $output = ''; ob_start(); do_action( 'cartflows_checkout_form_before', $checkout_id ); $checkout_layout = wcf()->options->get_checkout_meta_value( $checkout_id, 'wcf-checkout-layout' ); $template_default = CARTFLOWS_CHECKOUT_DIR . 'templates/embed/checkout-template-simple.php'; $template_layout = apply_filters( 'cartflows_checkout_layout_template', $checkout_layout ); if ( file_exists( $template_layout ) ) { include $template_layout; } else { include $template_default; } $output .= ob_get_clean(); return $output; } /** * Configure Cart Data. * * @since 1.0.0 * * @return void */ public function preconfigured_cart_data() { if ( is_admin() ) { return; } global $post; if ( _is_wcf_checkout_type() || _is_wcf_checkout_shortcode() ) { if ( wp_doing_ajax() ) { return; } else { if ( _is_wcf_checkout_type() ) { $checkout_id = $post->ID; } else { $checkout_id = _get_wcf_checkout_id_from_shortcode( $post->post_content ); } $global_checkout = intval( Cartflows_Helper::get_common_setting( 'global_checkout' ) ); if ( ! empty( $global_checkout ) && $checkout_id === $global_checkout ) { if ( WC()->cart->is_empty() ) { wc_add_notice( __( 'Your cart is currently empty.', 'cartflows' ), 'error' ); } return; } if ( apply_filters( 'cartflows_skip_configure_cart', false, $checkout_id ) ) { return; } do_action( 'cartflows_checkout_before_configure_cart', $checkout_id ); $flow_id = wcf()->utils->get_flow_id_from_step_id( $checkout_id ); if ( wcf()->flow->is_flow_testmode( $flow_id ) ) { $products = wcf()->options->get_checkout_meta_value( $checkout_id, 'wcf-checkout-products', 'dummy' ); } else { $products = wcf()->options->get_checkout_meta_value( $checkout_id, 'wcf-checkout-products' ); } if ( ! is_array( $products ) ) { if ( 'dummy' === $products ) { $args = array( 'posts_per_page' => 1, 'orderby' => 'rand', 'post_type' => 'product', 'meta_query' => array( //phpcs:ignore // Exclude out of stock products. array( 'key' => '_stock_status', 'value' => 'outofstock', 'compare' => 'NOT IN', ), ), 'tax_query' => array( //phpcs:ignore array( 'taxonomy' => 'product_type', 'field' => 'slug', 'terms' => 'simple', ), ), ); $random_product = get_posts( $args ); if ( isset( $random_product[0]->ID ) ) { $products = array( array( 'product' => $random_product[0]->ID, ), ); } else { return; } } else { return; } } /* Empty the current cart */ WC()->cart->empty_cart(); if ( is_array( $products ) && count( $products ) < 1 ) { wc_add_notice( __( 'No product is selected. Please select products from the checkout meta settings to continue.', 'cartflows' ), 'error' ); return; } /* Set customer session if not set */ if ( ! is_user_logged_in() && WC()->cart->is_empty() ) { WC()->session->set_customer_session_cookie( true ); } $cart_product_count = 0; foreach ( $products as $index => $data ) { if ( ! isset( $data['product'] ) ) { return; } if ( apply_filters( 'cartflows_skip_other_products', false, $cart_product_count ) ) { break; } $product_id = $data['product']; $_product = wc_get_product( $product_id ); if ( ! empty( $_product ) ) { $quantity = 1; if ( ! $_product->is_type( 'grouped' ) && ! $_product->is_type( 'external' ) ) { if ( $_product->is_type( 'variable' ) ) { $default_attributes = $_product->get_default_attributes(); if ( ! empty( $default_attributes ) ) { foreach ( $_product->get_children() as $variation_id ) { $single_variation = new WC_Product_Variation( $variation_id ); if ( $default_attributes == $single_variation->get_attributes() ) { WC()->cart->add_to_cart( $variation_id, $quantity ); $cart_product_count++; } } } else { $product_childrens = $_product->get_children(); if ( isset( $product_childrens[0] ) ) { WC()->cart->add_to_cart( $product_childrens[0], $quantity ); $cart_product_count++; } else { echo '

' . esc_html__( 'Variations Not set', 'cartflows' ) . '

'; } } } else { WC()->cart->add_to_cart( $product_id, $quantity ); $cart_product_count++; } } else { $wrong_product_notice = __( 'This product can\'t be purchased', 'cartflows' ); wc_add_notice( $wrong_product_notice ); /** WC()->cart->add_to_cart( $product_id, $quantity );. */ } } } /* Since 1.2.2 */ wcf_do_action_deprecated( 'cartflows_checkout_aftet_configure_cart', array( $checkout_id ), '1.2.2', 'cartflows_checkout_after_configure_cart' ); do_action( 'cartflows_checkout_after_configure_cart', $checkout_id ); } } } /** * Load shortcode data. * * @return void */ public function shortcode_load_data() { if ( _is_wcf_checkout_type() || _is_wcf_checkout_shortcode() ) { add_action( 'wp_enqueue_scripts', array( $this, 'shortcode_scripts' ), 21 ); add_action( 'wp_enqueue_scripts', array( $this, 'compatibility_scripts' ), 101 ); /* Show notices if cart has errors */ add_action( 'woocommerce_cart_has_errors', 'woocommerce_output_all_notices' ); add_action( 'woocommerce_checkout_after_customer_details', array( $this, 'order_wrap_div_start' ), 99 ); add_action( 'woocommerce_checkout_after_order_review', array( $this, 'order_wrap_div_end' ), 99 ); // Outputting the hidden field in checkout page. add_action( 'woocommerce_after_order_notes', array( $this, 'checkout_shortcode_post_id' ), 99 ); add_action( 'woocommerce_login_form_end', array( $this, 'checkout_shortcode_post_id' ), 99 ); remove_all_actions( 'woocommerce_checkout_billing' ); remove_all_actions( 'woocommerce_checkout_shipping' ); // Hook in actions once. add_action( 'woocommerce_checkout_billing', array( WC()->checkout, 'checkout_form_billing' ) ); add_action( 'woocommerce_checkout_shipping', array( WC()->checkout, 'checkout_form_shipping' ) ); remove_action( 'woocommerce_before_checkout_form', 'woocommerce_checkout_coupon_form' ); add_action( 'woocommerce_checkout_order_review', array( $this, 'display_custom_coupon_field' ) ); add_filter( 'woocommerce_checkout_fields', array( $this, 'add_three_column_layout_fields' ) ); add_filter( 'woocommerce_cart_totals_coupon_html', array( $this, 'remove_coupon_text' ) ); add_filter( 'woocommerce_order_button_text', array( $this, 'place_order_button_text' ), 10, 1 ); global $post; if ( _is_wcf_checkout_type() ) { $checkout_id = $post->ID; } else { $checkout_id = _get_wcf_checkout_id_from_shortcode( $post->post_content ); } do_action( 'cartflows_checkout_before_shortcode', $checkout_id ); } } /** * Render checkout ID hidden field. * * @param array $checkout checkout session data. * @return void */ public function checkout_shortcode_post_id( $checkout ) { global $post; if ( _is_wcf_checkout_type() ) { $checkout_id = $post->ID; } else { $checkout_id = _get_wcf_checkout_id_from_shortcode( $post->post_content ); } $flow_id = get_post_meta( $checkout_id, 'wcf-flow-id', true ); echo ''; echo ''; } /** * Load shortcode scripts. * * @return void */ public function shortcode_scripts() { wp_enqueue_style( 'wcf-checkout-template', wcf()->utils->get_css_url( 'checkout-template' ), '', CARTFLOWS_VER ); wp_enqueue_script( 'wcf-checkout-template', wcf()->utils->get_js_url( 'checkout-template' ), array( 'jquery' ), CARTFLOWS_VER, true ); do_action( 'cartflows_checkout_scripts' ); $style = $this->generate_style(); wp_add_inline_style( 'wcf-checkout-template', $style ); } /** * Load compatibility scripts. * * @return void */ public function compatibility_scripts() { global $post; if ( _is_wcf_checkout_type() ) { $checkout_id = $post->ID; } else { $checkout_id = _get_wcf_checkout_id_from_shortcode( $post->post_content ); } // Add DIVI Compatibility css if DIVI theme is enabled. if ( Cartflows_Compatibility::get_instance()->is_divi_enabled() || Cartflows_Compatibility::get_instance()->is_divi_builder_enabled( $checkout_id ) ) { wp_enqueue_style( 'wcf-checkout-template-divi', wcf()->utils->get_css_url( 'checkout-template-divi' ), '', CARTFLOWS_VER ); } // Add Flatsome Compatibility css if Flatsome theme is enabled. if ( Cartflows_Compatibility::get_instance()->is_flatsome_enabled() ) { wp_enqueue_style( 'wcf-checkout-template-flatsome', wcf()->utils->get_css_url( 'checkout-template-flatsome' ), '', CARTFLOWS_VER ); } // Add The7 Compatibility css if The7 theme is enabled. if ( Cartflows_Compatibility::get_instance()->is_the_seven_enabled() ) { wp_enqueue_style( 'wcf-checkout-template-the-seven', wcf()->utils->get_css_url( 'checkout-template-the-seven' ), '', CARTFLOWS_VER ); } } /** * Generate styles. * * @return string */ public function generate_style() { global $post; if ( _is_wcf_checkout_type() ) { $checkout_id = $post->ID; } else { $checkout_id = _get_wcf_checkout_id_from_shortcode( $post->post_content ); } /*Output css variable */ $output = ''; CartFlows_Font_Families::render_fonts( $checkout_id ); $primary_color = wcf()->options->get_checkout_meta_value( $checkout_id, 'wcf-primary-color' ); $base_font_family = wcf()->options->get_checkout_meta_value( $checkout_id, 'wcf-base-font-family' ); $header_logo_width = wcf()->options->get_checkout_meta_value( $checkout_id, 'wcf-header-logo-width' ); /** $base_font_weight = wcf()->options->get_checkout_meta_value( $checkout_id, 'wcf-base-font-weight' );*/ $r = ''; $g = ''; $b = ''; $field_tb_padding = ''; $field_lr_padding = ''; $field_heading_color = ''; $field_color = ''; $field_bg_color = ''; $field_border_color = ''; $field_label_color = ''; $submit_tb_padding = ''; $submit_lr_padding = ''; $hl_bg_color = ''; $field_input_size = ''; $box_border_color = ''; $section_bg_color = ''; $submit_button_height = ''; $submit_color = ''; $submit_bg_color = $primary_color; $submit_border_color = $primary_color; $submit_hover_color = ''; $submit_bg_hover_color = $primary_color; $submit_border_hover_color = $primary_color; $section_heading_color = ''; $is_advance_option = wcf()->options->get_checkout_meta_value( $checkout_id, 'wcf-advance-options-fields' ); $button_font_family = ''; $button_font_weight = ''; $input_font_family = ''; $input_font_weight = ''; $heading_font_family = ''; $heading_font_weight = ''; $base_font_family = $base_font_family; /** $base_font_weight = $base_font_weight;*/ if ( 'yes' == $is_advance_option ) { /** * Get Font Family and Font Weight weight values */ $section_bg_color = wcf()->options->get_checkout_meta_value( $checkout_id, 'wcf-section-bg-color' ); $heading_font_family = wcf()->options->get_checkout_meta_value( $checkout_id, 'wcf-heading-font-family' ); $heading_font_weight = wcf()->options->get_checkout_meta_value( $checkout_id, 'wcf-heading-font-weight' ); $section_heading_color = wcf()->options->get_checkout_meta_value( $checkout_id, 'wcf-heading-color' ); $button_font_family = wcf()->options->get_checkout_meta_value( $checkout_id, 'wcf-button-font-family' ); $button_font_weight = wcf()->options->get_checkout_meta_value( $checkout_id, 'wcf-button-font-weight' ); $input_font_family = wcf()->options->get_checkout_meta_value( $checkout_id, 'wcf-input-font-family' ); $input_font_weight = wcf()->options->get_checkout_meta_value( $checkout_id, 'wcf-input-font-weight' ); $field_tb_padding = wcf()->options->get_checkout_meta_value( $checkout_id, 'wcf-field-tb-padding' ); $field_lr_padding = wcf()->options->get_checkout_meta_value( $checkout_id, 'wcf-field-lr-padding' ); $field_input_size = wcf()->options->get_checkout_meta_value( $checkout_id, 'wcf-input-field-size' ); $field_heading_color = wcf()->options->get_checkout_meta_value( $checkout_id, 'wcf-field-heading-color' ); $field_color = wcf()->options->get_checkout_meta_value( $checkout_id, 'wcf-field-color' ); $field_bg_color = wcf()->options->get_checkout_meta_value( $checkout_id, 'wcf-field-bg-color' ); $field_border_color = wcf()->options->get_checkout_meta_value( $checkout_id, 'wcf-field-border-color' ); $field_label_color = wcf()->options->get_checkout_meta_value( $checkout_id, 'wcf-field-label-color' ); $submit_tb_padding = wcf()->options->get_checkout_meta_value( $checkout_id, 'wcf-submit-tb-padding' ); $submit_lr_padding = wcf()->options->get_checkout_meta_value( $checkout_id, 'wcf-submit-lr-padding' ); $submit_color = wcf()->options->get_checkout_meta_value( $checkout_id, 'wcf-submit-color' ); $submit_bg_color = wcf()->options->get_checkout_meta_value( $checkout_id, 'wcf-submit-bg-color', $primary_color ); $submit_border_color = wcf()->options->get_checkout_meta_value( $checkout_id, 'wcf-submit-border-color', $primary_color ); $submit_border_hover_color = wcf()->options->get_checkout_meta_value( $checkout_id, 'wcf-submit-border-hover-color', $primary_color ); $submit_hover_color = wcf()->options->get_checkout_meta_value( $checkout_id, 'wcf-submit-hover-color' ); $submit_bg_hover_color = wcf()->options->get_checkout_meta_value( $checkout_id, 'wcf-submit-bg-hover-color', $primary_color ); $hl_bg_color = wcf()->options->get_checkout_meta_value( $checkout_id, 'wcf-hl-bg-color' ); $box_border_color = wcf()->options->get_checkout_meta_value( $checkout_id, 'wcf-box-border-color' ); $submit_button_height = wcf()->options->get_checkout_meta_value( $checkout_id, 'wcf-input-button-size' ); /** * Get font values */ if ( 'custom' == $submit_button_height ) { $submit_button_height = '38px'; } if ( 'custom' == $field_input_size ) { $field_input_size = '38px'; } } if ( isset( $primary_color ) ) { list($r, $g, $b) = sscanf( $primary_color, '#%02x%02x%02x' ); } if ( Cartflows_Compatibility::get_instance()->is_divi_enabled() || Cartflows_Compatibility::get_instance()->is_divi_builder_enabled( $checkout_id ) ) { include CARTFLOWS_CHECKOUT_DIR . 'includes/checkout-dynamic-divi-css.php'; } else { include CARTFLOWS_CHECKOUT_DIR . 'includes/checkout-dynamic-css.php'; } return $output; } /** * Get ajax end points. * * @param string $endpoint_url end point URL. * @param string $request end point request. * @return string */ public function get_ajax_endpoint( $endpoint_url, $request ) { global $post; if ( ! empty( $post ) && ! empty( $_SERVER['REQUEST_URI'] ) ) { if ( _is_wcf_checkout_type() ) { if ( mb_strpos( $endpoint_url, 'checkout', 0, 'utf-8' ) === false ) { if ( '' === $request ) { $query_args = array( 'wc-ajax' => '%%endpoint%%', ); } else { $query_args = array( 'wc-ajax' => $request, ); } $uri = explode( '?', $_SERVER['REQUEST_URI'], 2 ); //phpcs:ignore $uri = $uri[0]; $endpoint_url = esc_url( add_query_arg( $query_args, $uri ) ); } } } return $endpoint_url; } /** * Save checkout fields. * * @param int $order_id order id. * @param array $posted posted data. * @return void */ public function save_checkout_fields( $order_id, $posted ) { if ( isset( $_POST['_wcf_checkout_id'] ) ) { //phpcs:ignore $checkout_id = wc_clean( intval( $_POST['_wcf_checkout_id'] ) ); //phpcs:ignore update_post_meta( $order_id, '_wcf_checkout_id', $checkout_id ); if ( isset( $_POST['_wcf_flow_id'] ) ) { //phpcs:ignore $flow_id = wc_clean( intval( $_POST['_wcf_flow_id'] ) ); //phpcs:ignore update_post_meta( $order_id, '_wcf_flow_id', $flow_id ); } } } /** * Enable Logo In Header Of Checkout Page * * @return void */ public function enable_logo_in_header() { global $post; if ( _is_wcf_checkout_type() ) { $checkout_id = $post->ID; } else { $checkout_id = _get_wcf_checkout_id_from_shortcode( $post->post_content ); } $header_logo_image = wcf()->options->get_checkout_meta_value( $checkout_id, 'wcf-header-logo-image' ); $add_image_markup = ''; if ( isset( $header_logo_image ) && ! empty( $header_logo_image ) ) { $add_image_markup = '
'; $add_image_markup .= ''; $add_image_markup .= '
'; } echo $add_image_markup; } /** * Add text to the bootom of the checkout page. * * @return void */ public function show_cartflows_copyright_message() { $output_string = ''; $output_string .= ''; echo $output_string; } /** * Redirect users to our checkout if hidden param * * @param string $redirect redirect url. * @param object $user user. * @return string */ public function after_login_redirect( $redirect, $user ) { if ( isset( $_POST['_wcf_checkout_id'] ) ) { //phpcs:ignore $checkout_id = intval( $_POST['_wcf_checkout_id'] ); //phpcs:ignore $redirect = get_permalink( $checkout_id ); } return $redirect; } /** * Display coupon code field after review order fields. */ public function display_custom_coupon_field() { $coupon_enabled = apply_filters( 'woocommerce_coupons_enabled', true ); $show_coupon = apply_filters( 'cartflows_show_coupon_field', true ); if ( ! ( $coupon_enabled && $show_coupon ) ) { return; } $coupon_field = array( 'field_text' => __( 'Coupon Code', 'cartflows' ), 'button_text' => __( 'Apply', 'cartflows' ), 'class' => '', ); $coupon_field = apply_filters( 'cartflows_coupon_field_options', $coupon_field ); ob_start(); ?>
cart->add_discount( sanitize_text_field( wp_unslash( $_POST['coupon_code'] ) ) ); } else { wc_add_notice( WC_Coupon::get_generic_coupon_error( WC_Coupon::E_WC_COUPON_PLEASE_ENTER ), 'error' ); } $response = array( 'status' => $result, 'msg' => wc_print_notices( true ), ); echo wp_json_encode( $response ); die(); } /** * Added ajax nonce to localize variable. * * @param array $vars localize variables. */ public function add_localize_vars( $vars ) { $vars['wcf_validate_coupon_nonce'] = wp_create_nonce( 'wcf-apply-coupon' ); $vars['wcf_validate_remove_coupon_nonce'] = wp_create_nonce( 'wcf-remove-coupon' ); $vars['wcf_validate_remove_cart_product_nonce'] = wp_create_nonce( 'wcf-remove-cart-product' ); $vars['allow_persistance'] = apply_filters( 'cartflows_allow_persistace', 'yes' ); return $vars; } /** * Add custom class to the fields to change the UI to three column. * * @param array $fields fields. */ public function add_three_column_layout_fields( $fields ) { if ( empty( $fields['billing']['billing_address_2'] ) ) { if ( isset( $fields['billing']['billing_address_1'] ) && is_array( $fields['billing']['billing_address_1'] ) ) { $fields['billing']['billing_address_1']['class'][] = 'form-row-full'; } } if ( ! empty( $fields['billing']['billing_company'] ) ) { if ( isset( $fields['billing']['billing_company'] ) && is_array( $fields['billing']['billing_company'] ) ) { $fields['billing']['billing_company']['class'][] = 'form-row-full'; } } if ( ! empty( $fields['shipping']['shipping_company'] ) ) { if ( isset( $fields['shipping']['shipping_company'] ) && is_array( $fields['shipping']['shipping_company'] ) ) { $fields['shipping']['shipping_company']['class'][] = 'form-row-full'; } } if ( ! empty( $fields['billing']['billing_country'] ) ) { if ( isset( $fields['billing']['billing_country'] ) && is_array( $fields['billing']['billing_country'] ) ) { $fields['billing']['billing_country']['class'][] = 'form-row-full'; } } if ( ! empty( $fields['shipping']['shipping_country'] ) ) { if ( isset( $fields['shipping']['shipping_country'] ) && is_array( $fields['shipping']['shipping_country'] ) ) { $fields['shipping']['shipping_country']['class'][] = 'form-row-full'; } } if ( ! empty( $fields['billing']['billing_phone'] ) ) { if ( isset( $fields['billing']['billing_phone'] ) && is_array( $fields['billing']['billing_phone'] ) ) { $fields['billing']['billing_phone']['class'][] = 'form-row-full'; } } if ( ! empty( $fields['billing']['billing_email'] ) ) { if ( isset( $fields['billing']['billing_email'] ) && is_array( $fields['billing']['billing_email'] ) ) { $fields['billing']['billing_email']['class'][] = 'form-row-full'; } } if ( empty( $fields['shipping']['shipping_address_2'] ) ) { if ( isset( $fields['shipping']['shipping_address_1'] ) && is_array( $fields['shipping']['shipping_address_1'] ) ) { $fields['shipping']['shipping_address_1']['class'][] = 'form-row-full'; } } if ( isset( $fields['billing']['billing_city'] ) && isset( $fields['billing']['billing_state'] ) && isset( $fields['billing']['billing_postcode'] ) ) { $fields['billing']['billing_city']['class'][] = 'wcf-column-33'; $fields['billing']['billing_state']['class'][] = 'wcf-column-33'; $fields['billing']['billing_postcode']['class'][] = 'wcf-column-33'; } if ( isset( $fields['shipping']['shipping_city'] ) && isset( $fields['shipping']['shipping_state'] ) && isset( $fields['shipping']['shipping_postcode'] ) ) { $fields['shipping']['shipping_city']['class'][] = 'wcf-column-33'; $fields['shipping']['shipping_state']['class'][] = 'wcf-column-33'; $fields['shipping']['shipping_postcode']['class'][] = 'wcf-column-33'; } return $fields; } /** * Add opening dev * * @since 1.0.0 */ public function order_wrap_div_start() { echo "
"; } /** * Add closing dev * * @since 1.0.0 */ public function order_wrap_div_end() { echo '
'; } /** * Remove coupon. */ public function remove_coupon() { check_ajax_referer( 'wcf-remove-coupon', 'security' ); $coupon = isset( $_POST['coupon_code'] ) ? wc_clean( wp_unslash( $_POST['coupon_code'] ) ) : false; //phpcs:ignore if ( empty( $coupon ) ) { echo "
" . esc_html__( 'Sorry there was a problem removing this coupon.', 'cartflows' ); } else { WC()->cart->remove_coupon( $coupon ); echo "
" . esc_html__( 'Coupon has been removed.', 'cartflows' ) . '
'; } wc_print_notices(); wp_die(); } /** * Remove cart item. */ public function wcf_woo_remove_cart_product() { check_ajax_referer( 'wcf-remove-cart-product', 'security' ); $product_key = isset( $_POST['p_key'] ) ? wc_clean( wp_unslash( $_POST['p_key'] ) ) : false; //phpcs:ignore $product_id = isset( $_POST['p_id'] ) ? wc_clean( wp_unslash( $_POST['p_id'] ) ) : ''; //phpcs:ignore $product_title = get_the_title( $product_id ); $needs_shipping = false; if ( empty( $product_key ) ) { $msg = "
" . __( 'Sorry there was a problem removing ', 'cartflows' ) . $product_title; } else { WC()->cart->remove_cart_item( $product_key ); $msg = "
" . $product_title . __( ' has been removed.', 'cartflows' ) . '
'; } foreach ( WC()->cart->get_cart() as $cart_item_key => $values ) { if ( $values['data']->needs_shipping() ) { $needs_shipping = true; break; } } $response = array( 'need_shipping' => $needs_shipping, 'msg' => $msg, ); echo wp_json_encode( $response ); wp_die(); } } /** * Kicking this off by calling 'get_instance()' method */ Cartflows_Checkout_Markup::get_instance(); classes/class-cartflows-checkout-meta.php000066600000064023152142140530014556 0ustar00utils->get_step_post_type(), // Post_type. 'normal', // Context. 'high' // Priority. ); } } /** * Metabox Markup * * @param object $post Post object. * @return void */ public function markup_meta_box( $post ) { wp_nonce_field( 'save-nonce-checkout-step-meta', 'nonce-checkout-step-meta' ); $stored = get_post_meta( $post->ID ); $checkout_meta = self::get_meta_option( $post->ID ); // Set stored and override defaults. foreach ( $stored as $key => $value ) { if ( array_key_exists( $key, $checkout_meta ) ) { self::$meta_option[ $key ]['default'] = ( isset( $stored[ $key ][0] ) ) ? maybe_unserialize( $stored[ $key ][0] ) : ''; } else { self::$meta_option[ $key ]['default'] = ( isset( $stored[ $key ][0] ) ) ? $stored[ $key ][0] : ''; } } // Get defaults. $meta = self::get_meta_option( $post->ID ); $checkout_data = array(); foreach ( $meta as $key => $value ) { $checkout_data[ $key ] = $meta[ $key ]['default']; } /** $billing_fields = Cartflows_Helper::get_checkout_fields( 'billing', $post->ID ); // For loop foreach ( $billing_fields as $key => $value ) { $checkout_data[ 'wcf-' . $key ] = $meta[ 'wcf-' . $key ]['default']; } $shipping_fields = Cartflows_Helper::get_checkout_fields( 'shipping', $post->ID ); foreach ( $shipping_fields as $key => $value ) { $checkout_data[ 'wcf-' . $key ] = $meta[ 'wcf-' . $key ]['default']; } $additional_fields = Cartflows_Helper::get_checkout_fields( 'additional', $post->ID ); foreach ( $additional_fields as $key => $value ) { $checkout_data[ 'wcf-' . $key ] = $meta[ 'wcf-' . $key ]['default']; } */ do_action( 'wcf_checkout_settings_markup_before' ); $this->tabs_markup( $checkout_data, $post->ID ); do_action( 'wcf_checkout_settings_markup_after' ); } /** * Page Header Tabs * * @param array $options options. * @param int $post_id post ID. */ public function tabs_markup( $options, $post_id ) { $active_tab = get_post_meta( $post_id, 'wcf-active-tab', true ); if ( empty( $active_tab ) ) { $active_tab = 'wcf-checkout-shortcodes'; } $tab_array = array( array( 'title' => __( 'Shortcodes', 'cartflows' ), 'id' => 'wcf-checkout-shortcodes', 'class' => 'wcf-checkout-shortcodes' === $active_tab ? 'wcf-tab wp-ui-text-highlight active' : 'wcf-tab', 'icon' => 'dashicons-editor-code', ), array( 'title' => __( 'Select Product', 'cartflows' ), 'id' => 'wcf-checkout-general', 'class' => 'wcf-checkout-general' === $active_tab ? 'wcf-tab wp-ui-text-highlight active' : 'wcf-tab', 'icon' => 'dashicons-info', ), array( 'title' => __( 'Order Bump', 'cartflows' ), 'id' => 'wcf-product-order-bump', 'class' => 'wcf-product-order-bump' === $active_tab ? 'wcf-tab wp-ui-text-highlight active' : 'wcf-tab', 'icon' => 'dashicons-cart', ), array( 'title' => __( 'Checkout Offer', 'cartflows' ), 'id' => 'wcf-pre-checkout-offer', 'class' => 'wcf-pre-checkout-offer' === $active_tab ? 'wcf-tab wp-ui-text-highlight active' : 'wcf-tab', 'icon' => 'dashicons-arrow-up-alt', ), array( 'title' => __( 'Checkout Design', 'cartflows' ), 'id' => 'wcf-checkout-style', 'class' => 'wcf-checkout-style' === $active_tab ? 'wcf-tab wp-ui-text-highlight active' : 'wcf-tab', 'icon' => 'dashicons-admin-customizer', ), array( 'title' => __( 'Checkout Fields', 'cartflows' ), 'id' => 'wcf-checkout-custom-fields', 'class' => 'wcf-checkout-custom-fields' === $active_tab ? 'wcf-tab wp-ui-text-highlight active' : 'wcf-tab', 'icon' => 'dashicons-welcome-widgets-menus', ), array( 'title' => __( 'Checkout Settings', 'cartflows' ), 'id' => 'wcf-checkout-custom-settings', 'class' => 'wcf-checkout-custom-settings' === $active_tab ? 'wcf-tab wp-ui-text-highlight active' : 'wcf-tab', 'icon' => 'dashicons-admin-generic', ), array( 'title' => __( 'Custom Script', 'cartflows' ), 'id' => 'wcf-checkout-custom-script-header', 'class' => 'wcf-checkout-custom-script-header' === $active_tab ? 'wcf-tab wp-ui-text-highlight active' : 'wcf-tab', 'icon' => 'dashicons-format-aside', ), ); $show_logo = filter_input( INPUT_GET, 'logo-tab', FILTER_VALIDATE_BOOLEAN ); if ( $show_logo ) { $logo_tab = array( 'title' => __( 'Logo (Optional)', 'cartflows' ), 'id' => 'wcf-checkout-header', 'class' => 'wcf-checkout-header' === $active_tab ? 'wcf-tab wp-ui-text-highlight active' : 'wcf-tab', 'icon' => 'dashicons-format-image', ); array_push( $tab_array, $logo_tab ); } $tabs = apply_filters( 'cartflows_checkout_tabs', $tab_array, $active_tab ); ?>
$tab ) { ?>
tab_shortcodes( $options, $post_id ); ?> tab_general( $options, $post_id ); ?> tab_style( $options, $post_id ); ?> tab_pre_checkout_offer( $options, $post_id ); ?> tab_product_bump( $options, $post_id ); ?> tab_custom_fields( $options, $post_id ); ?> tab_custom_settings( $options, $post_id ); ?> tab_header_content( $options, $post_id ); ?> tab_custom_script( $options, $post_id ); ?> right_column_footer( $options, $post_id ); ?>
meta->get_shortcode_field( array( 'label' => 'Checkout Page', 'name' => 'wcf-checkout-shortcode', 'content' => '[cartflows_checkout]', 'help' => esc_html__( 'Add this shortcode to your checkout page', 'cartflows' ), ) ); ?>
meta->get_product_selection_repeater( array( 'name' => 'wcf-checkout-products', 'value' => $options['wcf-checkout-products'], 'allow_clear' => true, ) ); if ( ! _is_cartflows_pro() ) { echo wcf()->meta->get_hr_line_field( array() ); echo wcf()->meta->get_description_field( array( 'name' => 'wcf-upgrade-to-pro', /* translators: %s: link */ 'content' => '' . sprintf( esc_html__( 'Upgrade to %1$sCartFlows Pro%2$s for Pre-applied Coupon, Product Variations & Quantity Options.', 'cartflows' ), '', '' ) . '', ) ); } do_action( 'cartflows_checkout_general_tab_content', $options, $post_id ); ?>
meta->get_description_field( array( 'name' => 'wcf-upgrade-to-pro', /* translators: %s: link */ 'content' => '' . sprintf( esc_html__( 'Upgrade to %1$sCartFlows Pro%2$s for Checkout Offer feature', 'cartflows' ), '', '' ) . '', ) ); } elseif ( _is_cartflows_pro_ver_less_than( '1.2.0' ) ) { $version = '1.2.0'; echo wcf()->meta->get_description_field( array( 'name' => 'wcf-upgrade-to-pro', /* translators: %s: link */ 'content' => '' . sprintf( esc_html__( 'Update to %1$sCartFlows Pro%2$s to %3$s or above for Checkout Offer feature', 'cartflows' ), '', '', $version ) . '', ) ); } ?>
meta->get_hr_line_field( array() ); if ( ! _is_cartflows_pro() ) { echo wcf()->meta->get_description_field( array( 'name' => 'wcf-upgrade-to-pro', /* translators: %s: link */ 'content' => '' . sprintf( __( 'Upgrade to %1$sCartFlows Pro%2$s for animate browser tab feature', 'cartflows' ), '', '' ) . '', ) ); } elseif ( _is_cartflows_pro_ver_less_than( '1.4.0' ) ) { $version = '1.4.0'; echo wcf()->meta->get_description_field( array( 'name' => 'wcf-upgrade-to-pro', /* translators: %s: link */ 'content' => '' . sprintf( __( 'Update to %1$sCartFlows Pro%2$s to %3$s or above for animate browser tab feature', 'cartflows' ), '', '', $version ) . '', ) ); } do_action( 'cartflows_animate_browser_tab_settings', $options, $post_id ); } /** * Product bump tab * * @param array $options options. * @param int $post_id post ID. */ public function tab_product_bump( $options, $post_id ) { ?>
meta->get_description_field( array( 'name' => 'wcf-upgrade-to-pro', /* translators: %s: link */ 'content' => '' . sprintf( esc_html__( 'Upgrade to %1$sCartFlows Pro%2$s for Order Bump feature.', 'cartflows' ), '', '' ) . '', ) ); } ?>
meta->get_description_field( array( 'name' => 'wcf-upgrade-to-pro', /* translators: %s: link */ 'content' => '' . sprintf( esc_html__( 'Upgrade to %1$sCartFlows Pro%2$s for Custom Fields feature.', 'cartflows' ), '', '' ) . '', ) ); } ?>
meta->get_text_field( array( 'label' => __( 'Place Order Button Text', 'cartflows' ), 'name' => 'wcf-checkout-place-order-button-text', 'value' => $options['wcf-checkout-place-order-button-text'], 'attr' => array( 'placeholder' => __( 'Place order', 'cartflows' ), ), 'help' => __( 'It will change the Place Order Button text on checkout page.', 'cartflows' ), ) ); echo wcf()->meta->get_hr_line_field( array() ); echo wcf()->meta->get_checkbox_field( array( 'name' => 'wcf-remove-product-field', 'value' => $options['wcf-remove-product-field'], 'after' => esc_html__( 'Enable cart editing on checkout', 'cartflows' ), ) ); echo wcf()->meta->get_description_field( array( 'name' => '', /* translators: %s: link */ 'content' => '' . sprintf( esc_html__( 'Users will able to remove products from the checkout page.', 'cartflows' ), '', '' ) . '', ) ); $this->animate_title_settings( $options, $post_id ); ?>
__( 'One Column (Available in CartFlows Pro) ', 'cartflows' ), 'two-step' => __( 'Two Step (Available in CartFlows Pro) ', 'cartflows' ), ); } echo wcf()->meta->get_select_field( array( 'label' => __( 'Checkout Skin', 'cartflows' ), 'name' => 'wcf-checkout-layout', 'value' => $options['wcf-checkout-layout'], 'options' => array( 'one-column' => esc_html__( 'One Column', 'cartflows' ), 'two-column' => esc_html__( 'Two Column', 'cartflows' ), 'two-step' => esc_html__( 'Two Step', 'cartflows' ), ), 'pro-options' => $layout_pro_option, ) ); echo wcf()->meta->get_color_picker_field( array( 'label' => __( 'Primary Color', 'cartflows' ), 'name' => 'wcf-primary-color', 'value' => $options['wcf-primary-color'], ) ); echo wcf()->meta->get_font_family_field( array( 'for' => 'wcf-base', 'label' => esc_html__( 'Font Family', 'cartflows' ), 'name' => 'wcf-base-font-family', 'value' => $options['wcf-base-font-family'], ) ); echo wcf()->meta->get_checkbox_field( array( 'label' => __( 'Advance Options', 'cartflows' ), 'name' => 'wcf-advance-options-fields', 'value' => $options['wcf-advance-options-fields'], 'after' => 'Enable', ) ); ?>
meta->get_section( array( 'label' => __( 'Heading', 'cartflows' ), ) ); echo wcf()->meta->get_color_picker_field( array( 'label' => __( 'Heading Color', 'cartflows' ), 'name' => 'wcf-heading-color', 'value' => $options['wcf-heading-color'], ) ); echo wcf()->meta->get_font_family_field( array( 'for' => 'wcf-heading', 'label' => esc_html__( 'Font Family', 'cartflows' ), 'name' => 'wcf-heading-font-family', 'value' => $options['wcf-heading-font-family'], ) ); echo wcf()->meta->get_font_weight_field( array( 'for' => 'wcf-heading', 'label' => esc_html__( 'Font Weight', 'cartflows' ), 'name' => 'wcf-heading-font-weight', 'value' => $options['wcf-heading-font-weight'], ) ); echo wcf()->meta->get_section( array( 'label' => __( 'Input Fields', 'cartflows' ), ) ); $fields_skin_pro_option = array(); if ( ! _is_cartflows_pro() ) { $fields_skin_pro_option = array( 'style-one' => __( 'Floating Labels (Available in CartFlows Pro)', 'cartflows' ), ); } echo wcf()->meta->get_select_field( array( 'label' => __( 'Style', 'cartflows' ), 'name' => 'wcf-fields-skins', 'value' => $options['wcf-fields-skins'], 'options' => array( 'default' => esc_html__( 'Default', 'cartflows' ), 'style-one' => esc_html__( 'Floating Labels', 'cartflows' ), ), 'pro-options' => $fields_skin_pro_option, ) ); echo wcf()->meta->get_font_family_field( array( 'for' => 'wcf-input', 'label' => esc_html__( 'Font Family', 'cartflows' ), 'name' => 'wcf-input-font-family', 'value' => $options['wcf-input-font-family'], ) ); echo wcf()->meta->get_font_weight_field( array( 'for' => 'wcf-input', 'label' => esc_html__( 'Font Weight', 'cartflows' ), 'name' => 'wcf-input-font-weight', 'value' => $options['wcf-input-font-weight'], ) ); echo wcf()->meta->get_select_field( array( 'label' => __( 'Size', 'cartflows' ), 'name' => 'wcf-input-field-size', 'value' => $options['wcf-input-field-size'], 'options' => array( '33px' => esc_html__( 'Extra Small', 'cartflows' ), '38px' => esc_html__( 'Small', 'cartflows' ), '44px' => esc_html__( 'Medium', 'cartflows' ), '58px' => esc_html__( 'Large', 'cartflows' ), '68px' => esc_html__( 'Extra Large', 'cartflows' ), 'custom' => esc_html__( 'Custom', 'cartflows' ), ), ) ); echo wcf()->meta->get_number_field( array( 'label' => __( 'Top Bottom Spacing', 'cartflows' ), 'name' => 'wcf-field-tb-padding', 'value' => $options['wcf-field-tb-padding'], ) ); echo wcf()->meta->get_number_field( array( 'label' => __( 'Left Right Spacing', 'cartflows' ), 'name' => 'wcf-field-lr-padding', 'value' => $options['wcf-field-lr-padding'], ) ); echo wcf()->meta->get_color_picker_field( array( 'label' => __( 'Text / Placeholder Color', 'cartflows' ), 'name' => 'wcf-field-color', 'value' => $options['wcf-field-color'], ) ); echo wcf()->meta->get_color_picker_field( array( 'label' => __( 'Background Color', 'cartflows' ), 'name' => 'wcf-field-bg-color', 'value' => $options['wcf-field-bg-color'], ) ); echo wcf()->meta->get_color_picker_field( array( 'label' => __( 'Border Color', 'cartflows' ), 'name' => 'wcf-field-border-color', 'value' => $options['wcf-field-border-color'], ) ); echo wcf()->meta->get_color_picker_field( array( 'label' => __( 'Label Color', 'cartflows' ), 'name' => 'wcf-field-label-color', 'value' => $options['wcf-field-label-color'], ) ); ?>
meta->get_section( array( 'label' => __( 'Buttons', 'cartflows' ), ) ); echo wcf()->meta->get_font_family_field( array( 'for' => 'wcf-button', 'label' => esc_html__( 'Font Family', 'cartflows' ), 'name' => 'wcf-button-font-family', 'value' => $options['wcf-button-font-family'], ) ); echo wcf()->meta->get_font_weight_field( array( 'for' => 'wcf-button', 'label' => esc_html__( 'Font Weight', 'cartflows' ), 'name' => 'wcf-button-font-weight', 'value' => $options['wcf-button-font-weight'], ) ); echo wcf()->meta->get_select_field( array( 'label' => __( 'Size', 'cartflows' ), 'name' => 'wcf-input-button-size', 'value' => $options['wcf-input-button-size'], 'options' => array( '33px' => esc_html__( 'Extra Small', 'cartflows' ), '38px' => esc_html__( 'Small', 'cartflows' ), '44px' => esc_html__( 'Medium', 'cartflows' ), '58px' => esc_html__( 'Large', 'cartflows' ), '68px' => esc_html__( 'Extra Large', 'cartflows' ), 'custom' => esc_html__( 'Custom', 'cartflows' ), ), ) ); echo wcf()->meta->get_number_field( array( 'label' => __( 'Top Bottom Spacing', 'cartflows' ), 'name' => 'wcf-submit-tb-padding', 'value' => $options['wcf-submit-tb-padding'], ) ); echo wcf()->meta->get_number_field( array( 'label' => __( 'Left Right Spacing', 'cartflows' ), 'name' => 'wcf-submit-lr-padding', 'value' => $options['wcf-submit-lr-padding'], ) ); echo wcf()->meta->get_color_picker_field( array( 'label' => __( 'Text Color', 'cartflows' ), 'name' => 'wcf-submit-color', 'value' => $options['wcf-submit-color'], ) ); echo wcf()->meta->get_color_picker_field( array( 'label' => __( 'Text Hover Color', 'cartflows' ), 'name' => 'wcf-submit-hover-color', 'value' => $options['wcf-submit-hover-color'], ) ); echo wcf()->meta->get_color_picker_field( array( 'label' => __( 'Background Color', 'cartflows' ), 'name' => 'wcf-submit-bg-color', 'value' => $options['wcf-submit-bg-color'], ) ); echo wcf()->meta->get_color_picker_field( array( 'label' => __( 'Background Hover Color', 'cartflows' ), 'name' => 'wcf-submit-bg-hover-color', 'value' => $options['wcf-submit-bg-hover-color'], ) ); echo wcf()->meta->get_color_picker_field( array( 'label' => __( 'Border Color', 'cartflows' ), 'name' => 'wcf-submit-border-color', 'value' => $options['wcf-submit-border-color'], ) ); echo wcf()->meta->get_color_picker_field( array( 'label' => __( 'Border Hover Color', 'cartflows' ), 'name' => 'wcf-submit-border-hover-color', 'value' => $options['wcf-submit-border-hover-color'], ) ); ?>
meta->get_section( array( 'label' => __( 'Sections', 'cartflows' ), ) ); echo wcf()->meta->get_color_picker_field( array( 'label' => __( 'Highlight Area Background Color', 'cartflows' ), 'name' => 'wcf-hl-bg-color', 'value' => $options['wcf-hl-bg-color'], ) ); echo wcf()->meta->get_hidden_field( array( 'name' => 'wcf-field-google-font-url', 'value' => $options['wcf-field-google-font-url'], ) ); ?>
meta->get_image_field( array( 'name' => 'wcf-header-logo-image', 'value' => $options['wcf-header-logo-image'], 'label' => esc_html__( 'Header Logo', 'cartflows' ), ) ); echo wcf()->meta->get_number_field( array( 'name' => 'wcf-header-logo-width', 'value' => $options['wcf-header-logo-width'], 'label' => esc_html__( 'Logo Width (In px)', 'cartflows' ), ) ); ?>
options->get_checkout_fields( $post_id ); } return self::$meta_option; } /** * Metabox Save * * @param number $post_id Post ID. * @return void */ public function save_meta_box( $post_id ) { // Checks save status. $is_autosave = wp_is_post_autosave( $post_id ); $is_revision = wp_is_post_revision( $post_id ); $is_valid_nonce = ( isset( $_POST['nonce-checkout-step-meta'] ) && wp_verify_nonce( sanitize_text_field( wp_unslash( $_POST['nonce-checkout-step-meta'] ) ), 'save-nonce-checkout-step-meta' ) ) ? true : false; // Exits script depending on save status. if ( $is_autosave || $is_revision || ! $is_valid_nonce ) { return; } wcf()->options->save_checkout_fields( $post_id ); } } /** * Kicking this off by calling 'get_instance()' method */ Cartflows_Checkout_Meta::get_instance(); templates/wcf-template.php000066600000002550152142140530011646 0ustar00 > <?php wp_title( '-', true, 'right' ); ?><?php bloginfo( 'name' ); ?> >
' ) { echo esc_html__( 'Your cart is currently empty.', 'cartflows' ); } else { echo $checkout_html; } ?>

-

templates/embed/checkout-template-simple.php000066600000001711152142140530015235 0ustar00options->get_checkout_meta_value( $checkout_id, 'wcf-checkout-layout' ); $fields_skins = wcf()->options->get_checkout_meta_value( $checkout_id, 'wcf-fields-skins' ); ?>
' ) { do_action( 'cartflows_checkout_cart_empty', $checkout_id ); echo esc_html__( 'Your cart is currently empty.', 'cartflows' ); } else { echo $checkout_html; } ?>