• I am working on a setup with yith + woocommerce.

    In short:

    A user buys a subscription, the user roles are flushed, new role added. (Good).

    The roles are all flushed from the user account (Upon buying a new subscription) in our code.

    Now inside yith, when user roles are flushed and the new role added(subscription) the old order_id->subscription_id isnt cancelled, we would like the subscription to be cancelled when the corresponding user role is gone. we thought this would be a feature in your plugin?

    Any help is appreciated, im fairly new with this so im trying to understand.

    I have tried to code some of it myself.

    Gist:

    https://gist.github.com/xAirx/762f6ae2441d7bb79ade74bd641c8b47

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter nightfoxen

    (@nightfoxen)

    Does anyone have time to help?

    Plugin Author YITHEMES

    (@yithemes)

    Hi,

    Maybe this hook can help you:
    do_action('ywsbs_subscription_cancelled', $this->id);
    You can find it on

    includes/class.ywsbs-susbscription.php

    line 367.

    Thread Starter nightfoxen

    (@nightfoxen)

    Im going to test it out, i hope it works thank you.

    Thread Starter nightfoxen

    (@nightfoxen)

    How would you write the full code to make all my code work in the gist, i hope you can help me i need the expertise, I need this to work right now for a client.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Yith, Cancel subscription -> Delete corresponding user role. & reverse’ is closed to new replies.