• Is it possible to rewrite process_registration() function in WooCommerce 2.1?

    Earlier I could just do
    remove_action('init', 'woocommerce_process_registration')
    and
    add_action('init', 'my_woocommerce_process_registration').

    But now process_registration function is part of WC_Form_Handler class, and it is added to the actions in the new way
    add_action('init', array( $this, 'process_registration')).

    So I don’t know how I can remove this action. Can somebody help me?

    https://wordpress.org/plugins/woocommerce/

Viewing 3 replies - 1 through 3 (of 3 total)
  • neokeats

    (@neokeats)

    hi,
    same question here.
    i tried with no luck :

    remove_action('init', array(WC_Form_Handler, 'process_registration'),99);

    Did any of you find a proper solution to this ?

    I also ran into the same issue for rewritting the add_to_cart_action method.

    For removing the default add_action('init', array( $this, 'process_registration')), we need that specific instance of that class or else the class needs to be static. But in this case, non of them is true.

    Woocommerce authors should atleast assign that instance of the class to any global variable rather than just creating the instance of the class like new WC_Form_Handler()

    If you have come accross any workaround, then please share the same, will be helpful. 🙂

    If you require assistance then, as per the Forum Welcome, please post your own topic instead of tagging onto someone else’s topic.

    I am now closing this 2 month old topic as it references an older version of WordPress.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Rewrite process_registration function in WC 2.1’ is closed to new replies.