<?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: Dynamically populate price field dropodown</title>
		<link>https://legacy.forums.gravityhelp.com/topic/dynamically-populate-price-field-dropodown</link>
		<description>Gravity Support Forums Topic: Dynamically populate price field dropodown</description>
		<language>en-US</language>
		<pubDate>Tue, 21 Apr 2026 02:15:01 +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/dynamically-populate-price-field-dropodown" rel="self" type="application/rss+xml" />

		<item>
			<title>Alex Cancado on "Dynamically populate price field dropodown"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/dynamically-populate-price-field-dropodown#post-51021</link>
			<pubDate>Thu, 01 Mar 2012 11:42:14 +0000</pubDate>
			<dc:creator>Alex Cancado</dc:creator>
			<guid isPermaLink="false">51021@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;I looked at your checkbox code and it seems like you have an extra array() when creating the $checkboxes and $inputs variable.&#60;br /&#62;
Try replacing:&#60;br /&#62;
&#60;pre&#62;&#60;code&#62;$checkboxes[] = array(array(&#38;#39;text&#38;#39; =&#38;gt; $accservice[&#38;#39;accservice_label&#38;#39;], &#38;#39;value&#38;#39; =&#38;gt; $accservice[&#38;#39;accservice_label&#38;#39;], &#38;#39;price&#38;#39; =&#38;gt; $accservice[&#38;#39;accservice_price&#38;#39;].&#38;#39;.00&#38;#39;, &#38;#39;isSelected&#38;#39; =&#38;gt; false));
$inputs[] = array(array(&#38;#39;id&#38;#39; =&#38;gt; $count, label =&#38;gt; $accservice[&#38;#39;accservice_label&#38;#39;]));&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;with the following:&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;$checkboxes[] = array(&#38;#39;text&#38;#39; =&#38;gt; $accservice[&#38;#39;accservice_label&#38;#39;], &#38;#39;value&#38;#39; =&#38;gt; $accservice[&#38;#39;accservice_label&#38;#39;], &#38;#39;price&#38;#39; =&#38;gt; $accservice[&#38;#39;accservice_price&#38;#39;].&#38;#39;.00&#38;#39;, &#38;#39;isSelected&#38;#39; =&#38;gt; false);
$inputs[] = array(&#38;#39;id&#38;#39; =&#38;gt; $count, label =&#38;gt; $accservice[&#38;#39;accservice_label&#38;#39;]);&#60;/code&#62;&#60;/pre&#62;</description>
		</item>
		<item>
			<title>Gaslight on "Dynamically populate price field dropodown"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/dynamically-populate-price-field-dropodown#post-50662</link>
			<pubDate>Mon, 27 Feb 2012 11:23:29 +0000</pubDate>
			<dc:creator>Gaslight</dc:creator>
			<guid isPermaLink="false">50662@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Any updates yet?
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Gaslight on "Dynamically populate price field dropodown"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/dynamically-populate-price-field-dropodown#post-50074</link>
			<pubDate>Tue, 21 Feb 2012 02:30:20 +0000</pubDate>
			<dc:creator>Gaslight</dc:creator>
			<guid isPermaLink="false">50074@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Dweanus in my case it's about price fields; the method suggested in that documentation page is not suitable for price fields, I had to specific the ID of the price field I wanted to modify, both for dropdowns and checkboxes&#60;/p&#62;
&#60;p&#62;Anyway, the dropdown issue is fixed... if there had been a way to contribute to the documentation pages I wouldn't mind having helped in this case&#60;/p&#62;
&#60;p&#62;Now I have still one issue open about the checkboxes (check a couple of my posts above &#60;a href=&#34;http://www.gravityhelp.com/forums/topic/dynamically-populate-price-field-dropodown#post-49969&#34; rel=&#34;nofollow&#34;&#62;http://www.gravityhelp.com/forums/topic/dynamically-populate-price-field-dropodown#post-49969&#60;/a&#62; ) - if the mods wish me to open a new thread for that it's fine&#60;/p&#62;
&#60;p&#62;I agree documentation should be commented - I follow WooCodex for WooCommerce and it has that feature, I like it&#60;/p&#62;
&#60;p&#62;cheers
&#60;/p&#62;</description>
		</item>
		<item>
			<title>dwenaus on "Dynamically populate price field dropodown"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/dynamically-populate-price-field-dropodown#post-50028</link>
			<pubDate>Mon, 20 Feb 2012 17:18:39 +0000</pubDate>
			<dc:creator>dwenaus</dc:creator>
			<guid isPermaLink="false">50028@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;this link: &#60;a href=&#34;http://www.gravityhelp.com/documentation/page/Dynamically_Populating_Drop_Down_Fields&#34; rel=&#34;nofollow&#34;&#62;http://www.gravityhelp.com/documentation/page/Dynamically_Populating_Drop_Down_Fields&#60;/a&#62; should be posted on this page: &#60;a href=&#34;http://www.gravityhelp.com/documentation/page/Using_Dynamic_Population#Hooks&#34; rel=&#34;nofollow&#34;&#62;http://www.gravityhelp.com/documentation/page/Using_Dynamic_Population#Hooks&#60;/a&#62;&#60;/p&#62;
&#60;p&#62;and once again I request commenting be enabled on the documentation pages. So people can help each other - like they do on php.net.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Gaslight on "Dynamically populate price field dropodown"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/dynamically-populate-price-field-dropodown#post-49973</link>
			<pubDate>Mon, 20 Feb 2012 12:24:43 +0000</pubDate>
			<dc:creator>Gaslight</dc:creator>
			<guid isPermaLink="false">49973@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;line 8 of the first pastie containing only the snippet for the checkboxes, there were missing quotes for &#34;label&#34;, I fixed it but no change&#60;/p&#62;
&#60;p&#62;I found out if remove the brackes [] from $checkboxes[] (line 7) and $inputs[] (line 8) the code will work, but of course the foreach won't and the array will be filled only with the last array key I'm feeding the loop&#60;/p&#62;
&#60;p&#62;I'm looking for a solution, probably something wrong with my code
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Gaslight on "Dynamically populate price field dropodown"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/dynamically-populate-price-field-dropodown#post-49969</link>
			<pubDate>Mon, 20 Feb 2012 12:10:34 +0000</pubDate>
			<dc:creator>Gaslight</dc:creator>
			<guid isPermaLink="false">49969@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;hmm sorry it didn't work&#60;/p&#62;
&#60;p&#62;check: &#60;a href=&#34;http://pastie.org/3421246&#34; rel=&#34;nofollow&#34;&#62;http://pastie.org/3421246&#60;/a&#62;&#60;br /&#62;
this is just the part for checkboxes &#60;/p&#62;
&#60;p&#62;this is the pastie for the whole function: &#60;a href=&#34;http://pastie.org/3421271&#34; rel=&#34;nofollow&#34;&#62;http://pastie.org/3421271&#60;/a&#62;&#60;br /&#62;
the others are dropdown and are working really well&#60;/p&#62;
&#60;p&#62;but I still have the following issue with checkboxes field&#60;/p&#62;
&#60;p&#62;I think the $inputs are generated correctly - suppose I have two keys in the array I'm using to generate the checkboxes, then I will have correctly 2 checkboxes, with correct ID. If my array has, suppose,  3 keys, then the checkboxes will be 3 and so on. However those have empty values, no text and by default are checked.&#60;/p&#62;
&#60;p&#62;Something is wrong with the $choices array perhaps? However if I do a var_dump of $choices and $inputs outiside of that context they look correct, I mean the arrays I'm using to generate the checkboxes should be ok.&#60;/p&#62;
&#60;p&#62;thanks
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Alex Cancado on "Dynamically populate price field dropodown"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/dynamically-populate-price-field-dropodown#post-49959</link>
			<pubDate>Mon, 20 Feb 2012 11:19:32 +0000</pubDate>
			<dc:creator>Alex Cancado</dc:creator>
			<guid isPermaLink="false">49959@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;@Gaslight,&#60;br /&#62;
Use the following code snippet as a guideline on how to populate the option checkbox field as well as your product drop down field.&#60;br /&#62;
&#60;a href=&#34;http://pastie.org/3420970&#34; rel=&#34;nofollow&#34;&#62;http://pastie.org/3420970&#60;/a&#62;&#60;/p&#62;
&#60;p&#62;Good Luck!
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Gaslight on "Dynamically populate price field dropodown"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/dynamically-populate-price-field-dropodown#post-49933</link>
			<pubDate>Mon, 20 Feb 2012 03:45:11 +0000</pubDate>
			<dc:creator>Gaslight</dc:creator>
			<guid isPermaLink="false">49933@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;for checkboxes, I'm trying the following code, but it doesn't work - I can create a correct amount of options, but values, labels and prices are empty - also for some reason one of them appears checked, while they should be all unchecked by default&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;if($field[&#38;#39;id&#38;#39;] == 9) {
            $accservices = get_field(&#38;#39;package_accservices&#38;#39;, $post-&#38;gt;ID);
            if(!empty($accservices)) {
                $choices = array();
                foreach($accservices as $accservice) :
                    $choices[] = array(array(&#38;#39;text&#38;#39; =&#38;gt; $accservice[&#38;#39;accservice_label&#38;#39;], &#38;#39;value&#38;#39; =&#38;gt; $accservice[&#38;#39;accservice_price&#38;#39;], &#38;#39;price&#38;#39; =&#38;gt; $accservice[&#38;#39;accservice_price&#38;#39;]));
                endforeach;
                $field[&#38;#39;choices&#38;#39;] = $choices;
            }
        }&#60;/code&#62;&#60;/pre&#62;</description>
		</item>
		<item>
			<title>Gaslight on "Dynamically populate price field dropodown"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/dynamically-populate-price-field-dropodown#post-49882</link>
			<pubDate>Sun, 19 Feb 2012 11:19:23 +0000</pubDate>
			<dc:creator>Gaslight</dc:creator>
			<guid isPermaLink="false">49882@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;never mind about the simple price field, I managed to do that&#60;/p&#62;
&#60;p&#62;now I'm trying to dynamically populate price options checkboxes&#60;/p&#62;
&#60;p&#62;which method is required for those? same as dropdown with $choices ?
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Gaslight on "Dynamically populate price field dropodown"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/dynamically-populate-price-field-dropodown#post-49765</link>
			<pubDate>Fri, 17 Feb 2012 20:14:59 +0000</pubDate>
			<dc:creator>Gaslight</dc:creator>
			<guid isPermaLink="false">49765@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;oh thanks Alex that workerd really well&#60;/p&#62;
&#60;p&#62;one further question if you don't mind, suppose I have a standard pricing field, should I use&#60;/p&#62;
&#60;p&#62;Gform_field_value_$parameter_name as described here:&#60;br /&#62;
&#60;a href=&#34;http://www.gravityhelp.com/documentation/page/Gform_field_value_$parameter_name&#34; rel=&#34;nofollow&#34;&#62;http://www.gravityhelp.com/documentation/page/Gform_field_value_$parameter_name&#60;/a&#62;&#60;/p&#62;
&#60;p&#62;right now I'm trying to add the price in this way, however the value I'm fetching to set the price changes from product to product - maybe I need to use the pre_render method? If so how should I fill the $field variable? I tried $field = $my_value (fetched from custom meta) but it didn't work...&#60;/p&#62;
&#60;p&#62;thanks again!
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
