Please submit a private ticket if you need to share sensitive information, such as license details and admin credentials.

Okay
  Public Ticket #4513608
Notifications for these types of orders should not be displayed —— Data Source "New Order"
Open

Comments

  •  13
    Ying started the conversation

    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

  •  1,593
    Dustin replied

    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

  •  13
    Ying replied

    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

  •  1,593
    Dustin replied

    Yes, I will add that fix in the next plugin update.

    Best regards,
    Dustin