sphinxsquare Posted January 13, 2012 Share Posted January 13, 2012 I'm working on a project for a friend in KS who is looking to finish a project as soon as possible. I have OpenCart and VtigerCRM installations both using the same database. In OpenCart there are several tables of which is populated with user data once the user registers an OpenCart account. I was looking at several ways to use this data and insert a new record into VtigerCRM so that the account can be managed. I have the ability to use an action.php to populate any form data into the VtigerCRM when the OpenCart account form is populated however I am limited to one action per html form. This would really be the way I would like to solve this if possible. If not, the next best solution is highly appreciated. I was looking at writing a .php file and croning it, I'm just unsure of the SQL when INSERTing a new record into the CRM, I can put flags such as timestamps into the query for insertion, I'm stuck a little on the right way to do this. Any ideas are greatly appreciated. Thank you for your help. Frank. Quote Link to comment https://forums.phpfreaks.com/topic/254956-opencart-and-vtigercrm-integration/ Share on other sites More sharing options...
Muddy_Funster Posted January 13, 2012 Share Posted January 13, 2012 could you define action please? Quote Link to comment https://forums.phpfreaks.com/topic/254956-opencart-and-vtigercrm-integration/#findComment-1307262 Share on other sites More sharing options...
sphinxsquare Posted January 13, 2012 Author Share Posted January 13, 2012 Sure, action as in <form action="heavy_lifting_page_to_parse_form_data_appropriately.php" method="POST"> So when a new OpenCart Account form is submitted, there is an action .php file to parse that data appropriately, I would be a super nice and simple remedy for me to be able to also action the VtigerCRM .php action file that is used in the Webforms module to basically submit a new account record in VtigerCRM by use of "both" action files, OpenCart and VtigerCRM respectively. Frank. Quote Link to comment https://forums.phpfreaks.com/topic/254956-opencart-and-vtigercrm-integration/#findComment-1307263 Share on other sites More sharing options...
sphinxsquare Posted January 13, 2012 Author Share Posted January 13, 2012 Hi, this worked like a charm, copied from: http://forums.htmlhelp.com/index.php?showtopic=560 <html> <head> <script language="Javascript"> <!-- function OnButton1() { document.Form1.action = "response1.php" // document.Form1.target = "_blank"; // Open in a new window document.Form1.submit(); // Submit the page return true; } function OnButton2() { document.Form1.action = "response2.php" document.Form1.target = "_blank"; // Open in a new window document.Form1.submit(); // Submit the page return true; } --> </script> <noscript>You need Javascript enabled for this to work</noscript> </head> <body> <!-- create the form --> <form name="Form1" method="post"> <!-- Add the data entry bits --> Your Name <input type="text" name="name" size="10" /><br /> <!-- Add some buttons --> <INPUT type="button" value="Button1" name=name onclick="OnButton1(); OnButton2();"> <!-- close the form --> </form> </body> </html> Quote Link to comment https://forums.phpfreaks.com/topic/254956-opencart-and-vtigercrm-integration/#findComment-1307369 Share on other sites More sharing options...
gizmola Posted January 14, 2012 Share Posted January 14, 2012 In my opinion it's a really bad idea to use javascript for something like this, when you could instead use a server side mechanism, like using curl. Quote Link to comment https://forums.phpfreaks.com/topic/254956-opencart-and-vtigercrm-integration/#findComment-1307519 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.