Page 1 of 2 12 LastLast
Results 1 to 10 of 19
Like Tree4Likes

Thread: [TUTORIAL] Using Gravity Forms for 'Contact this Listing Owner' = Any Fields You Want

  1. #1
    Thread Starter
    luxor's Avatar
    Join Date
    Mar 2013
    Location
    United States
    Posts
    599
    Thanks
    8
    Thanked 141 Times in 74 Posts

    [TUTORIAL] Using Gravity Forms for 'Contact this Listing Owner' = Any Fields You Want

    I found the general "contact this listing owner" form to be too simple and it restricted my use as I wanted to provide more information to the listing owner.

    I'm not going to go too far in depth with this as you should already have suffient knowledge of both Gravity Forms, Vantage and HTML.

    As told by many others of this forum, I should be charging for this... However, I would like to show my support for Vantage and the hopes of having a highly complex theme in the near future.

    Using Gravity Forms for 'Contact this Listing Owner':

    Step 1: Create Your Form within Forms

    Step 2: Take note of the Form ID (mine is 1)

    Step 3: Add the Form directly to your child-theme's single-listing.php file

    PHP Code:
        <?php gravity_form(1falsefalsefalse''false); ?>
    Instead of using the "button" and popup, I've decided to add an additional tab within my listings:



    This is a bit tricky to accomplish, therefore this is the only part of this tutorial that I would charge to duplicate (Send me a PM if interested). Yes, I took computers, tablets and mobile resolutions into consideration while adding this extra tab, and it works with them all...

    Step 4: Add the following code to your child-theme's functions.php file

    PHP Code:
    /* Redirect Email to Listing Owner */
    add_filter'gform_notification_email_1''route_notification'10);
    function 
    route_notification($email_to$entry) {
        
    $post get_post$post_id );
        
    $recipient get_user_by'id'$post->post_author );
        
    $email_to $recipient->user_email;
        return 
    $email_to;


    NOTE: Make sure the correct form ID is placed at the end of gform_notification_email_


    Step 5: Enjoy your new contact form, which sends emails directly to the listing owner!







    You can also make the emails go directly to a specific email, instead of the listing owner's by changing the function to:

    PHP Code:
    <?php
    add_filter
    ("gform_notification_emai_1l""change_notification_email"102);
    function 
    change_notification_email($email$entry){
       return 
    "test@test.com";
    }
    ?>
    You can also still edit the forms notifications to make BCC copies sent to another email address (for monitoring or whatever you wish).

    Enjoy
    Attached Images Attached Images

  2. The Following 8 Users Say Thank You to luxor For This Useful Post:

    4briang (March 23rd, 2014), cllzor (June 9th, 2013), jlhand (February 4th, 2014), jmkaufling (November 20th, 2013), johno69 (October 21st, 2015), perspective (November 26th, 2013), sindyskin (May 1st, 2014), tbase (May 17th, 2013)

  3. #2
    dimitris's Avatar
    Join Date
    Oct 2011
    Location
    Earth
    Posts
    20,617
    Thanks
    222
    Thanked 1,873 Times in 1,770 Posts
    You must be an AppThemes customer and logged in to view this response. Join today!

  4. #3
    Expired Customer dcg627's Avatar
    Join Date
    Jun 2012
    Location
    New Zealand
    Posts
    40
    Thanks
    0
    Thanked 3 Times in 2 Posts
    You must be an AppThemes customer and logged in to view this response. Join today!

  5. #4
    Thread Starter
    luxor's Avatar
    Join Date
    Mar 2013
    Location
    United States
    Posts
    599
    Thanks
    8
    Thanked 141 Times in 74 Posts
    You must be an AppThemes customer and logged in to view this response. Join today!

  6. The Following 2 Users Say Thank You to luxor For This Useful Post:

    ade010804 (May 23rd, 2013), johno69 (September 23rd, 2015)

  7. #5
    Expired Customer dcg627's Avatar
    Join Date
    Jun 2012
    Location
    New Zealand
    Posts
    40
    Thanks
    0
    Thanked 3 Times in 2 Posts
    You must be an AppThemes customer and logged in to view this response. Join today!

  8. #6
    tradeamillion's Avatar
    Join Date
    Mar 2012
    Location
    New York
    Posts
    1,076
    Thanks
    82
    Thanked 12 Times in 12 Posts
    You must be an AppThemes customer and logged in to view this response. Join today!

  9. #7
    tradeamillion's Avatar
    Join Date
    Mar 2012
    Location
    New York
    Posts
    1,076
    Thanks
    82
    Thanked 12 Times in 12 Posts
    You must be an AppThemes customer and logged in to view this response. Join today!

  10. #8
    tradeamillion's Avatar
    Join Date
    Mar 2012
    Location
    New York
    Posts
    1,076
    Thanks
    82
    Thanked 12 Times in 12 Posts
    You must be an AppThemes customer and logged in to view this response. Join today!
    Computers are incredibly fast, accurate, and stupid: humans are incredibly slow, inaccurate and brilliant; together they are powerful beyond imagination.

  11. #9
    Senior Member dorothy's Avatar
    Join Date
    Jul 2013
    Location
    Sydney
    Posts
    241
    Thanks
    27
    Thanked 27 Times in 25 Posts
    You must be an AppThemes customer and logged in to view this response. Join today!

  12. #10
    sonewdesign's Avatar
    Join Date
    Mar 2013
    Location
    United Kingdom
    Posts
    28
    Thanks
    2
    Thanked 0 Times in 0 Posts
    You must be an AppThemes customer and logged in to view this response. Join today!

Page 1 of 2 12 LastLast

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [MOD NEEDED] Contact Listing Owner
    By jeanpollack in forum Vantage General Discussion (Legacy)
    Replies: 3
    Last Post: March 28th, 2013, 11:33 AM