Forum: F.A.Q

This forum is closed for new topics. However, you can still search for a solution in the old topics. For technical support and general questions related to GEO my WP plugin and its core add-ons please use the support forum.

[Resolved]How to Accept GMW Address on Frontend Form ?

Forums F.A.Q How to Accept GMW Address on Frontend Form ?

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #38592
    squints
    Member

    I am building a business directory similar to YP.com using the theme “Vantage” by Appthemes and I am using Geo My WordPress as my main Geo and location service.

    My business directory theme offers the frontend users the ability to “Add a New Business Listing” so they can list their business on my site but I cannot figure out how to create a text field for them to enter their address and have it save correctly to the GMW data.

    For example, on the “Add a New Business Listing” form I am requesting the “street” in one field with the following function:
    <input name="post_street" type="text" value="<?php echo esc_attr( $post_info->street ); ?>" class="required" />

    I have tried using _wppl_street, gmw_street, etc. but I cannot get the street inputted by the user to actually save in the GMW data so that it can be queried.

    How do I display a text field on my custom Vantage form where the user can input their street, city, state, etc. and it will be saved as the GMW data for queries?

    Here is a frontend and backend demo for my theme:
    http://demos.appthemes.com/?theme=vantage

    #38651

    Hello Squints,
    You will need a custom function – gmw_pt_update_location(); that will geocode and save the location data in GEO my WP database table.

    This is the docs and an example of how to use the gmw_pt_update_location(); function.

    #38677
    squints
    Member

    Thank you for pointing me in the right direction Eyal, unfortunately I still cannot get this function to populate the GMW address using the standard theme meta address. I am using the following function in my functions.php:

    When a new listing is created it is created as a custom post type named “Listing” the address is captured in the form using: <input id="listing-address" class="required" name="address" type="text" value="<?php echo esc_attr( $listing->address ); ?>" /> and the address is stored in a custom field of “Listing” as name=”address” id=”meta-7442″.

    I have tried changing $post_id to $post->ID, changing ‘address’ to “listing-address” and “meta-7442”, and I have tried placing do_action( 'gmw_update_listing_location' ); and do_action( 'gmw_pt_update_location' ); at the end of the “Create New Listing” form.php file as well as some other things but I can’t get the address to populate the GMW database and display.

    What am I missing or doing wrong?

    Thanks.

    #38678
    squints
    Member

    Sorry I don’t know why the function is formatted so weird in my post above, the function I am using in functions.php is as follows:

    #38679
    squints
    Member

    I cant paste my function without it replacing special characters as code.
    To view the code without the formatting errors please see the first example used here:

    http://docs.tempform.wpengine.com/gmw_pt_update_location/

    #39050
    squints
    Member

    Couldn’t get support so I just installed Formidable Forms and went that route.

    #39869
    titon222
    Member

    I Eyal  i have the same problem

    I use this code:

     

    But i have nothing populate in my back office post GMW Location

    i use post_id and field id “address”

    Have you an idea ?

     

    Thx for all

    #39882
    titon222
    Member

    Be careful at the end save_post_post just save_post !

    #39885
    titon222
    Member

    i find my way 😉

    this :

    do not work for me !
    Thx for all
Viewing 9 posts - 1 through 9 (of 9 total)

You must be logged in to reply to this topic.