• Resolved sandornemeth

    (@sandornemeth)


    Hi Luiggi,

    First off, many thanks for the help for the other support topic (swapping first & last names), I replied a bit late.

    I’d like to disable the progress bar, but I am unable to unhook properly the function below because it is under a class, I am not a programmer, unfortunately.

    class FluidCheckout_Steps extends FluidCheckout {
    
        private $checkout_steps   = array();
    
        public function __construct() {
    		$this->hooks();
    	}
    
    	public function hooks() {
    
            add_action( 'woocommerce_before_checkout_form_cart_notices', array( $this, 'output_checkout_progress_bar' ), 4 ); // Display before the checkout/cart notices
        }
    }

    Can you please help me with that?

    I am following this tutorial, but I can’t get it to work.
    https://zeropointdevelopment.com/how-to-remove-an-action-hook-or-filter-added-by-a-class-in-wordpress/

    Many thanks in advance!

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

    (@diegoversiani)

    Hi @sandornemeth,

    Yes, all functions of Fluid Checkout are created within a class. The article you mentioned assumes the plugin developer is using a global variable to give access to the classes’ objects.

    In our case, instead of using a global variable, we provide a function ::instance() on every class.

    You can remove the progress bar with the code snippet below.

    /**
     * Remove progress bar.
     */
    function fluidcheckout_late_hooks() {
    	// Bail if Fluid Checkout class is not available
    	if ( ! class_exists( 'FluidCheckout_Steps' ) ) { return; }
    	
    	remove_action( 'woocommerce_before_checkout_form_cart_notices', array( FluidCheckout_Steps::instance(), 'output_checkout_progress_bar' ), 4 );
    }
    add_action( 'init', 'fluidcheckout_late_hooks', 200 );

    If you are unsure how to add the code snippet, check our article “How to safely add code snippets to your WooCommerce website” below:
    https://support.fluidcheckout.com/portal/en/kb/articles/how-to-add-code-snippets

    If you need further assistance, don’t hesitate to ask ??

    Best,
    Diego

    Thread Starter sandornemeth

    (@sandornemeth)

    Hi Diego,

    Many thanks, it works!

    Kind Regards
    Sandor

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘disable progress bar’ is closed to new replies.