• Resolved hpb951

    (@hpb951)


    Hi,

    When ordering a virtual giftcard, we obviously do not ship the item. The billing information is required by law in Europe, but the step is removed in the checkout.
    This is what happens:

    1. You add the virtual giftcard
    2. You proceed to checkout and there is now only 2 steps instead of 3.
    The shipping step gets removed with the billing information: https://prnt.sc/WlX34gQmdBxk
    3. Its now not possible to complete your purchase as the billing fields are required to make a purchase by law.

    Any ideas what it could be? We do have checkout field editor enabled. We still want to obtain billing informations for virtual product sales.

    Thanks for the help!

    • This topic was modified 2 years, 7 months ago by hpb951.
Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Diego Versiani

    (@diegoversiani)

    Hi @hpb951,

    This should not happen as Fluid Checkout has a separate step for Billing and does not remove it when only virtual products are added to the cart.

    There are a few possibilities why this is happening:

    1. Most likely, you might be using customization code or code snippet that moves the billing sections inside the Shipping step.

    In this case, the solution would be to only move it conditionally. Revealing the Billing step if the Shipping step is not available.

    Please confirm whether you have any customization code or code snippet moving the Billing sections to the Shipping step.

    2. Less likely, some customizations applied with the Checkout Field Editor plugin might be causing this issue.

    You can check if this is indeed the case by temporarily deactivating the Checkout Field Editor and visiting the checkout page. If the Checkout Field Editor is causing it, the problem should be gone.

    Best,
    Diego

    Thread Starter hpb951

    (@hpb951)

    Hi Diego,

    Thanks for the detailed explanation. I did find the source of the “issue” and it was indeed related to a customzation code you sent me back in november last year:

    /**
     * 
     */
    function fluidcheckout_move_billing_address_shipping_step() {
    	// Bail if steps class not available
    	if ( ! class_exists( 'FluidCheckout_Steps' ) ) { return; }
    	
    	remove_action( 'fc_output_step_billing', array( FluidCheckout_Steps::instance(), 'output_substep_billing_address' ), 10 );
    	add_action( 'fc_output_step_shipping', array( FluidCheckout_Steps::instance(), 'output_substep_billing_address' ), 30 );
    }
    add_action( 'init', 'fluidcheckout_move_billing_address_shipping_step', 300 );
    
    /**
     * Move billing substep to shipping 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 );

    Do you have any template code for the conditional option?

    Thanks for the help ??

    Best regards, Hakim

    • This reply was modified 2 years, 7 months ago by hpb951.
    Plugin Author Diego Versiani

    (@diegoversiani)

    Hi @hpb951,

    Yes, I updated the code snippet with the conditional.

    You should replace entire code snippet with this below:

    /**
     * Move billing substep to shipping step.
     */
    function fluidcheckout_move_billing_address_shipping_step() {
    	// Bail if steps class not available
    	if ( ! class_exists( 'FluidCheckout_Steps' ) ) { return; }
    	
    	// Bail if shipping step is not available
    	if ( ! function_exists( 'WC' ) || ! WC()->cart || ! WC()->cart->needs_shipping() ) { return; }
    	
    	remove_action( 'fc_output_step_billing', array( FluidCheckout_Steps::instance(), 'output_substep_billing_address' ), 10 );
    	add_action( 'fc_output_step_shipping', array( FluidCheckout_Steps::instance(), 'output_substep_billing_address' ), 30 );
    }
    add_action( 'wp', 'fluidcheckout_move_billing_address_shipping_step', 300 );
    
    /**
     * Remove the billing step.
     */
    function fluidcheckout_remove_billing_step() {
    	// Bail if steps class not available
    	if ( ! class_exists( 'FluidCheckout_Steps' ) ) { return; }
    	
    	// Bail if shipping step is not available
    	if ( ! function_exists( 'WC' ) || ! WC()->cart || ! WC()->cart->needs_shipping() ) { 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 ‘Virtual products requires billing info’ is closed to new replies.