Gravity Forms integration with Appointments

We are trying to use the hook to use Gravity Form and Gravity View to approve the submitted service by a user for appointment+.
Source:https://gist.github.com/mgratch/8a17c7050eb4db270829

  • Adam Czajczyk

    Hello Komal

    I hope you're well today and thank you for your question!

    I checked the chat and the code shared but I admit I could use a bit more of an explanation as I'm not quite sure about the goal here, yet.

    You mentioned that you want to "use the hook to use Gravity Form and Gravity View to approve the submitted service by a user for appointment+.". I understand that you got some sort of a front-end form made with Gravity Forms/Gravity View. That would display Gravity Forms entries tho.

    Appointments+ is a separate plugin, not integrated with Gravity Forms. So, my questions are:

    1. what do you mean by "service submitted by a user for appointments+" - do you mean a booking made by a user or do you mean that you want your users to be able to create new services that can later be booked by other users?

    2. if that's the booking - do they book via regular Appointments+ interface, then the booked appointments is set to pending and you want to change that to "confirmed" via Gravity Forms?

    3. if so, how do you actually get GF to display those bookings?

    I might misunderstand that completely either so it would be great if you could provide an example step by step case scenario. That would help me understand better what exactly is supposed to happen and how that should exactly work...

    Kind regards,
    Adam

  • Komal

    Hello There,
    Basically i want to allow users to add their own services from front end. For this i was think of using the gravity forms and gravity view to approve or disapprove that service for that user.

    Like Take an example:
    User A:
    Submits a Service using Gravity Forms
    Then Admin See the New Service Request in the WP_ADMIN and As we know Gravity Forms don't offer some sort of Approval or Disapproval
    So what i was thinking to use Gravity View, Because the Gravity View add this functionality to the Gravity Forms. And this below hook is used to add action into that place as it get approved.
    But firstly i want to know the Data which is there, for that i need to var_dump but the there is no output coming. So may be i think action is not executing or maybe its priority issue.

    "
    add_action('gravityview/approve_entries/approved','publish_pending_testimonial');
    function publish_pending_testimonial($entry_id){

    $entry = RGFormsModel::get_lead($entry_id);
    var_dump($entry);
    exit;
    }"

    Refer Gravity View Source Code:
    https://codex.gravityview.co/class-gravityview-entry-approval_8php_source.html
    Search for "gravityview/approve_entries/{actions}"

    Thanks

  • Adam Czajczyk

    Hello Komal

    Thank you for your response.

    From what I understand the $entry should contain the same data as WP_post so I believe it's safe to assume that you can use these variables:

    https://codex.wordpress.org/Class_Reference/WP_Post

    I'm afraid, however, that I don't have access to full and up to date versions of these plugins as they are premium plugins and I'm also not well familiar with their code. Have you tried to ask GravityForms/GravityView developers for help on this?

    If you had the GF/GV part working I believe I would be able then to help you handle the A+ part to "inject" the service properly but custom coding for GravityForms and related 3rd-party plugins is a bit beyond the scope, I'm afraid. Would you please contact them and ask if they could help you with that part?

    Then I'd be more than happy to assist you further with the Appointments+ part.

    Kind regards,
    Adam

  • Komal

    Really we cannot use the Same variables as the WP_POST.
    And i was just asking for the hook action wasn't executing. And if you want the source code of the gravity forms and gravity view you can have by GIYTHUB repo links:
    https://github.com/wp-premium/gravityforms
    https://github.com/gravityview/GravityView

    BTW i have shared you the hook source location link in the last post.
    And i know this var_dump has to be inside of the WP-ADMIN because the hook is defined at the place where some action is executed in the WP-ADMIN so it will output the result of the hooked action there. But i cant see that when i do that action

    I hope it will help you to get some general info and help me in var_dump

    Thanks

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.