PLEASE NOTE: These forums are no longer utilized and are provided as an archive for informational purposes only. All support issues will be handled via email using our support ticket system. For more detailed information on this change, please see this blog post.

Use shortcode as value in multiple choice field type

  1. jasongill
    Member

    Hey Gravity Forms team, hopefully you can help me with an odd issue.

    My form is going to be a small shopping cart that links to digital products. I'm using the PluginBuddy S3 plugin to make a shortcode for each of my products, like:

    [s3 access_key='asdf' secret_key='123123' bucket='mybucket' expires='3600' file='thedownload.zip']A digital download file[/s3]

    I have a few (about 100) different files that I want to sell and have imported each of them into a product field type, and I've set the label of each to be the display name that I want to appear in the form, and the value to the full shortcode text (as seen above), plus a price.

    When someone pays via PayPal, I want to send them the S3 links to their selected products. I've tried using the "insert form field" in the confirmation and email notification, but all that appears to do is to insert the label text, not the actual value from the form. Is it possible to get this to output the value (and have that value be a shortcode which is then parsed before sending to the browser or emailing)?

    Or, if that isn't possible, is it possible to do any sort of logic in the confirmation/notifications, so that I could basically say something like "If the field called 'my main product' is true, display the following HTML" (which I could then repeat for each product).

    Hope this makes sense and that there is an easy solution. Thanks for your help! - Jason

    Posted 12 years ago on Tuesday May 17, 2011 | Permalink
  2. Nicholas
    Member

    I want to be able to do pretty much the same thing, only it's one digital product amongst several other intangibles (membership dues, fees, etc). Did you find a solution that allowed you to send a particular link or html on a page after purchasing a certain item?

    Posted 12 years ago on Sunday July 31, 2011 | Permalink
  3. The notification message supports shortcodes. So what you could do is include the shortcode in the notification message itself. You want the expiring link to be generated when the notification is sent, you don't want to store an expiring link as the value with the entry itself.

    Store the filename as the value of the field, and then access that field value in your notification message and use it in conjunction with your shortcode. For example:

    [s3 access_key='asdf' secret_key='123123' bucket='mybucket' expires='3600' file='{My Field:1:value}']A digital download file[/s3]

    Posted 12 years ago on Monday August 1, 2011 | Permalink