• Resolved Website Tutorials

    (@fakeartist)


    Hi. I want to override the woocommerce_email_after_order_table
    function that resides in WCPGSK_Main class, in order to remove the dd and dt tags.

    How is this possible? Any ideas?

    I can succesfully remove the default function by using:

    add_action('init', 'my_plugins_override');
    function my_plugins_override() {
    global $wcpgsk;
    remove_action('woocommerce_email_after_order_table', array($wcpgsk, 'wcpgsk_email_after_order_table'));
    }

    But I cannot redeclare it using:

    add_action('woocommerce_email_after_order_table', array($wcpgsk, 'wcpgsk_email_after_order_table_custom'));
    
    function wcpgsk_email_after_order_table_custom() {
    // change code here
    }

    https://www.ads-software.com/plugins/woocommerce-poor-guys-swiss-knife/

Viewing 1 replies (of 1 total)
  • Plugin Author ulihake

    (@ulih)

    Hello fakeartist.

    You cannot call a function in the plugin which does not exist… You have to call your function and to do so you have to call it without array($wcpgsk…). Call your function directly ‘wcpgsk_email_after_order_table_custom’. That’s it. The rest is up to you. Please understand that I’m not able to help you with your programming. This is far behind of what I can offer in the context of a free plugin.

    Regards.
    uh

Viewing 1 replies (of 1 total)
  • The topic ‘Overriding a class function?’ is closed to new replies.