MG1
MG1

Reputation: 1687

Expanding the Gravity Forms e-commerce features

I am looking to create a "chinese auction" website. This is a method of fundraising where prizes are auctioned off and people purchase tickets on the website and put them towards a prize(s). Gravity Forms has the capability to sell products and tickets which I am familiar with. I'm just looking for some direction on how to integrate the process of buying tickets and applying them towards a prize.

Upvotes: 0

Views: 134

Answers (1)

Dave from Gravity Wiz
Dave from Gravity Wiz

Reputation: 2859

One idea is to create the "tickets" using the GF Coupon Add-on and my Creating Coupons for GF Coupons Add-on with Gravity Forms snippet.

With this snippet, you can easily create a coupon code for each "ticket" which the user could then apply on subsequent submissions to get the prizes.

I'll admit, there might some oddness with this approach if tickets have no monetary value associated but you might be able to obscure some of that oddness via CSS to hide totals and pricing output.

--- Updated: Jan 30th, 2015 ---

I'm happy to elaborate on this idea. I don't think that this is the best solution but it is a solution available with existing code.

First, here's a demo of what the form might look like.

  • We use a Product field to hold the products available for the raffle. Each product costs a minimum of $1 (i.e. 1 ticket).
  • We use a Total field to calculate how many tickets are required.
  • We use a Coupon field to calculate allow the user to enter their "tickets" towards the selected product.

When an appropriate amount of tickets have been entered, the submit button appears.

Shortcomings

  • This only works if the form is dedicated to the raffle ticket exchange. If you need to use the product fields for any other purpose, this solution will not work.
  • The required tickets and coupon codes are currently formatted in dollars. Obviously, their intended purpose is to work in units of money not tickets. This could be fixed with additional code.

How do I set this up?

You'll need one form to generate a coupon. You can use custom code or GP Unique ID to generate a unique code and this snippet to create a coupon (i.e. ticket) based on that unique code.

You'll also need a second form where the user can actually use their tickets to purchase items. See the field instructions above on how to configure this form.

Upvotes: 3

Related Questions