Send Enquiry Popup

This topic contains 4 replies, has 2 voices, and was last updated by  Paolo 7 years, 3 months ago.

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket
  • Author
    Posts
  • #394352

    Kreat d.o.o. id ddv: 19894309
    Expired Member
    Post count: 6

    Hi

    I know it is many time been asked before, but still cant find a solution for my problem..
    I added two more fields to the Send Enquiry pop up.

    1st problem: in the Enquiry Email I get as a Place owner – there is not displayed the values of this two new field (which are basicaly a copy / paste of phone textfield and then changed name)

    2nd problem: is there a way to get date (datepicker would be the best) instead of normal placeholder… So I could get an enquiry about Booking module for my directory.

    http://pasman-info.com/places/croatia/zadarska-zupanija/kraj/apartma/apartmatji-demo-01/

    have a look at Send Enquiry and please help me finding the solution

    Thank you very much

    #394390

    Paolo
    Site Admin
    Post count: 31206

    Hi,

    wouldn’t this be a better solution? https://wpgeodirectory.com/formidable-forms-in-geodirectory-tabs/

    Let us know,

    Thanks

    #394909

    Kreat d.o.o. id ddv: 19894309
    Expired Member
    Post count: 6

    Hi

    I did just like in tutorial.. and the Tab BOOK NOW shows
    There is also the form – and it works.
    But again it doesn’t send mails to place owners.

    Can you please check why

    The only thing I changed is gd_hotel to gd_place because I don’t have a hotel CPT?
    Can this be the reason why it don’t work?

    http://pasman-info.com/informacije/tkon/kamp/kamp-test/

    and this is what I added at the end of functions.php

    // this line tells the tabs function to run our new function to add a new tab
    add_filter(‘geodir_detail_page_tab_list_extend’, ‘geodir_detail_page_tab_list_extend’);
    // this function adds the tab to the tabs list (but not the content)
    function geodir_detail_page_tab_list_extend($tab_array)
    {
    // the $post var contains all the listing info so we can add conditions
    global $post;
    // only add the tab if the post type is

    gd_hotel

    and the email field has been added to the listing
    if ($post->post_type==’gd_place’ && $post->geodir_email) {
    $tab_array[‘booking_form’] = array(‘heading_text’ => ‘BOOK NOW’,
    ‘is_active_tab’ => ”,
    ‘is_display’ => 1,
    ‘tab_content’ => ”,
    );
    }
    return $tab_array;
    }
    // this action allows the tab content to be changed or added
    add_action(‘geodir_after_tab_content’, ‘geodir_booking_form_content’, 10, 1);
    // this function adds the content to our new tab
    function geodir_booking_form_content($tab)
    {
    //if the tab exists then we know it has passed the criteria and we can add the content
    if ($tab == ‘booking_form’) {
    echo do_shortcode(‘[formidable id=2]’);
    }
    }
    // this action tells the form to call our function to add a new field
    add_action(‘frm_entry_form’, ‘geodir_add_hidden_field’);
    // this function adds our field to the form
    function geodir_add_hidden_field($form)
    {
    // our example booking form has an ID of

    3

    so we only want to add the field to that form
    if ($form->id == 3) {// only send if the form id is 3
    global $post;
    echo ‘<input type=”hidden” name=”gd_place_id” value=”‘ . $post->ID . ‘”>’;
    }

    }
    // this tells the formidable form to check our function before sending
    add_filter(‘frm_to_email’, ‘geodir_custom_set_email_value’, 10, 4);
    // this function will add the listing email to the recipiants list when submitted
    function geodir_custom_set_email_value($recipients, $values, $form_id, $args)
    {
    // only run if the submited form is our booking form with ID

    3

    if ($form_id == 3 ) {// only send if the form id is 3
    //check if the place id is submitted
    $post_id = (isset($_POST[‘gd_place_id’]) && $_POST[‘gd_place_id’]) ? absint($_POST[‘gd_place_id’]) : ”;
    if ($post_id) {
    // we found a post id so we can use it to get the place email address
    $place_email = geodir_get_post_meta($post_id, ‘geodir_email’);
    }
    // if we have a place email address we then add it to the list of email recipiants
    if ($place_email) {
    $recipients[] = $place_email;
    }
    }

    return $recipients;
    }

    // tell formidable to call our function when sending the form
    add_filter(‘frm_email_subject’, ‘geodir_booking_change_subject’, 10, 2);
    // add the listing name to the
    function geodir_booking_change_subject($subject, $atts){
    extract($atts);
    $post_id = (isset($_POST[‘gd_place_id’]) && $_POST[‘gd_place_id’]) ? absint($_POST[‘gd_place_id’]) : ”;
    // if form is our booking for and the post id exists
    if($form->id == 3 && $post_id){
    $place_name = get_the_title( $post_id );
    $subject = ‘Booking form for: ‘.$place_name; //Replace Thank You with your email subject
    }
    return $subject;
    }

    THANKS FOR HELP 😉

    #394910

    Kreat d.o.o. id ddv: 19894309
    Expired Member
    Post count: 6

    Sorry I found the mistake and now seems it works.

    Thank you very much! 🙂

    #394913

    Paolo
    Site Admin
    Post count: 31206

    Thanks for letting us know! 🙂

Viewing 5 posts - 1 through 5 (of 5 total)

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket
20% Discount Offer
Hurry! Get your 20% discount before it expires. Get 20% Discount