How to clear product info table cache

When a payment form in submitted in Gravity Forms a product info table is generated that includes a list of the products purchased and their prices. This information is cached in the rg_lead_meta table as a performance measure – however if the product label changes it will not automatically update the cache.

To fix this you need to run the gform_delete_meta function when the entry is accessed.

The following example shows how to clear the product info cache.

Note: you will need to change the form id to match your form.

If you’re not sure where to place this code I highly recommend you read How to create a WordPress plugin for your custom functions.

add_filter( 'gform_entry_detail_content_before', 'clear_product_info_cache', 10, 2 );
function clear_product_info_cache( $form, $entry ) {
    if ( 43 == $form['id'] ) {
        $use_choice_text = false;
        $use_admin_label = false;
        gform_delete_meta( $entry['id'], "gform_product_info_{$use_choice_text}_{$use_admin_label}" );
    }
}

For more information on using the