<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="bbPress/1.0.1" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title>Gravity Support Forums Topic: Can Pricing Field Populate Dynamically From Custom Field?</title>
		<link>https://legacy.forums.gravityhelp.com/topic/can-pricing-field-populate-dynamically-from-custom-field</link>
		<description>Gravity Support Forums Topic: Can Pricing Field Populate Dynamically From Custom Field?</description>
		<language>en-US</language>
		<pubDate>Sat, 04 Apr 2026 12:45:56 +0000</pubDate>
		<generator>http://bbpress.org/?v=1.0.1</generator>
		<textInput>
			<title><![CDATA[Search]]></title>
			<description><![CDATA[Search all topics from these forums.]]></description>
			<name>q</name>
			<link>https://legacy.forums.gravityhelp.com/search.php</link>
		</textInput>
		<atom:link href="https://legacy.forums.gravityhelp.com/rss/topic/can-pricing-field-populate-dynamically-from-custom-field" rel="self" type="application/rss+xml" />

		<item>
			<title>Gil Namur on "Can Pricing Field Populate Dynamically From Custom Field?"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/can-pricing-field-populate-dynamically-from-custom-field#post-30123</link>
			<pubDate>Fri, 15 Jul 2011 13:41:49 +0000</pubDate>
			<dc:creator>Gil Namur</dc:creator>
			<guid isPermaLink="false">30123@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Hey Alex,&#60;br /&#62;
This worked PERFECTLY!&#60;br /&#62;
THANK YOU!!!&#60;br /&#62;
Cheers,&#60;br /&#62;
Gil
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Gil Namur on "Can Pricing Field Populate Dynamically From Custom Field?"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/can-pricing-field-populate-dynamically-from-custom-field#post-29951</link>
			<pubDate>Wed, 13 Jul 2011 23:56:36 +0000</pubDate>
			<dc:creator>Gil Namur</dc:creator>
			<guid isPermaLink="false">29951@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Thanks Alex!&#60;br /&#62;
