Merge pull request #3829 from thenbrent/add-payment-complete-actions

Add new payment complete actions (to master)
This commit is contained in:
Mike Jolley 2013-09-25 00:02:09 -07:00
commit bb78c3fa32
1 changed files with 7 additions and 0 deletions

View File

@ -1245,6 +1245,8 @@ class WC_Order {
public function payment_complete() {
global $woocommerce;
do_action( 'woocommerce_pre_payment_complete', $this->id );
if ( ! empty( $woocommerce->session->order_awaiting_payment ) )
unset( $woocommerce->session->order_awaiting_payment );
@ -1290,6 +1292,11 @@ class WC_Order {
$this->reduce_order_stock(); // Payment is complete so reduce stock levels
do_action( 'woocommerce_payment_complete', $this->id );
} else {
do_action( 'woocommerce_payment_complete_order_status_' . $this->status, $this->id );
}
}