Currently, the plugin displays purchase notifications for all order statuses. In a real-world business context, however, we should exclude the following four default WooCommerce statuses from being displayed on the frontend: Pending Payment, On Hold, Cancelled, and Failed.
The reason for this is that customers who fail to place an order might still be browsing the website, and displaying a notification like 'Someone just bought X product' when referring to their failed order could mislead or confuse them.
Thanks! However, if you plan to integrate this part of the logic into the plugin later on, I’d recommend using an approach that excludes the following statuses: Pending Payment, On Hold, Cancelled, and Failed.
In real-world use cases, shipping/tracking plugins and custom order statuses often introduce additional statuses. Using an exclusion-based approach by default makes the plugin more broadly applicable and compatible.
Hi Dustin,
Currently, the plugin displays purchase notifications for all order statuses. In a real-world business context, however, we should exclude the following four default WooCommerce statuses from being displayed on the frontend: Pending Payment, On Hold, Cancelled, and Failed.
The reason for this is that customers who fail to place an order might still be browsing the website, and displaying a notification like 'Someone just bought X product' when referring to their failed order could mislead or confuse them.
Best,
Ying
Hi Ying,
Please add the custom code below. (How to add custom code? ↗):
add_filter( 'wpcsn_new_order_statuses', function ( $statuses ) { return [ 'wc-completed' ]; } );Then it retrieves only orders with status Completed.
Best regards,
Dustin
Hi Dustin,
Thanks! However, if you plan to integrate this part of the logic into the plugin later on, I’d recommend using an approach that excludes the following statuses: Pending Payment, On Hold, Cancelled, and Failed.
In real-world use cases, shipping/tracking plugins and custom order statuses often introduce additional statuses. Using an exclusion-based approach by default makes the plugin more broadly applicable and compatible.
Best,
Ying
Yes, I will add that fix in the next plugin update.
Best regards,
Dustin