Forum Replies Created

Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter lead1

    (@lead1)

    Hello,
    I succeed to trigger a function that i need with the follow hook : add_action( ‘mwb_sfw_subscription_cancel’, ‘your_callback_function2’, 10, 2 );

    this is my callback function :

    function your_callback_function2( $subscription_id, $cancel_text ) {
    // do something here on cancellation of the subscription.

    }

    Now i want to get the customer order that’s associated to the cancelled subscription.
    what is the function that return the customer order associated to the cancelled subscription ?

    Thanks.

    Thread Starter lead1

    (@lead1)

    Hi,
    these hooks are available for the free version of plugin ?

    Thanks.

    Thread Starter lead1

    (@lead1)

    Hi,
    after updating the plugins ;
    when i code this (in file functions.php) :

    add_action( ‘mwb_sfw_cancel_failed_susbcription’, ‘ispconfig_desactivate_client_website’);
    do_action( ‘mwb_sfw_cancel_failed_susbcription’);
    
    function ispconfig_desactivate_client_website(){
    echo "<script>alert('subscription cancelled')</script>";
    }

    I refresh the web site here is the error that appears:

    Warning: Use of undefined constant ‘mwb_sfw_cancel_failed_susbcription’ – assumed ‘‘mwb_sfw_cancel_failed_susbcription’’ (this will throw an Error in a future version of PHP) in /var/www/clients/client1/web2/web/wp-content/themes/hostinza/functions.php on line 687

    when I cancel a subscription the function ispconfig_desactivate_client_website is not executed.

    Thread Starter lead1

    (@lead1)

    Hi,
    I have consulted the documentation of the do_action function (https://developer.ww.wp.xz.cn/reference/functions/do_action/)
    here is my code (in file functions.php) :

    add_action( ‘mwb_sfw_cancel_failed_susbcription’, ‘ispconfig_desactivate_client_website’);
    do_action( ‘mwb_sfw_cancel_failed_susbcription’);

    function ispconfig_desactivate_client_website(){
    mkdir(‘is_working’);
    }

    but when I refresh the web site here is the error that appears:

    Warning: Use of undefined constant ‘mwb_sfw_cancel_failed_susbcription’ – assumed ‘‘mwb_sfw_cancel_failed_susbcription’’ (this will throw an Error in a future version of PHP) in /var/www/clients/client1/web2/web/wp-content/themes/hostinza/functions.php on line 687

    Warning: Use of undefined constant ‘woocommerce_subscription_status_cancelled’ – assumed ‘‘woocommerce_subscription_status_cancelled’’ (this will throw an Error in a future version of PHP) in /var/www/clients/client1/web2/web/wp-content/themes/hostinza/functions.php on line 690

    And when I cancel a subscription the function ispconfig_desactivate_client_website is not executed.

    I also modify my code like :

    add_action( ‘woocommerce_subscription_status_cancelled’, ‘ispconfig_desactivate_client_website’);
    do_action( ‘woocommerce_subscription_status_cancelled’);

    function ispconfig_desactivate_client_website(){
    mkdir(‘is_working’);
    }

    I also refresh the web site here is the error that appears:

    Warning: Use of undefined constant ‘woocommerce_subscription_status_cancelled’ – assumed ‘‘woocommerce_subscription_status_cancelled’’ (this will throw an Error in a future version of PHP) in /var/www/clients/client1/web2/web/wp-content/themes/hostinza/functions.php on line 687

    Warning: Use of undefined constant ‘woocommerce_subscription_status_cancelled’ – assumed ‘‘woocommerce_subscription_status_cancelled’’ (this will throw an Error in a future version of PHP) in /var/www/clients/client1/web2/web/wp-content/themes/hostinza/functions.php on line 690

    when I cancel a subscription the function ispconfig_desactivate_client_website is not executed.

    i don’t known how to do now . Please help me.

    Thanks

    Thread Starter lead1

    (@lead1)

    Hi,

    in fact, I work on a hosting web site and I use the woocommerce subscription plugin.
    when a customer subscribes to a subscription, my web site automatically creates the ftp accounts, database and website of the customer.
    i have already created the function that allows to disable the ftp accounts, database and website of the customer, i would like that when the subscription of the customer arrives at expriration, the disable function is executed automatically as well as when the customer cancels his subscription

    Thanks

Viewing 5 replies - 1 through 5 (of 5 total)