Activate pro sites plan by code (hook or sql or any way) looking for workaround

Hello guys,
i am going to use gravity forms for register(new blogs).
all the data like blog name,url and user name will be saved in gravity forms. so i can use this for creating "workaround" that will activate the pro plan based on user choose.

what i have, and how this can work:

i have create 3 packages in the pro sites and set the price only yearly.

i am going to create 3 pricing tables with "buy this plan" bouton.
so every plan will have id (1,2,3) that how i will know which plan the user choose.

the question is now how can i active by code (hook or sql) the pro plan? i don't want to give the user to choose the plan after the register process i want to this by code.

another thing is that the payment for the plan the user will pay in gravity forms so what i need is just to know how to active the plan based on what the user selected before (by id i will know which plan to activate him)

Thanks!

  • Tyler Postle

    Hey Ruslan,

    Hope you're doing well today and thanks for getting back to us!

    When it comes to complex code solutions like this one, responses back can take a bit longer. SLS staff solely deal with complex issues, meaning their handle times on tickets are often longer. Right now we also have a couple staff away for the month too. Your patience is super appreciated on this :slight_smile:

    I just checked on your ticket to make sure it is still in the queue and it is definitely there. SLS should be in with some feedback soon.

    In the meantime, let us know if you have any further questions!

    All the best,
    Tyler

  • Ruslan

    guys its almost one week without any help!
    can someone explain me why the clients need to wait one week and not to get any answer?
    i understand that your "level two" have more things to do than answering to clients. but hay! we pay the money and we need to get some attention!
    i am working with many other companies that provide me plugins and other services but i did not see in any company that the client need to wait one week! and didn't get an answer!
    if you cant provide support for your plugins which is a little more then a simple support you provided, please refund my money back!

    This is not the way that I can continue to work.

    Thanks

  • Tyler Postle

    Hey Ruslan,

    very sorry for the delay here! I have just sent a message to the SLS assigned this ticket, they will see it when they're back online :slight_smile:

    Just to clarify, you are wanting to be able to have your own pricing table setup where the user can select their plan before signing up? Or you're just wanting to have your own custom pricing plan for when they do sign up?

    It sounds like the first one, in which case, our next major update will include that feature - Pro Sites 3.5. We have completely re-worked the checkout system to make it more streamlined.

    Thanks for your patience here Ruslan! Apologies again for the delay.

    Hope you're enjoying your weekend.

    All the best,
    Tyler

  • Ruslan

    Hi Tyler,
    i know that 3.5 will have this option. but i don't know when it will be released so i just need to know how to activate pro plan menuali by code.
    all the parameters like blog id, i will give to this puancstion from gravity forms.
    i need code where i just give the blog id, pro sites package (by id) and that is.
    all my packages always give the user 1 year. so this need to be in the code.
    also after the code will activate the pro site plan by my parameters. it need to activate all the plugins in this plan (the plugins that set to be activated automatically)

    Thanks

  • Hoang Ngo

    Hi @Ruslan,

    I hope you are well today and I'm really sorry about the delay.

    Prosites is still not have any add-on to work with GF, so I think if you need to update the look of the checkout page, and checkout process, you will need to do by code only.

    Unfortunately this is a extremely complex feature and is beyond the scope of custom coding that we could provide.

    The function use to output the price table is checkout_grid, you can find it in the file /pro-sites/pro-sites.php line 3409. Also, you will need to have some work for the checkout screen each gateways too, example, for the paypal, in the file /pro-sites/pro-sites-files/gateways/gateway-paypal-express-pro.php line 1313, you will see the function checkout_screen</strong, you can adding custom variable here.

    If you need this feature now, you could try posting a job on our job board here https://premium.wpmudev.org/wordpress-development/

    Best regards,
    Hoang Ngo

  • Hoang Ngo

    @Ruslan,

    What you will need is the function extend(). Example how to use

    //get the prosite instance
    global $psts;
    //blog id, please replace this variable to your scenario
    $blog_id = 1;
    //$extend is 1,3 or 12, this is the months we want to extend the site
    $extend = 3;
    //$gateway, if you using this by manual, so assign it = false
    $gateway = false;
    //$level, this is level plan id you want to assign the blog
    $level_id=1;
    //$amount, the amount user need to paid, but this is for log purpose, if you set this as manual, just set it = false
    $amount = false;
    //now start to extend it
    $psts->extend($blog_id,$extend, $gateway, $level, $amount);

    If you have any issues please don't hesitate to let us know so we can assist

    Best regards,
    Hoang Ngo