Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Mário Valney

    (@mariovalney)

    Hi!

    All pasterbins are private. So I was not able to read them.

    I’ll take a time to check custom tags, but I’m pretty sure we have support for this. The plugin uses contact_form->scan_form_tags(); to get all tags (it’s working as you receive them in JSON) and $_POST[ $tag->name ] to get all values (maybe the problem?).

    Please, share the wpcf7_add_form_tag code so I can try to reproduce it?

    Thread Starter q1LLa

    (@vov7512)

    @mariovalney, I’m sorry, I’ve corrected access to attachments.

    Plugin Author Mário Valney

    (@mariovalney)

    Please, try add the custom exc-price tag this way:

    add_action( 'wpcf7_init', 'vov7512_add_form_tag_exc_price' );

    function vov7512_add_form_tag_exc_price() {
    wpcf7_add_form_tag( 'exc-price', 'vov7512_add_form_tag_exc_price_handler' );
    }

    function vov7512_add_form_tag_exc_price_handler( $tag ) {
    $price = '';

    if (is_singular('excursions')) {
    $price = get_post_meta(get_the_ID(), 'exc_price', true);
    }

    return '<input type="hidden" name="' . $tag['name'] . '" value="' . esc_attr($price) . '" />';
    }

    For post title you don’t need a new tag. Just use the Special Mail Tags: [_post_title].

    More info:

    Thread Starter q1LLa

    (@vov7512)

    @mariovalney , This code doesn’t work for me. I see tags in the form – https://i.imgur.com/omK5ZWh.png .

    Plugin Author Mário Valney

    (@mariovalney)

    The tags should be:

    • [_post_title] – on mail and webhook special mail tag session
    • [exc-price any-name] – on form
    • [any-name] – on mail and webhook special mail tag session

    I’m not able to check this on a working website right now. Maybe in the end of day I’ll have some time. I’m sorry for the inconvenience.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Data from hidden fields is not transmitted’ is closed to new replies.