• Resolved mom4i911024

    (@mom4i911024)


    Hey there,

    Is it possible to move the checkout button to a custom location, for example under the order submit button from WooCommerce for Germanized plugin? Wondering if there is some sort of hook which I can use?

    • This topic was modified 1 year, 4 months ago by mom4i911024.
Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Support WebToffee Support

    (@webtoffeesupport)

    Hi @mom4i911024,

    Greetings from WebToffee support.

    We didn’t understand your query correctly. Please brief us on the requirement further using a screenshot of the buttons you are referring and the position you would like to move them to.

    Additionally, please mention the version number of the PayPal Express Checkout plugin you are using.

    Awaiting your response.

    Thread Starter mom4i911024

    (@mom4i911024)

    Hey,
    I thought it’s pretty clear. I just want to move the checkout button to another location on the checkout page and was wondering what’s the best way to do it. This is what I’ve done, please let me know if there’s a more efficient way.

    //Remove the plugin action from their class
    remove_filters_with_method_name( 'woocommerce_review_order_after_payment', 'eh_express_checkout_hook', 10 );
    
    function remove_filters_with_method_name( $hook_name = '', $method_name = '', $priority = 0 ) {
        global $wp_filter;
        // Take only filters on right hook name and priority
        if ( ! isset( $wp_filter[ $hook_name ][ $priority ] ) || ! is_array( $wp_filter[ $hook_name ][ $priority ] ) ) {
            return false;
        }
        // Loop on filters registered
        foreach ( (array) $wp_filter[ $hook_name ][ $priority ] as $unique_id => $filter_array ) {
            // Test if filter is an array ! (always for class/method)
            if ( isset( $filter_array['function'] ) && is_array( $filter_array['function'] ) ) {
                // Test if object is a class and method is equal to param !
                if ( is_object( $filter_array['function'][0] ) && get_class( $filter_array['function'][0] ) && $filter_array['function'][1] == $method_name ) {
                    // Test for WordPress >= 4.7 WP_Hook class (https://make.www.ads-software.com/core/2016/09/08/wp_hook-next-generation-actions-and-filters/)
                    if ( is_a( $wp_filter[ $hook_name ], 'WP_Hook' ) ) {
                        unset( $wp_filter[ $hook_name ]->callbacks[ $priority ][ $unique_id ] );
                    } else {
                        unset( $wp_filter[ $hook_name ][ $priority ][ $unique_id ] );
                    }
                }
            }
        }
        return false;
    }
    
    //Use a non-static method from the plugin class
    add_action('woocommerce_review_order_before_cart_contents', 'express_checkout_button_function', 40);
    
    function express_checkout_button_function() {
    	$class = new Eh_Paypal_Express_Hooks;
    	
        return $class->eh_express_checkout_hook();
    } 
    Plugin Support WebToffee Support

    (@webtoffeesupport)

    Hi @mom4i911024,

    The option to change the position of the button is a premium feature. Therefore the provision to alter the location is not provided in the free version plugin. We are sorry to let you down.

    Additionally, we would like to let know that the code snippet was not working for us when we tested it.

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