SHARE
TWEET

Untitled

a guest Mar 20th, 2016 56 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function complete_order($orderid) {
  2. $consumer_key = 'xxx'; // Add your own Consumer Key here
  3. $consumer_secret = 'xxxx'; // Add your own Consumer Secret here
  4. $store_url = 'xxx'; // Add the home URL to the store you want to connect to here
  5. $options = array(
  6.     'debug' => true,
  7.     'return_as_array' => false,
  8.     'validate_url' => false,
  9.     'timeout' => 30,
  10.     'ssl_verify' => false,
  11. );
  12. $servername = "xxx";
  13. $username = "xxx";
  14. $password = "xxx";
  15. $dbname = "xxx";
  16. $conn = new mysqli($servername, $username, $password, $dbname);
  17. $sql ="SELECT * FROM xxxxxx WHERE ID = '$orderid'";
  18. $result = $conn->query($sql);
  19. while($row = $result->fetch_assoc()) {
  20.     $poststatus= '. $row["post_status"].';
  21.     if ($poststatus = wc-manual-renewal-re){
  22.     $client = new WC_API_Client($store_url, $consumer_key, $consumer_secret, $options);
  23.  
  24.     $client->orders->update_status($orderid, 'wc-manual-renewal-re');
  25. }else{$client = new WC_API_Client($store_url, $consumer_key, $consumer_secret, $options);
  26.  
  27.     $client->orders->update_status($orderid, 'wc-completed');}}}
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top