Add Custom Total to Order Summary

Code

Filename: gpecf-custom-total.php

<?php
/**
 * Gravity Perks // GP eCommerce Fields // Add Custom Total to Order Summary
 * https://gravitywiz.com/documentation/gravity-forms-ecommerce-fields/
 */
// Update "123" with your form ID.
add_filter( 'gpecf_order_summary_123', function( $order_summary ) {

	$order_summary['total'] = array_merge( array(
		array(
			'name'     => 'Recurring Total',
			'price'    => '$400',
			'quantity' => 1,
			'class'    => 'total',
		),
	), $order_summary['total'] );

	return $order_summary;
} );

Leave a Reply

Your email address will not be published. Required fields are marked *

  • Trouble installing this snippet? See our troubleshooting tips.
  • Need to include code? Create a gist and link to it in your comment.
  • Reporting a bug? Provide a URL where this issue can be recreated.

By commenting, I understand that I may receive emails related to Gravity Wiz and can unsubscribe at any time.