Contact information not transferring over

This topic has 10 replies, 2 voices, and was last updated 10 years, 2 months ago ago by Eva Kemp

  • Avatar: hbartlow
    hbartlow
    Participant
    November 19, 2015 at 17:37

    Hi there, I’m having an issue with the contact form. I was able to edit the fields by going into framework/shortcodes.php, (I changed website to phone and made it required) however, the information in the phone field does not transfer over when I send a test message. I think I may have missed a step somewhere… Thanks for any help you can provide. Really really great theme, thank you so much! Heather

    9 Answers
    Avatar: Eva
    Eva Kemp
    Participant
    November 19, 2015 at 17:49

    Hello,

    You should also modify the code in file wp-content/themes/woopress/framework/theme-functions.php (lines 1365-1455).

    Regards,
    Eva Kemp.

    Avatar: hbartlow
    hbartlow
    Participant
    November 19, 2015 at 19:14

    Thank you so much for your fast reply. Unfortunately I still cant get it to work. I am not at all familiar with how php works, but if it helps here is the code I changed. I am using a child theme, and set these pages up in a new Framework folder. Thank you for any help!

    Shortcodes.php

    <div class=”form-group”>
    <p class=”form-name”>
    <label for=”contact-phone” class=”control-label”><?php _e(‘Phone Number’, ETHEME_DOMAIN) ?><span class=”required”>*</span></label>
    <input type=”text” name=”contact-phone” class=”form-control” id=”contact-phone”>
    </p>
    </div>

    theme-framework.php

    // **********************************************************************//
    // ! Send message from contact form
    // **********************************************************************//

    add_action( ‘wp_ajax_et_send_msg_action’, ‘et_send_msg_action’ );
    add_action( ‘wp_ajax_nopriv_et_send_msg_action’, ‘et_send_msg_action’ );
    if(!function_exists(‘et_send_msg_action’)) {
    function et_send_msg_action() {
    $error_name = false;
    $error_email = false;
    $error_phone = false;
    $error_msg = false;

    $captcha_instance = new ReallySimpleCaptcha();

    if(isset($_GET[‘contact-submit’])) {
    header(“Content-type: application/json”);
    $name = ”;
    $email = ”;
    $phone = ”;
    $message = ”;
    $reciever_email = ”;
    $return = array();

    if(!$captcha_instance->check( $_GET[‘captcha-prefix’], $_GET[‘captcha-word’] )) {
    $return[‘status’] = ‘error’;
    $return[‘msg’] = __(‘The security code you entered did not match. Please try again.’, ETHEME_DOMAIN);
    echo json_encode($return);
    die();
    }

    if(trim($_GET[‘contact-name’]) === ”) {
    $error_name = true;
    } else{
    $name = trim($_GET[‘contact-name’]);
    }

    if(trim($_GET[‘contact-email’]) === ” || !isValidEmail($_GET[‘contact-email’])) {
    $error_email = true;
    } else{
    $email = trim($_GET[‘contact-email’]);
    }

    if(trim($_GET[‘contact-msg’]) === ”) {
    $error_msg = true;
    } else{
    $message = trim($_GET[‘contact-msg’]);
    }

    $phone = stripslashes(trim($_GET[‘contact-phone’]));

    // Check if we have errors

    if(!$error_name && !$error_email && !$error_msg) {
    // Get the received email
    $reciever_email = etheme_get_option(‘contacts_email’);

    $subject = ‘You have been contacted by ‘ . $name;

    $body = “You have been contacted by $name. Their message is: ” . PHP_EOL . PHP_EOL;
    $body .= $message . PHP_EOL . PHP_EOL;
    $body .= “You can contact $name at $email or $phone”;
    $body .= $phone . PHP_EOL . PHP_EOL;
    }
    $body .= PHP_EOL . PHP_EOL;

    $headers = “From $email “. PHP_EOL;
    $headers .= “Reply-To: $email”. PHP_EOL;
    $headers .= “MIME-Version: 1.0”. PHP_EOL;
    $headers .= “Content-type: text/plain; charset=utf-8”. PHP_EOL;
    $headers .= “Content-Transfer-Encoding: quoted-printable”. PHP_EOL;

    if(wp_mail($reciever_email, $subject, $body, $headers)) {
    $return[‘status’] = ‘success’;
    $return[‘msg’] = __(‘All is well, your email has been sent.’, ETHEME_DOMAIN);
    } else{
    $return[‘status’] = ‘error’;
    $return[‘msg’] = __(‘Error while sending a message!’, ETHEME_DOMAIN);
    }
    $captcha_instance->remove( $_GET[‘captcha-prefix’] );

    }else{
    // Return errors
    $return[‘status’] = ‘error’;
    $return[‘msg’] = __(‘Please, fill in the required fields!’, ETHEME_DOMAIN);
    }

    echo json_encode($return);
    die();
    }
    }
    }

    Avatar: Eva
    Eva Kemp
    Participant
    November 19, 2015 at 20:31

    Hello,

    Please provide us with wp-admin panel and FTP credentials in Private Content.

    Thank you.

    Regards,
    Eva Kemp.

    Avatar: hbartlow
    hbartlow
    Participant
    November 20, 2015 at 19:11

    Can you confirm that you received the info via private message. Thanks!
    Heather

    Avatar: Eva
    Eva Kemp
    Participant
    November 20, 2015 at 19:41

    Hello,

    Sorry, but we didn’t receive any information.
    Please resend it.

    Regards,
    Eva Kemp.

    Avatar: hbartlow
    hbartlow
    Participant
    November 20, 2015 at 23:16

    Hi there,

    Information requested is in private content. Thank you!

    Heather

    Please, contact administrator
    for this information.
    Avatar: Eva
    Eva Kemp
    Participant
    November 21, 2015 at 17:21

    Hello,

    I’ve added the code into child functions.php.
    Please check contact form now.

    Regards,
    Eva Kemp.

    Avatar: hbartlow
    hbartlow
    Participant
    November 23, 2015 at 16:13

    Thank you! It works great!

    Have a wonderful day!

    Avatar: Eva
    Eva Kemp
    Participant
    November 23, 2015 at 18:02

    Hello,

    You’re welcome.

    Have a great day too!

    Regards,
    Eva Kemp.

  • Viewing 10 results - 1 through 10 (of 10 total)

The issue related to '‘Contact information not transferring over’' has been successfully resolved, and the topic is now closed for further responses

We're using our own and third-party cookies to improve your experience and our website. Keep on browsing to accept our cookie policy.