Gavity forms conditionals not working if they are inside a looper consumer

Hello,
I have a problem that I saw happened a few years ago.

i have a looper consumer and inside it i have a form element with gravity forms and prefill fields.

The problem is that it seems the conditional is not working and as a result i can see both elements showing or the price of both “products” (which are handled by a conditional) are always added as an addition and not as an OR sum.

Now, could you check what’s going on and why is it happening? I have really no idea what to do here.

another thing is that if i go to the next slide and then click on the button again, it will be empty!

Hello @franticape,

Thanks for writing in!

There seems to be an @ sign in your condition.
@{{dc:post:meta key="wpcf-fecha-preventa1"}}

  • See the secure note below.

Kindly remove the invalid character and test the page again.

Best Regards.

I removed the character from both the conditions yet the problem remains :frowning:

  • the conditional in the form is broken (it shows only one element, but the sum is as if both were showing)
  • If I move the slider, the form doesn’t load.

I think it has to do with AJAX and the looper consumer (not the provider) because if i place the form outside the looper, it works better. the only problem with that is that it loads the form with just the first element of the looper and not the current one being viewed.

Hello @franticape,

In your first Looper Consumer, enable the Rewind option.
image

image

It needs to be enabled so that the Looper Consumer on the right side goes through the returned items again.

Kindly let us know how it goes.

This didn’t solve any of the problems.

could you please test what you’re suggesting on the site? it’s ok, I have a site backup.

here’s a video showing the entire problem and where things are: https://www.loom.com/share/43a7bff5d732460aa3071f9be3404536

Hello @franticape,

Please keep in mind that you should NOT be using the same form over and over on the same page. You can check it here:

And also, Gravity Forms may not display properly on a modal form. Kindly check out this article documentation:

Hope this helps.

hello:

  1. the problem is not the modal because if i add it outside that consumer it works, it just shows the WRONG looper element but it does work

  2. What can i do to pass the dynamic content. like is thre a way to pass a variable inside the consumer and then use the variable outside the consumer?

the problem here is the consumer that for some reason is messing up with the conditional. that’s the main issue. he other issue with the form depends on how it’s rendered.

please let me know and please don’t tell me it’s a custom thing because it should not be anything “custom”, it’s dynamic content coming from loopers and consumers so it should be part of the support.

Hey @franticape,

I have created a demo page to show that the contents of the right slide that it coincides with the left slide. It will also check the field values that you are passing to the form. All I can see is that it returns the correct fields and items.

  • See the secure note below.

Thanks.

Hello,

I checked everything but i see everything blank, on each of the slides, what am I supposed to see? the form is not visible, nor can i see the values. can you please guide me?

oh sorry you mean the form on the left side. please note the TOTAL. note IT’S adding both elements even the ones being hidden and that’s not correct.

now add the same form with some static price. and note how that total works. you’ll see it will show the total based on the conditional and not add all up whether it’s in the conditional or not.

that is a problem linked to the consumer and cornerstone and NOT a bug in just gravity forms on its own. that’s what i’ve been trying to tell you all along.

so this is problem 1, let’s focus on that first, ok?

Hello @franticape,

You inserted the Gravity form “[gravityform id="1" title="true"]” inside the looper. As I pointed out, the Gravity Form should not be used used mutiple time on the page because it will not display the 2nd and 3rd consumer items.

As for your Total price, both your Partner and nonpartner prices need to have the same parameter name:
image

Then, in your Total field, you need to add the field management tag:
image

  • See the URL in the secure note below

Hope this makes sense.

I don’t see any link. if you mean the one from before (https://aladyr.net/cornerstone/edit/47021) then that one is showing the total in a wrong way as before, so I’m not sure where the change is showing. I’m going .

I have a question. if i add the parameters in a looper but the contact form outside, would that actually get the dynamic values of the parameters? I’d need to add the option to kind of reset on modal close, for example.

Guys, i’m seriously confused now with your instructions so I would like to know if you actually understand what the problem is here?

  1. The parameter names are ok
  2. the field management tag is set
  3. The conditional logic inside the form STOPS working correctly when added inside a consumer.
  4. The conditional itself does work, but if you add the form outside and set a fixed parameter to test, you’ll see that the total will only show the price of the selected option from the parameter and not ALWAYS both of them (there are 2 choices, 2 prices, the total should never have the total using option a + option b).

So, What i want at this point is a solution from you for the following:

  • How can i read the parameters from the consumer and add it to the gravity form?
  • If i need to add the gravity form outside the consumer, then how can i get the parameters value from the consumer?

what can you recommend?

Hello @franticape,

Question 1: How can I read the parameters from the Cornerstone Looper Consumer and add it to the Gravity Form?

You’re on the right track with the field_values parameter in the shortcode. However, there’s a critical limitation: Gravity Forms can only be rendered once per page. When you place the form inside a Looper Consumer, only the first instance will work—subsequent iterations won’t display the form at all.

The shortcode you’re using is technically correct for a single instance outside the looper:

php [gravityform id='1' title='true' field_values='precio_socio={{post.meta({"key":"wpcf-costo-socio-preventa"})}}&precio_nosocio={{post.meta({"key":"wpcf-costo-no-socio-preventa"})}}&faevent_name={{post.title({})}}']

But if you place this inside the Looper Consumer, it will not work for multiple items because Gravity Forms doesn’t support rendering the same form multiple times on a single page.

Question 2: If I need to add the Gravity Form outside the Looper Consumer, how can I get the parameters from the consumer?

Since Gravity Forms doesn’t support multiple instances inside a looper, your best option is to place the form outside the looper and pass the data via URL parameters.

Here’s how:

1.) Create a link inside your Looper Consumer that points to the page containing your Gravity Form, with the parameters appended to the URL:

html <a href="https://yoursite.com/form-page/?precio_socio={{post.meta({"key":"wpcf-costo-socio-preventa"})}}&precio_nosocio={{post.meta({"key":"wpcf-costo-no-socio-preventa"})}}&faevent_name={{post.title({})}}"> Request a Quote </a>

2.) Enable Dynamic Population in Gravity Forms for the fields you want to populate, using the same parameter names (precio_socio, precio_nosocio, faevent_name).

3.) When the user clicks the link, they’ll be taken to the form page with the data pre-filled.

Important Limitations:

  • Multiple forms on one page: Gravity Forms does not support rendering the same form multiple times. This is a limitation of the plugin itself, not Cornerstone.

  • Dynamic population via shortcode: The field_values parameter only works when the form is rendered on page load. It cannot be dynamically updated after the page loads.

  • No built-in “pass data to form” feature: Cornerstone does not have a native feature to pass looper data to a Gravity Form outside of URL parameters or the shortcode method.

Since the only reliable way to pass data from a looper to a form on the same page (without reloading) requires custom JavaScript, and we do not provide custom coding support, here are your options:

  • Use the URL parameter method (supported, no custom code needed) – The form must be on a separate page.

  • Use the shortcode outside the looper (supported, but only works for a single form instance).

  • Explore third-party plugins like Gravity Wiz that may offer solutions for passing data between forms and dynamic content.

  • Hire a developer for custom JavaScript/attribute implementation if you need the form on the same page.

If you’re not comfortable hiring an external developer, Theme.co offers a support service called ONE that may be able to help with this type of customization.