• Resolved bemay1

    (@bemay1)


    Hi, there is an issue with the steps on checkout, the step 2 shows the option to shipping AND the address… so you go to step 3, and step 3 is empty.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Diego Versiani

    (@diegoversiani)

    Hi @bemay1,

    The 3rd step of Fluid Checkout is the billing information.

    1. Do you have any plugins or code snippets removing the billing address section?

    That is the only thing I can think of so far that could cause this issue.

    Best,
    Diego

    Thread Starter bemay1

    (@bemay1)

    Hi Diego.
    My fault. I deleted with CSS. There is some way to remove this step?

    Plugin Author Diego Versiani

    (@diegoversiani)

    Hi @bemay1,

    Yes. You can use the code snippet below to move the billing first and last name fields to the “contact” step and remove the billing section (step 3).

    I recommend keeping the first and last name fields as they are used to create the user’s account. I’m not sure if in the lack of the billing name the shipping name fields would be used instead.

    In case you want to remove also the billing first and last name fields, just uncomment those lines in the code snippet.

    /**
     * Move fields to the contact substep.
     */
    function fluidcheckout_move_fields_to_contact_substep( $contact_field_ids ) {
    	// Fields before existing fields
    	// $contact_field_ids = array_merge( array( 'billing_first_name', 'billing_last_name' ), $contact_field_ids );
    
    	// Fields after existing fields
    	$contact_field_ids = array_merge( $contact_field_ids, array( 'billing_first_name', 'billing_last_name' ) );
    
    	return $contact_field_ids;
    }
    add_filter( 'fc_checkout_contact_step_field_ids', 'fluidcheckout_move_fields_to_contact_substep', 10 );
    
    /**
     * Remove billing fields, except email.
     *
     * @param   array  $fields  Fields used in checkout.
     */
    function fluidcheckout_remove_billing_fields( $fields ) {
    	// unset( $fields[ 'billing_first_name' ] );
    	// unset( $fields[ 'billing_last_name' ] );
    	unset( $fields[ 'billing_company' ] );
    	unset( $fields[ 'billing_phone' ] );
    	unset( $fields[ 'billing_address_1' ] );
    	unset( $fields[ 'billing_address_2' ] );
    	unset( $fields[ 'billing_city' ] );
    	unset( $fields[ 'billing_state' ] );
    	unset( $fields[ 'billing_country' ] );
    	unset( $fields[ 'billing_postcode' ] );
    	return $fields;
    }
    add_filter( 'woocommerce_billing_fields', 'fluidcheckout_remove_billing_fields', 300 );
    
    /**
     * Remove the billing step.
     */
    function fluidcheckout_remove_billing_step() {
    	// Bail if steps class not available
    	if ( ! class_exists( 'FluidCheckout_Steps' ) ) { return; }
    	
    	FluidCheckout_Steps::instance()->unregister_checkout_step( 'billing' );
    }
    add_action( 'fc_register_steps', 'fluidcheckout_remove_billing_step', 300 );

    If you are unsure about how to add the code snippet, check our article:
    How to safely add code snippets to your WooCommerce website

    Best,
    Diego

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Steps checkout’ is closed to new replies.