• Resolved Scott Paterson

    (@scottpaterson)


    Does anyone know how to get the value from a pipes field, example:

    [select menu-553 “option 1 $5.99 | 5.99” “option 2 $6.99 | 6.99”]

    I want the variable name for the values 5.99 or the 6.99 in the wpcf7_mail_sent hook. The post value only contains “option 1 $5.99”.

    I tried this on a longshot:

    echo $_POST[‘_raw_menu-553’];

    but it is not defined. Which makes sense as it is not being posted.

    Thanks,
    Scott

    https://www.ads-software.com/plugins/contact-form-7/

Viewing 1 replies (of 1 total)
  • Thread Starter Scott Paterson

    (@scottpaterson)

    Found the solution after a few hours of work… here is the answer for anyone that has this same problem:

    In the wpcf7_mail_sent hook get $contact_form instead of $cf7 like so:

    function cf7pp_after_send_mail( $contact_form ) {

    Then access the array:

    submission = WPCF7_Submission::get_instance();
    
    if ( $submission ) {
    $posted_data = $submission->get_posted_data();
    $price = $posted_data['menu-553'];

Viewing 1 replies (of 1 total)
  • The topic ‘Get value from pipes field in wpcf7_mail_sent’ is closed to new replies.