andreasa Posted August 18, 2011 Share Posted August 18, 2011 I am trying to insert data in a custom field when adding a new order through the internal API. This is my code - but it's not working: $adminuser = 'xxxxx'; $command = 'addorder'; $values = array('clientid' => $intClientID, 'pid' => '1', 'paymentmethod' => 'paypal', 'domain' => $strDomain, 'domainfields' => base64_encode(serialize(array('subdomain'=>'test2'))) ); $results = localAPI($command,$values,$adminuser); if ($results['result']!="success") { echo "An Error Occurred: ".$results['result']; } Everything works fine - except that nothing gets inserted into the custom field "subdomain". What am I doing wrong? Thanks, Andreas 0 Quote Link to comment Share on other sites More sharing options...
alexander.giehl Posted August 19, 2011 Share Posted August 19, 2011 Try using the id of the custom field instead of the name as the key of your array. I haven't used the addorder function yet but addclient (which has a custom field option aswell) works that way. 0 Quote Link to comment Share on other sites More sharing options...
andreasa Posted August 19, 2011 Author Share Posted August 19, 2011 Yes! It works! Thanks, Andreas 0 Quote Link to comment Share on other sites More sharing options...
jackalmil Posted January 4, 2012 Share Posted January 4, 2012 Andreas Please Send Sample Code this action 0 Quote Link to comment Share on other sites More sharing options...
dybfm Posted March 15, 2012 Share Posted March 15, 2012 I'm try use the code belllow, but the return is empty, but the PID exist! array(2) { ["result"]=> string(7) "success" ["totalresults"]=> int(0) } Whats is the problem? {php} # Set Vars $command = 'getproducts'; $values = array( 'pid' => '29452'); $adminuser = 'XXXXXXX'; # Call API $results = localAPI($command,$values,$adminuser); if ($results['result']!="success") echo "An Error Occurred: ".$results['result']; var_dump($results); {/php} 0 Quote Link to comment 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.