# Set a Minimum Price on a Quotation Form

**URL:** <https://community.gravityforms.com/t/set-a-minimum-price-on-a-quotation-form/15547>\
**Category:** Get Help\
**Tags:** gf\_hidden, custom, notifications, minimum-price, gform\_validation, gravity-wiz\
**Created:** [July 17, 2023, 8:05pm UTC](https://community.gravityforms.com/t/set-a-minimum-price-on-a-quotation-form/15547 "2023-07-17T20:05:26Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![jfgroves86](https://avatars.discourse-cdn.com/v4/letter/j/e36b37/32.png) [@jfgroves86](https://community.gravityforms.com/u/jfgroves86)\
**Post date:** [July 17, 2023, 8:05pm UTC](https://community.gravityforms.com/t/set-a-minimum-price-on-a-quotation-form/15547/1 "2023-07-17T20:05:26Z")

</div>

Hey,  
I need help getting a form to work correctly. The form is to quote customers who want their windows cleaned, however because it’s typically low value, my client wants a minimum price adding to the quote. I’ve been following **[this tutorial](https://clicknathan.com/web-design/set-a-minimum-order-amount-gravity-forms/)** which seems to work on the front-end but doesn’t work when sending the quote and only sends the email with the product totals. Here’s what I mean:

By default, the total products = £6.00

 ![Screenshot 2023-07-17 at 20.57.30](https://us1.discourse-cdn.com/flex020/uploads/gravityforms1/original/2X/b/ba1abdad990a035a52daf4ca002b36ca6fb3f74b.png)

So the minimum fee applies to make it £12.00

But when the quote is emailed to both admin and the user it shows £6.00

[Here’s the link to the extra screenshots.](https://www.dropbox.com/t/bDC6BdSAJWRfEW1D)

Anyone know how I can get the email to show the exact same as the front end? The code I’ve used is below:

```auto
<script type="text/javascript">
    gform.addFilter( 'gform_product_total', function(total, formId){
        //only apply logic to form ID 3
        if(formId != 3)
            return total;
        if(total < 12)
            total = 12;
        return total;
    } );</script>

```

and in the functions.php

```auto
/** 
 * GRAVITY FORMS
 */
add_filter( 'gform_product_info', 'add_fee', 10, 3 );
function add_fee( $product_info, $form, $lead ) {
	$minimumprice = 12;
	$currentprice = $product_info['products'][1]['price'];
	$currentprice = str_replace('$','',$currentprice);
	$additionalfee = $minimumprice - $currentprice;
	if ( $currentprice >= 12 ) {
		$product_info = array(
            'products' => array(
                array(
                    'name' => 'Minimum Order Amount',
                    'price' => 12,
                    'quantity' => 1,
                ),
            ),
        );
	}
    return $product_info;
}

```

---

<div class="post-metadata">

**Author:** ![bethannon](https://avatars.discourse-cdn.com/v4/letter/b/ec9cab/32.png) [@bethannon](https://community.gravityforms.com/u/bethannon)\
**Post date:** [July 17, 2023, 11:57pm UTC](https://community.gravityforms.com/t/set-a-minimum-price-on-a-quotation-form/15547/2 "2023-07-17T23:57:57Z")

</div>

Others may be able to help you debug the code, but to quickly fix this, I think I’d remove the the snippet, and just use a Calculation product field.

In a number field that you hide with CSS (“gf\_hidden” in the custom CSS so that it still is available on the page programatically), add together the totals of all the product fields with their merge tags.

Add the Calculation field, and set it’s conditional logic to hide if the total is more than 12.

Then, set up the calculation so that the price of the field is 12 minus the total of all of the other products. This allows the person filling out the form to see that there is a minimum fee so that they’re not surprised by that.

Might that work?

---

<div class="post-metadata">

**Author:** ![jfgroves86](https://avatars.discourse-cdn.com/v4/letter/j/e36b37/32.png) [@jfgroves86](https://community.gravityforms.com/u/jfgroves86)\
**Post date:** [July 18, 2023, 12:05pm UTC](https://community.gravityforms.com/t/set-a-minimum-price-on-a-quotation-form/15547/3 "2023-07-18T12:05:14Z")

</div>

Thanks Bet and you may be on to something with the merge tags however the client doesn’t want to show any prices or the minimum fee, so on the styled version of the form all prices are hidden with css, so the only section that shows prices is the total.

Would there be a way to hide it?

Kind regards

Jason

---

<div class="post-metadata">

**Author:** ![bethannon](https://avatars.discourse-cdn.com/v4/letter/b/ec9cab/32.png) [@bethannon](https://community.gravityforms.com/u/bethannon)\
**Post date:** [July 18, 2023, 3:50pm UTC](https://community.gravityforms.com/t/set-a-minimum-price-on-a-quotation-form/15547/4 "2023-07-18T15:50:55Z")

</div>

You can hide any field with the custom CSS class “gf\_hidden” in the custom CSS. Does that help?

---

<div class="post-metadata">

**Author:** ![dario](https://sea2.discourse-cdn.com/flex020/user_avatar/community.gravityforms.com/dario/32/3901_2.png) [@dario](https://community.gravityforms.com/u/dario)\
**Post date:** [July 19, 2023, 1:33pm UTC](https://community.gravityforms.com/t/set-a-minimum-price-on-a-quotation-form/15547/5 "2023-07-19T13:33:48Z")

</div>

Hi Jason, not sure about the tutorial, but this should be possible by using [Gravity Forms Conditional Pricing | Gravity Perks | Gravity Wiz](https://gravitywiz.com/documentation/gravity-forms-conditional-pricing/) and creating a condition where the Product will have a minimum price if some conditions are met (the Quantity, for example)

 ![CleanShot 2023-07-19 at 10.33.34](https://us1.discourse-cdn.com/flex020/uploads/gravityforms1/original/2X/8/848c2a65205d53a063bbda426f93898aa7502ec2.jpeg)

I hope this helps!

---

<div class="post-metadata">

**Author:** ![jfgroves86](https://avatars.discourse-cdn.com/v4/letter/j/e36b37/32.png) [@jfgroves86](https://community.gravityforms.com/u/jfgroves86)\
**Post date:** [July 21, 2023, 10:33am UTC](https://community.gravityforms.com/t/set-a-minimum-price-on-a-quotation-form/15547/6 "2023-07-21T10:33:07Z")

</div>

Thanks Dario but trying to avoid a premium plugin for a one off project. The client won’t pay the yearly costs.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex020/uploads/gravityforms1/original/2X/f/fef63f0599c45e0218c30d9f5d7ca8bff9b00189.png) [@system](https://community.gravityforms.com/u/system)\
**Post date:** [August 20, 2023, 10:33am UTC](https://community.gravityforms.com/t/set-a-minimum-price-on-a-quotation-form/15547/7 "2023-08-20T10:33:56Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
