Jump to content


Welcome to the forum:

Welcome to the iThemes, PluginBuddy and WebDesign.com forum. We've created several tutorial video's to help you get you started with using the forum, please check them out!

Also take note of the forum guidelines.


Support hours:

Our moderators actively respond to forum support requests during normal business hours which are Monday-Friday, 8am - 5pm Central Standard Time, typically within one business day. Although some moderators choose to work during the weekends, we can not guarantee immediate attention to your requests. Thanks for understanding.

What is included with support:

Premium support includes theme/plugin issues such as: bugs encountered under normal operation, how to use basic features, basic WordPress help, and basic help with customization (meaning we point you to resources and will help in more depth as time allows). More information.

Gravity Forms And Exchange

gravity forms

6 replies to this topic

#1 Guest_Aplus_*

Guest_Aplus_*
  • Guests

Posted 19 September 2013 - 10:37 AM

I have a membership website.

People register their qualifications by filling out a lengthy Gravity Form that collects their responses and qualifies their membership.

At the end they can choose a Paid listing with a quarterly recurring fee.  I am interested in using Exchange for the recurring billing with Stripe.

Can I use Gravity forms to "pass" the customer selection information to Exchange to organise the billing. Or does the Client have to be sent to an Exchange page where they have to choose the billing "product" again?

#2 Elise Alley

Elise Alley

    iThemes Support

  • Administrators
  • Others: All Plugins, All Themes, Members, Moderators, Toolkit, Webdesign
  • 5,729 posts
  • LocationOklahoma City, OK

Posted 23 September 2013 - 08:48 AM

Hi Alpus,

You wouldn't be able to do this with Exchange and Gravity Forms just out of the box.  You would need to make changes to Exchange.

I would probably say you should use the function it_exchange_add_product_to_shopping_cart() upon successful submission of a Gravity Form. And then redirect to the checkout page. This function is found in api/cart.php. You'll probably want to enable the Multi-Cart add-on too, just to ensure the cart page is available.

Let us know if you have any additional questions.

Thanks,

Elise

#3 Guest_Aplus_*

Guest_Aplus_*
  • Guests

Posted 07 October 2013 - 03:15 PM

Elise,

I have had a look at the api/cart.php function.

The Gravity form I am using is very extensive (see http://adr.org.au/listing-application-form/?listing_package=professional) but only captures non-billing information.  At the end, the customer agrees to the terms and conditions and then "submits" the registration.

At this point I just want to go to the Exchange product billing page.

I only have two products, "Preferred Listing" and Professional Listing" charged at a monthly rate. It would be good to pass a "product code" to Exchange.  But the minimum I want to do is just go to the product page where the customer can order the product.

Can you advise how to do that.

Thanks,

#4 chznvrt

chznvrt

    Advanced Member

  • Members
  • Others: Toolkit
  • PipPipPip
  • 95 posts

Posted 10 October 2013 - 01:26 PM

View PostElise Alley, on 23 September 2013 - 08:48 AM, said:

I would probably say you should use the function it_exchange_add_product_to_shopping_cart() upon successful submission of a Gravity Form. And then redirect to the checkout page. This function is found in api/cart.php. You'll probably want to enable the Multi-Cart add-on too, just to ensure the cart page is available.

Hmm... that gives me an idea. Could put a Gravity Form inside a "regular" Exchange product page, then point the form to the same page. Would/could the super widget properly handle a GF ajax call? Of course the page could just refresh too. In that case, the super widget should then properly display what was just added to the cart, correct?

Or, it may be easier to go with my original Exchange version of my "bundle builder" and stick with my own javascript. (Not high on my priorities list right now, so I don't know when I'd actually get to it.)

Again, hmm.

#5 tugmariner

tugmariner

    New Member

  • Members
  • Others: All Plugins, Exchange - Stripe, Sync
  • 2 posts

Posted 22 October 2013 - 10:59 AM

View PostElise Alley, on 23 September 2013 - 08:48 AM, said:

I would probably say you should use the function it_exchange_add_product_to_shopping_cart() upon successful submission of a Gravity Form. And then redirect to the checkout page. This function is found in api/cart.php. You'll probably want to enable the Multi-Cart add-on too, just to ensure the cart page is available.

Hi Elise, I've been wrangling with HOW to do this for about a week now.

I assume the portion I need to use from cart.php is this:

function it_exchange_add_product_to_shopping_cart( $product_id, $quantity=1 ) {
if ( ! $product_id )
  return;
if ( ! $product = it_exchange_get_product( $product_id ) )
  return;
$quantity = absint( (int) $quantity );
if ( $quantity < 1 )
  $quantity = 1; //we're going to assume they want at least 1 item

Set the field value of the product in my form to that of the product ID and quantity is quantity, but how do I utilize the function?

Thanks in advance,

Darin

#6 tugmariner

tugmariner

    New Member

  • Members
  • Others: All Plugins, Exchange - Stripe, Sync
  • 2 posts

Posted 29 October 2013 - 01:41 PM

In case anyone else needs it:

//add to cart
add_action("gform_after_submission", "custom_gf_hook_after_submission", 10, 2);
function custom_gf_hook_after_submission ($entry, $form) {
//convert to named array
$vals= array();
foreach($form['fields'] as $f) {
  if(!is_array($f['inputs'])) {
   $vals[$f['label']]=$entry[$f['id']];
   continue;
  }
  //complex type
  foreach($f['inputs'] as $i)
   $vals[$i['label']]=$entry[$i['id']];
}
// use labels to access fields
if(@$vals['Product ID'] AND $vals['Quantity']) {
  it_exchange_empty_shopping_cart();
  it_exchange_add_product_to_shopping_cart($vals['Product ID'],$vals['Quantity']);
}
}


#7 starblazer

starblazer

    Newbie

  • Members
  • Others: Premium Exchange Addon
  • Pip
  • 1 posts

Posted 05 August 2014 - 06:52 AM

Apologies for resurrecting this thread, but where exactly would you place that code Tugmariner?



Reply to this Topic


ATTENTION
If this topic is marked RESOLVED or INFORMATION, or if you are NOT experiencing EXACTLY the same issue, please start a new topic to provide the details of your problem. If the solution provided doesn't work for you, you should start a new topic. If you feel this thread contains relevant information, you may include a link to it in your new topic. To ensure that we can process your support request efficiently, ALWAYS include a link to your site, and/or the page your request is related to. When posting your question or request on the forum, please be as concise and specific as possible. The shorter and more to the point you can make your request, the better.

For BackupBuddy related issues, be sure to include the status log from your most recent backup.

CLICK HERE to start a new topic in the Exchange ecommerce plugin forum.


  



Also tagged with one or more of these keywords: gravity forms

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users