WooCommerce trigger a function on order status complete
<p>I am trying to trigger a function when an order is completed. I am using this code:</p>

<pre><code>add_action('woocommerce_order_status_completed', array($this, 
  'payment_complete' 
), 1);
</code></pre>

<p>and then this function:</p>

<pre><code>public function payment_complete($order_id) { 
  $this-&gt;generate_order_file($order_id); 
}
</code></pre>

<p>This function is meant to generate an order file, but it's not being called at all. I previously tried getting it to add a message to the error log,</p>

<p>I am using the WooCommerce Order Status Control plugin, and orders are automatically changing to complete upon payment. Yet for some reason the woocommerce_order_status_completed action isn't triggering.</p>