skip to Main Content

I want to populate the short description field of a WooCommerce product with Gravity Forms.
Unfortunately I couldn’t figure out the name of the meta field(?).

Every other meta field works fine. I’ve checked the code and some docs to find the correct name but I couldn’t find it.

I tried the following: excerpt, postexcerpt, post_excerpt.
In the backend code the field’s name is excerpt. To use the field’s name works for every other meta field.

2

Answers


  1. Chosen as BEST ANSWER

    The great support over at Gravity Forms pushed me in the right direction. You have to use a custom snippet to map the form field with short description / excerpt:

    add_action( 'gform_advancedpostcreation_post_after_creation', 'update_product_information', 10, 4 );
    function update_product_information( $post_id, $feed, $entry, $form ){
    
        //update the excerpt
        $the_post = array(
            'ID'           => $post_id,//the ID of the Post
            'post_excerpt' => $entry['60'],
        );
        wp_update_post( $the_post );
    
    }
    

    Here you can find some more informations: https://docs.gravityforms.com/advanced-post-creation-add-on-using-third-party-post-types/#handling-fields-unable-to-be-mapped-2


  2. This snippet will make the short description / excerpt show up as a mappable field:

    add_filter( 'gform_advancedpostcreation_excerpt', 'enable_excerpt', 10, 1 );
    function enable_excerpt( $enable_excerpt ){
        return true;
    }
    

    https://docs.gravityforms.com/gform_advancedpostcreation_excerpt/#examples

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search