# Pre render form -\> Edit field Product Price \[RESOLVED\]

**URL:** <https://community.gravityforms.com/t/pre-render-form-edit-field-product-price-resolved/10880>\
**Category:** Get Help\
**Tags:** gform\_pre\_render, product, field-baseprice\
**Created:** [October 7, 2021, 3:20pm UTC](https://community.gravityforms.com/t/pre-render-form-edit-field-product-price-resolved/10880 "2021-10-07T15:20:54Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![user6035415d6ba1c192](https://avatars.discourse-cdn.com/v4/letter/u/e56c9b/32.png) [@user6035415d6ba1c192](https://community.gravityforms.com/u/user6035415d6ba1c192)\
**Post date:** [October 7, 2021, 3:20pm UTC](https://community.gravityforms.com/t/pre-render-form-edit-field-product-price-resolved/10880/1 "2021-10-07T15:20:54Z")

</div>

Hi,

I try tro change the price of a product price field before we display it to the user.

So i use a gform\_pre\_render function and then a filter on my field :

```auto
add_filter('gform_pre_render_2', 'pre_render_form_inscription');
function pre_render_form_inscription($form)
{
   $fields = $form['fields'];
    foreach ($form['fields'] as &$field) {
       if ($field->id == 55) {
          $field->defaultValue = 1000;
       }
    }
}

```

This is not working.  
There is the function gform\_product\_price() as well, but it looks like it just for the label.

Any idea how to do this ?

Thanks

---

<div class="post-metadata">

**Author:** ![user6035415d6ba1c192](https://avatars.discourse-cdn.com/v4/letter/u/e56c9b/32.png) [@user6035415d6ba1c192](https://community.gravityforms.com/u/user6035415d6ba1c192)\
**Post date:** [October 7, 2021, 3:35pm UTC](https://community.gravityforms.com/t/pre-render-form-edit-field-product-price-resolved/10880/2 "2021-10-07T15:35:50Z")

</div>

I found it.

For a price the property is not defaultValue as an input text, but basePrice :

`$field->basePrice = 100;`

---

<div class="post-metadata">

**Author:** ![chrishajer](https://sea2.discourse-cdn.com/flex020/user_avatar/community.gravityforms.com/chrishajer/32/88_2.png) [@chrishajer](https://community.gravityforms.com/u/chrishajer)\
**Post date:** [October 8, 2021, 1:33am UTC](https://community.gravityforms.com/t/pre-render-form-edit-field-product-price-resolved/10880/3 "2021-10-08T01:33:20Z")

</div>


