*/ public static function default_templates() { return array( 'processing' => __( 'Hi {customer_first_name}, we received your payment. Your order {order_number} at {shop_name} is now being processed. Thank you!', 'sendly' ), 'completed' => __( 'Hi {customer_first_name}, your order {order_number} has been completed. Thank you for shopping at {shop_name}!', 'sendly' ), 'cancelled' => __( 'Hi {customer_first_name}, your order {order_number} at {shop_name} has been cancelled. Contact us if you have any questions.', 'sendly' ), 'on-hold' => __( 'Hi {customer_first_name}, your order {order_number} is on hold awaiting payment of {order_total} {currency}.', 'sendly' ), ); } /** * Default template for a status, with a generic fallback. * * @param string $status Order status slug. * @return string */ public static function default_template( $status ) { $defaults = self::default_templates(); if ( isset( $defaults[ $status ] ) ) { return $defaults[ $status ]; } return __( 'Hi {customer_first_name}, your order {order_number} is now: {order_status}.', 'sendly' ); } /** * Map of order status slugs (without wc- prefix) to labels. * * @return array */ public static function statuses() { $out = array(); if ( ! function_exists( 'wc_get_order_statuses' ) ) { return $out; } foreach ( wc_get_order_statuses() as $key => $label ) { $slug = 'wc-' === substr( $key, 0, 3 ) ? substr( $key, 3 ) : $key; $out[ $slug ] = $label; } return $out; } }