Looking to Build/Redesign a Website or Blog ?

To speak to Rakshit, call +91 968 704 2303

[Drupal] Goto Webinar (G2W) Module Integration in Ubercart

Hi Friends,

Goto Webinar is cost effective solution for hosting an event and invite up to 1000 attendees and make a video conference. I just finished the integration of Goto Webinar module in Drupal (Ubercart). I am going to discuss how to create/integrate Goto Webinar module in Drupal. In this post we discuss here solution to [Drupal] Goto Webinar (G2W) Module Integration in Ubercart.

G2W is useful for the users to signup on our website and make payment for the same. Once payment is successful, we need to register user to registrants list in Goto Webinar (G2W). Now user can join Goto Webinar and attend the event.

Before proceed, you must have webinar key. To get the webinar key, you have to schedule the webinar. Here is the link to schedule and host webinar.

I have used hook_order API to check the Order and Payment Status. Based on the status, I have written the Curl function with Goto Webinar registrant URL and Passing the Order information collected earlier.

Below is the full code in steps.

Step #1
Create a new field in your product class called “goto_webinars_key” (Discussed above how to get it)

Step #2
Create custom module with following functions.

function MODULENAME_order($opt, &$arg1, $arg2){
$order = &$arg1;
$user = user_load($order->uid); // user info from the Order.
// We need to check completed status and payment_received status
case 'update':
if ($order->order_status == 'payment_received' && $arg2 == 'completed'){

// Loop all the cart products
foreach ($order->products as $product){
$n = node_load($product->nid);
if ($n->field_goto_webinars_key[0][value]){
MODULENAME_gotowebinar($n->field_goto_webinars_key[0][value], $user);

// Curl call with GoTo Webinar Registration URL and pass order fields.
function MODULENAME_gotowebinar($WebinarKey, $account){

$gtw_url = "";
$gtw_post = "";

// Create string url for GoToWebinar from same form POST data
$Form = "webinarRegistrationForm";
$gtw_post = "WebinarKey=" . urlencode($WebinarKey)
. "&Form=" . urlencode($Form)
. "&Name_First=" . urlencode($account->profile_firstname)
. "&Name_Last=" . urlencode($account->profile_lastname)
. "&Email=" . urlencode($account->mail)
. "&Company=" . urlencode($account->profile_company)
. "&Title=" . urlencode($account->profile_title);

// Set POST URL for GoTo Webinar Registration URL
$gtw_url = "https://attendee.gotowebinar.com/register/$WebinarKey”";
// You will get this URL once you register and schedule webinar on GoTo Webinar.

// Make a Curl Call now
$curl = curl_init();
curl_setopt($curl, CURLOPT_POSTFIELDS, $gtw_post);
curl_setopt($curl, CURLOPT_URL, $gtw_url);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false); // To Skip Curl version check
$er = curl_exec($curl);
$info = curl_getinfo($curl);

Step #3
Enable the module and test with one. You can see that user will be submitted in Goto Webinar (G2W).

Once you follow above 3 steps, you will get a solution for Goto Webinar (G2W) Module Integration in Ubercart, Goto Webinar Module Integration in Drupal, Write Goto Webinar Module Drupal, Drupal + Goto Webinar Module, Integrate Goto Webinar in Drupal, Goto Webinar Module Integration.

Thank You!


No Comments Yet.

Leave a Reply

Your email address will not be published.