I'll let you know how it turns out!&#60;br /&#62;
Cheers,&#60;br /&#62;
Gil
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Alex Cancado on "Can Pricing Field Populate Dynamically From Custom Field?"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/can-pricing-field-populate-dynamically-from-custom-field#post-29947</link>
			<pubDate>Wed, 13 Jul 2011 21:43:00 +0000</pubDate>
			<dc:creator>Alex Cancado</dc:creator>
			<guid isPermaLink="false">29947@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;You can use the following then. Just make sure to replace the Field IDs (i.e. 8, 9 and 10) with yours.&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;add_filter(&#38;quot;gform_pre_render&#38;quot;, &#38;quot;populate_price&#38;quot;);
function populate_price($form){

    //only applies to form id 165
    if($form[&#38;quot;id&#38;quot;] != 165)
       return $form;

    global $post;

    //Setting price for product field id 8. Replace 8 with your actual field id. You can get the field id by looking at the input name in the markup.
    foreach($form[&#38;quot;fields&#38;quot;] as &#38;amp;$field)
        if($field[&#38;quot;id&#38;quot;] == 8){
			$price = get_post_meta($post-&#38;gt;ID, &#38;quot;_widget_1_price&#38;quot;, true);
            $field[&#38;quot;basePrice&#38;quot;] = $price;
        }
		else if($field[&#38;quot;id&#38;quot;] == 9){
			$price = get_post_meta($post-&#38;gt;ID, &#38;quot;_widget_2_price&#38;quot;, true);
            $field[&#38;quot;basePrice&#38;quot;] = $price;
        }
		else if($field[&#38;quot;id&#38;quot;] == 10){
			$price = get_post_meta($post-&#38;gt;ID, &#38;quot;_widget_3_price&#38;quot;, true);
            $field[&#38;quot;basePrice&#38;quot;] = $price;
        }

    return $form;
}&#60;/code&#62;&#60;/pre&#62;</description>
		</item>
		<item>
			<title>Gil Namur on "Can Pricing Field Populate Dynamically From Custom Field?"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/can-pricing-field-populate-dynamically-from-custom-field#post-29944</link>
			<pubDate>Wed, 13 Jul 2011 20:43:24 +0000</pubDate>
			<dc:creator>Gil Namur</dc:creator>
			<guid isPermaLink="false">29944@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Hi Alex,&#60;/p&#62;
&#60;p&#62;Different fields in the same form. &#60;/p&#62;
&#60;p&#62;Thanks !&#60;br /&#62;
Cheers,&#60;br /&#62;
Gil
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Alex Cancado on "Can Pricing Field Populate Dynamically From Custom Field?"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/can-pricing-field-populate-dynamically-from-custom-field#post-29936</link>
			<pubDate>Wed, 13 Jul 2011 18:32:56 +0000</pubDate>
			<dc:creator>Alex Cancado</dc:creator>
			<guid isPermaLink="false">29936@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;It depends. Do these apply to different forms, or different fields in the same form?
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Carl Hancock on "Can Pricing Field Populate Dynamically From Custom Field?"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/can-pricing-field-populate-dynamically-from-custom-field#post-29934</link>
			<pubDate>Wed, 13 Jul 2011 18:24:20 +0000</pubDate>
			<dc:creator>Carl Hancock</dc:creator>
			<guid isPermaLink="false">29934@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;You could incorporate all 3 into the single function call.  So you wouldn't add that code 3 times to your functions.php, you'd add it once but you'd modify it so it does all 3 at the same time.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Gil Namur on "Can Pricing Field Populate Dynamically From Custom Field?"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/can-pricing-field-populate-dynamically-from-custom-field#post-29930</link>
			<pubDate>Wed, 13 Jul 2011 17:57:46 +0000</pubDate>
			<dc:creator>Gil Namur</dc:creator>
			<guid isPermaLink="false">29930@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Hi Alex!&#60;br /&#62;
Thanks so much! So if I had 3 different custom fields&#60;br /&#62;
_widget_1_price&#60;br /&#62;
_widget_2_price&#60;br /&#62;
_widget_3_price&#60;br /&#62;
I would need to add this code to my functions.php for each one yes?&#60;/p&#62;
&#60;p&#62;Cheers,&#60;br /&#62;
Gil
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Alex Cancado on "Can Pricing Field Populate Dynamically From Custom Field?"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/can-pricing-field-populate-dynamically-from-custom-field#post-29927</link>
			<pubDate>Wed, 13 Jul 2011 17:30:57 +0000</pubDate>
			<dc:creator>Alex Cancado</dc:creator>
			<guid isPermaLink="false">29927@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Use the following code snippet, making sure to update the Form and Field IDs to match yours.&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;add_filter(&#38;quot;gform_pre_render&#38;quot;, &#38;quot;populate_price&#38;quot;);
function populate_price($form){

    //only applies to form id 165
    if($form[&#38;quot;id&#38;quot;] != 165)
       return $form;

    global $post;
    //replace &#38;quot;my_price_meta&#38;quot; with your custom field name
    $price = get_post_meta($post-&#38;gt;ID, &#38;quot;my_price_meta&#38;quot;, true);

    //Setting price for product field id 8. Replace 8 with your actual field id. You can get the field id by looking at the input name in the markup.
    foreach($form[&#38;quot;fields&#38;quot;] as &#38;amp;$field)
        if($field[&#38;quot;id&#38;quot;] == 8){
            $field[&#38;quot;basePrice&#38;quot;] = $price;
        }

    return $form;
}&#60;/code&#62;&#60;/pre&#62;</description>
		</item>
		<item>
			<title>Gil Namur on "Can Pricing Field Populate Dynamically From Custom Field?"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/can-pricing-field-populate-dynamically-from-custom-field#post-29883</link>
			<pubDate>Wed, 13 Jul 2011 10:25:04 +0000</pubDate>
			<dc:creator>Gil Namur</dc:creator>
			<guid isPermaLink="false">29883@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Hi There,&#60;/p&#62;
&#60;p&#62;Suppose I have a simple order form, and I want the price in the product field to come from a custom field in the post, can that be done and if so, how? &#60;/p&#62;
&#60;p&#62;I searched for this but could not see it so forgive me if this has been covered!&#60;/p&#62;
&#60;p&#62;Thanks and Cheers,&#60;br /&#62;
Gil
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
