---
title: Adjust payment complete order statuses
description: "By default WooCommerce fires the \"Payment Complete\" hook (trigger) even when a payment is marked as \"Failed\" or \"Cancelled\". If you don't want the prints to happen for those statuses then add the following code snippet to your website: ```…"
url: "https://printus.cloud/docs/adjust-payment-complete-order-statuses/"
updated: "2024-05-11"
category: Custom Code Samples
---

# Adjust payment complete order statuses

By default WooCommerce fires the "Payment Complete" hook (trigger) even when a payment is marked as "Failed" or "Cancelled". If you don't want the prints to happen for those statuses then add the following code snippet to your website:

```
function sl_cc_adjust_payment_complete_statuses($statuses){
return array( 'on-hold', 'pending' );
}
add_filter('woocommerce_valid_order_statuses_for_payment_complete', 'sl_cc_adjust_payment_complete_statuses');
```
