Results 1 to 5 of 5
  1. #1
    Join Date
    Jun 2007
    Posts
    13
    Plugin Contributions
    0

    Default Could use some help modifying createaccount.php for VTiger integration

    OK, I have an interesting dilemma. I would be more than happy to share this if it works, and I'll do the legwork, but I need some help figuring it out.

    I have the VTiger Leads component integrated with ZC, allowing me to gather information into our CRM system from the site, but we are left with two instances of accounts, one in Vtiger and one in ZC. I would like to use the ZC to insert and maintain accounts in VTiger, and aside from the obvious problem of leads becoming contacts, I would rather have everything in one place.

    The logic behind this is when the account is created, the create account action generates a lead in VTiger. The "activate" flag on the ZC account (I need to find the specific field) will set the table name for the account update when they modify their account. Here's the pseudo-process:

    1) Visitor creates account in ZC. The createaccount.php file, once modified, will insert their information in the Leads database in VTiger.
    2) The sales monkey will contact the person, and validate their account. Once verified, they will convert the Lead into a Contact in VTiger, and activate their ZC account.
    3) If the user edits their account, and they are not activated, then the update is run against the VTiger lead table. If they ARE activated, the update is run against the VTiger Contact table.

    From lines 292 to 305, here is the code where the SQL statement is built and run, either updating or inserting the account:

    Code:
       $sql = "update " . TABLE_CUSTOMERS . "
                  set customers_default_address_id = '" . (int)$address_id . "'
                  where customers_id = '" . (int)$_SESSION['customer_id'] . "'";
    
        $db->Execute($sql);
    
        $sql = "insert into " . TABLE_CUSTOMERS_INFO . "
                              (customers_info_id, customers_info_number_of_logons,
                               customers_info_date_account_created)
                  values ('" . (int)$_SESSION['customer_id'] . "', '0', now())";
    
        $db->Execute($sql);
    I don't see anything in the code on this page that checks to see whether it should do an update or an insert, am I missing something? I see it would be pretty easy to add an additional SQL query to insert into VTiger or update, I just want to make sure that I have this right :)

    Any help is appreciated, and like I said, if I get this working, I would be more than happy to share it.

    Thanks,

    Bob

  2. #2
    Join Date
    Jun 2007
    Posts
    13
    Plugin Contributions
    0

    Default Re: Could use some help modifying createaccount.php for VTiger integration

    -Bump- Anyone?

  3. #3
    Join Date
    Oct 2006
    Posts
    5,477
    Plugin Contributions
    11

    Default Re: Could use some help modifying createaccount.php for VTiger integration

    Instead of modifying zc core code, you may want to have a look at this:
    http://www.zen-cart.com/wiki/index.p..._API_Tutorials
    I no longer provide installation support on forum for all my modules. However, if there are real bugs with the modules please feel free to contact me

  4. #4
    Join Date
    Jun 2007
    Posts
    13
    Plugin Contributions
    0

    Default Re: Could use some help modifying createaccount.php for VTiger integration

    Thanks. I looked at this pile of docs, and while I did not mention it above, this is going to be done via an override, and not the core files themselves :) Thanks though for the warning, it is a lesson I learned the hard way in other areas I have been tinkering with :)

    Still need help on this, I was not able to find the right place to make these changes....

    I would be more than willing to share the fruits of this labor, to help others who are using Zen-Cart and VTiger :)

    Thanks!

    Bob

  5. #5
    Join Date
    Oct 2005
    Location
    Norfolk UK
    Posts
    4
    Plugin Contributions
    0

    Default Re: Could use some help modifying createaccount.php for VTiger integration

    Did you ever get this sorted?

    Vtiger have now brought out their vtwsclib library (http://forge.vtiger.com/frs/download...wsclib-1.4.pdf ) so I presume some of the code included can now just be added to the Zen Cart code.

    Is anybody wanting to work on this with me, and possibly create a public contribution?

 

 

Similar Threads

  1. Really could use some help - upgrade from 1.3
    By crystal11 in forum Upgrading to 1.5.x
    Replies: 9
    Last Post: 6 Oct 2014, 10:32 AM
  2. Really could use some help V1.39F crashed
    By teamzr1 in forum Upgrading to 1.5.x
    Replies: 23
    Last Post: 12 Sep 2014, 07:08 AM
  3. v150 I could really use some help!!
    By Darion in forum General Questions
    Replies: 37
    Last Post: 29 Sep 2012, 07:05 PM
  4. Could use some help big time
    By swelter83 in forum Templates, Stylesheets, Page Layout
    Replies: 6
    Last Post: 24 Mar 2008, 09:33 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg