Drupal 6 - Vtiger 5.1

Hi all,
I use Vtiger_forms module (http://www.vtiger.com//index.php?option=com_content&task=view&id=214&Ite...) for a contact form.

I re-use part of the Vtiger_forms code to have ubercart form working with Vtiger. You need to have Vtiger_forms configured.

-Create a conditionnal action (ubercart module) with “Customer completes checkout” trigger and add a “execute custom PHP code” action.

-Copy and adapt for your need :

$service_url = variable_get('vtiger_forms_url', '');
if(empty($service_url)) {
return false;
}

// Suffix the URL where data needs to be sent.
$service_url .= '/modules/Webforms/post.php';

//Adapt under for your need
$post_data = array( 'moduleName' => 'Leads' );

// i'm using uc_profile so i load the customer profile. Ex: $user1->profile_lastname; profile_lastname is the name of the profile field.
$user1 = user_load ($order->uid);
$profile = profile_load_profile ($user1);

// Ex: $post_data[email] = $order->primary_email;
//email is the name of the vtiger field. $order->primary_email is the value of ubercart field
$post_data[lastname] = $user1->profile_lastname;
$post_data[firstname] = $user1->profile_firstname;
$post_data[company] = $user1->profile_company;
$post_data[designation] = $user1->profile_designation;
$post_data[email] = $order->primary_email;
$post_data[phone] = $user1->profile_phone;
$post_data[website] = $user1->profile_website;
$post_data[description] = $user1->profile_description;
$post_data[leadsource] = "What you want";

// need the curl_http_client.php in the vtiger_forms module
$curl_path = drupal_get_path('module', 'vtiger_forms');
include_once $curl_path . '/curl_http_client.php';
$client = new Curl_HTTP_Client();

// Escape SSL certificate hostname verification
curl_setopt($client->ch, CURLOPT_SSL_VERIFYHOST, 0);

$client->set_user_agent("Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)");
$html_data = $client->send_post_data($service_url, $post_data);

You can add Conditions to restrict for a particular product.