Automattic\WooCommerce\Internal\Orders
PointOfSaleEmailHandler::maybe_suppress_email
Suppress email if the order was paid at POS.
Method of the class: PointOfSaleEmailHandler{}
No Hooks.
Returns
true|false. False if the order was paid at POS, original value otherwise.
Usage
$PointOfSaleEmailHandler = new PointOfSaleEmailHandler(); $PointOfSaleEmailHandler->maybe_suppress_email( $enabled, $order ): bool;
- $enabled(true|false) (required)
- Whether the email is enabled.
- $order(mixed) (required)
- The order object (or null).
PointOfSaleEmailHandler::maybe_suppress_email() PointOfSaleEmailHandler::maybe suppress email code WC 10.7.0
public function maybe_suppress_email( bool $enabled, $order ): bool {
if ( ! $order instanceof WC_Abstract_Order ) {
return $enabled;
}
if ( PointOfSaleOrderUtil::is_order_paid_at_pos( $order ) ) {
return false;
}
return $enabled;
}