 |
vtiger The Honest Open Source CRM
|
| Previous topic :: Next topic |
| Author |
Message |
rob
Joined: 16 Aug 2006
Posts: 13
|
| Posted: Sun Sep 10, 2006 6:04 pm Post subject: Update leads with osCommerce - vtiger 5 from CVS |
|
|
I have created some code to get the osCommerce engine to create leads in vtiger when a new user is set up in osCommerce. It essentially uses the create new lead web form features. I'm now trying to get the update to work but can't find a way to do the update. If figured the save function for leads would check for an existing lead that matched and then update it if it existed but instead I'm getting duplicate leads.
What function within vtiger should I use to update a lead?
Here is how I added the osCommerce integration for creating the lead. Took the vtiger WebForm add-in and copied over the Lead into URL/catalog/includes. Deleted the index.php and send_data.php since they are not needed. Modified the config.php as required then added this code to the create_account.php file adding the lines inside the comments.
$email_text .= EMAIL_WELCOME . EMAIL_TEXT . EMAIL_CONTACT . EMAIL_WARNING;
tep_mail($name, $email_address, EMAIL_SUBJECT, $email_text, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);
// Create account in vtiger CRM
include(DIR_WS_INCLUDES . "vtiger/lead/config.php");
require_once(DIR_WS_INCLUDES . 'vtiger/lead/nusoap/lib/nusoap.php');
$client = new soapclient($Server_Path."/vtigerservice.php?service=webforms", false,
$proxyhost, $proxyport, $proxyusername, $proxypassword);
$err = $client->getError();
$email = $email_address;
$phone = $telephone;
$vtiger_query = tep_db_query("select countries_name from countries where countries_id = '" . (int)$country . "'");
$vtiger_array = tep_db_fetch_array($vtiger_query);
$country_name = $vtiger_array["countries_name"];
$params = array(
'lastname' => "$lastname",
'firstname' => "$firstname",
'email'=>"$email",
'phone'=>"$phone",
'company'=>"$company",
'country'=>"$country_name",
'description'=>"Account created in online store.",
'assigned_user_id'=>"$assigned_user_id"
);
$result = $client->call('create_lead_from_webform', $params, $Server_Path, $Server_Path);
if($result['faultstring'] != '' && is_array($result))
{
echo '<br>'.$result['faultstring'];
}
// End of vtiger integration
tep_redirect(tep_href_link(FILENAME_CREATE_ACCOUNT_SUCCESS, '', 'SSL'));
} |
|
| Back to top |
|
rob
Joined: 16 Aug 2006
Posts: 13
|
| Posted: Mon Sep 11, 2006 6:12 am Post subject: Re: Update leads with osCommerce - vtiger 5 from CVS |
|
|
I have tried 3 different approaches to doing updates via SOAP:
1. Called save("Leads") with an array including the defined value of ID with no luck...always creates a duplicate.
2. Tried using saveentity function...created duplicate even when ID was defined.
3. Create the SQL statements to do the update. The SQL statements work fine outside of the SOAP interface, but no updates occur when the statements are included in the SOAP interface.
Any ideas on why this is occurring? |
|
| Back to top |
|
rob
Joined: 16 Aug 2006
Posts: 13
|
| Posted: Mon Sep 11, 2006 6:14 am Post subject: Re: Update leads with osCommerce - vtiger 5 from CVS |
|
|
| Of course, just as I post it I was able to get #3 to work. Any idea on why #1 does not work? I pulled the entity information using retrieve_entity_info to fill an new Lead object called focus. Then updated some values and tried save("Leads" but that always results in a duplicate. |
|
| Back to top |
|
rob
Joined: 16 Aug 2006
Posts: 13
|
| Posted: Wed Sep 13, 2006 8:45 pm Post subject: Re: Update leads with osCommerce - vtiger 5 from CVS |
|
|
| I guess the save leads using the ID is not important due to the lack of any response. FYI, I have built a soap interface that allows osCommerce to create and update leads/contacts in vtiger when they are created in osCommerce. Please post if there is interest in this feature. Right now it matches on email address (even if email is updated in osCommerce). A nice tweak would have it update all matches to email address but right now it just chooses the first response. I can add the additional code if there is interest. I'd still like to know why the Save(Leads) function doesn't work if ID is passed (convert to update rather than create). |
|
| Back to top |
|
IZN
Guest
|
| Posted: Thu Sep 14, 2006 8:45 am Post subject: Re: Update leads with osCommerce - vtiger 5 from CVS |
|
|
Hi Rob,
I'm interested in your soap interface to create and update contacts in vtiger. Could you post a link to your files ?
I'm trying to make OSC, Vtiger work together on create, update, delete actions for accounts, contacts and leads. My aproach is quite different for yours as I use Jitterbit http://www.jitterbit.com/Product/index.php to run and schedule all integration operations (calling vtiger web services from jitterbit server).
But for now, I've got bugs in Vtiger 5 RC whith tables structure and ID's counter (one row, multiple row, :?: ), so I'm trying to make this work on release 4.2 for now. |
|
| Back to top |
|
matteoraggi.com
Guest
|
| Posted: Fri Sep 29, 2006 3:22 pm Post subject: Re: Update leads with osCommerce - vtiger 5 from CVS |
|
|
Anonymous wrote: Hi Rob,
I'm interested in your soap interface to create and update contacts in vtiger. Could you post a link to your files ?
I'm trying to make OSC, Vtiger work together on create, update, delete actions for accounts, contacts and leads. My aproach is quite different for yours as I use Jitterbit http://www.jitterbit.com/Product/index.php to run and schedule all integration operations (calling vtiger web services from jitterbit server).
But for now, I've got bugs in Vtiger 5 RC whith tables structure and ID's counter (one row, multiple row, :?: ), so I'm trying to make this work on release 4.2 for now. It is possible to recreate this code for ZEN-CART.COM ? |
|
| Back to top |
|
matteoraggi
Guest
Joined: 03 Dec 2007
Posts: 304
Location: italy
|
| Posted: Tue Dec 04, 2007 6:53 pm Post subject: Re: Update leads with osCommerce - vtiger 5 from CVS |
|
|
It is possible do this for ask for price? I dream it also for zen-cart..
when someone ask for a price, we insert it as LEAD in vtiger, this could be super! |
|
| Back to top |
|
mcbsolutions
Guest
Joined: 23 Dec 2005
Posts: 11
|
| Posted: Sun Dec 09, 2007 6:10 am Post subject: Re: Update leads with osCommerce - vtiger 5 from CVS |
|
|
Hi all,
I use oscommerce here too and would like to get Vtiger to talk to oscommerce. Just curious how far development has come on this.
All I found was the webforms module, but I need much more than that. But it's a start.
Thanks for any replies. |
|
| Back to top |
|
mcbsolutions
Guest
Joined: 23 Dec 2005
Posts: 11
|
| Posted: Tue Dec 11, 2007 4:30 pm Post subject: Re: Update leads with osCommerce - vtiger 5 from CVS |
|
|
| Guess there is no interest or these forums are just dead. What gives? I would have thought a mature CMS would have a module for oscommerce. 1 web form won't cut it. I may have to look for another cms solution. |
|
| Back to top |
|
matteoraggi
Guest
Joined: 03 Dec 2007
Posts: 304
Location: italy
|
| Posted: Tue Dec 11, 2007 7:29 pm Post subject: Re: Update leads with osCommerce - vtiger 5 from CVS |
|
|
vtiger is not cms , but a crm
if you need more of a web form, what you need?
if find something better, tell to us! |
|
| Back to top |
|
| |
|