WooCommerce Extension - WooCommerce Subscriptions Integration

If you use WooCommerce Subscriptions with our WooCommerce Extension, after enabling "Create Order" in your form, new entries will be created when there are new orders, regardless of renewal status.

You might want to exclude renewal orders from your form, the following snippet in your functions.php could do the trick:

function my_gravityflowwoocommerce_can_create_entry( $can_create, $form_id, $order ) {
	if ( function_exists( 'wcs_order_contains_renewal' ) ) {
		if ( $form_id !== 3 ) { // Specify your form ID here.
			return $can_create;
		}

		$is_renewal = wcs_order_contains_renewal( $order );
		if ( $is_renewal ) {
			$can_create = false;
		}
	}
	return $can_create;
}
add_filter( 'gravityflowwoocommerce_can_create_entry', 'my_gravityflowwoocommerce_can_create_entry', 10, 3 );