Home Forums WC Vendors Pro Support Upgrade vendors automatically

NOTICE: We've Moved to a Ticket System for Support

As of August 31, 2017 (12am EST) our support forums will be retired (read-only), and we will be moving to a support ticket system.  This will allow us to better organize and answer support requests, and provide a more personalized experience as we assist our customers.

For the time being, we will leave our forums open for reading and learning while we work on creating a more robust Knowledge Base for everyone to use.

If you are a WC Vendors Pro customer please open a support ticket here. 

If you are a WC Vendors user please open a support ticket on the Wordpress.org forums.

The information on this forum is outdated and in most instances no longer relevant. Please be sure to check our documentation for the most up to date information.

https://docs.wcvendors.com/

Thank you to all of our customers!

 

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #63951
    jedibong93
    Participant

    I need a function that can upgrade or downgrade vendor automatically after checked vendor payment from the pmpro plugin. I hope I could get some helps here.Thanks

    Below is the code I tried myself, but it didn’t work.

    add_action(‘while pending Vendor to be Vendor,down_membership_level($level_id)’)

    function down_membership_level($level_id){
    // manage_product : vendor’s permission
    // $level_id is membership level: level1 -monthly vendor’s membership, level2 -year vendor’s membership, level0 -not vendor’s membership
    if ($level_id == 0 && (current_user_can(‘manage_product’))){
    //while vendor didn’t paid monthly fee. downgrade to be Customer role.
    $wp_user_object->set_role(‘customer’);
    }
    }

    #63985
    Anna
    Member

    @jedibong93
    Here you go:
    (theme / child theme functions.php)
    https://gist.github.com/fervous/9ae6e29b59581ac7559f

    And here is my forum post about this solution:

    #64771
    jedibong93
    Participant

    Thanks for your reply Anna.
    I used the code you gave me, but it still need to pending vendor manually.
    For example,
    1.A new vendor registered.
    2.New vendor pay the payment.
    3.After new vendor paid the payment.
    4.System will change vendor status who are “pending vendor” to be vendor.

    I wish to have a function that can change it to be vendor automatically.
    Thanks for help~

Viewing 3 posts - 1 through 3 (of 3 total)
  • The forum ‘WC Vendors Pro Support’ is closed to new topics and replies.