CardIcons
1 year ago
CouponsController.php
7 months ago
IppFunctions.php
1 year ago
MobileMessagingHandler.php
2 years ago
OrderActionsRestController.php
3 months ago
OrderAttributionBlocksController.php
1 year ago
OrderAttributionController.php
5 months ago
OrderNoteGroup.php
3 months ago
OrderStatusRestController.php
5 months ago
PaymentInfo.php
10 months ago
PointOfSaleEmailHandler.php
3 months ago
PointOfSaleOrderUtil.php
4 weeks ago
TaxesController.php
3 years ago
OrderNoteGroup.php
78 lines
| 1 | <?php |
| 2 | |
| 3 | declare( strict_types = 1 ); |
| 4 | |
| 5 | namespace Automattic\WooCommerce\Internal\Orders; |
| 6 | |
| 7 | /** |
| 8 | * Enum class for order note groups. This is stored as meta data to categorize order notes. |
| 9 | * |
| 10 | * This is not surfaced in core UI presently. |
| 11 | */ |
| 12 | final class OrderNoteGroup { |
| 13 | /** |
| 14 | * Any note concerning errors. |
| 15 | * |
| 16 | * @var string |
| 17 | */ |
| 18 | public const ERROR = 'error'; |
| 19 | |
| 20 | /** |
| 21 | * Any note concerning emails to customers. |
| 22 | * |
| 23 | * @var string |
| 24 | */ |
| 25 | public const EMAIL_NOTIFICATION = 'email_notification'; |
| 26 | |
| 27 | /** |
| 28 | * Any note concerning stock levels. |
| 29 | * |
| 30 | * @var string |
| 31 | */ |
| 32 | public const PRODUCT_STOCK = 'product_stock'; |
| 33 | |
| 34 | /** |
| 35 | * Any note concerning payments. |
| 36 | * |
| 37 | * @var string |
| 38 | */ |
| 39 | public const PAYMENT = 'payment'; |
| 40 | |
| 41 | /** |
| 42 | * Any note concerning order updates. |
| 43 | * |
| 44 | * @var string |
| 45 | */ |
| 46 | public const ORDER_UPDATE = 'order_update'; |
| 47 | |
| 48 | /** |
| 49 | * Any note concerning fulfillments. |
| 50 | * |
| 51 | * @var string |
| 52 | */ |
| 53 | public const FULFILLMENT = 'fulfillment'; |
| 54 | |
| 55 | /** |
| 56 | * Get the default group title for a given group. |
| 57 | * |
| 58 | * @param string $group The group. |
| 59 | * @return string The default group title. |
| 60 | */ |
| 61 | public static function get_default_group_title( string $group ): string { |
| 62 | switch ( $group ) { |
| 63 | case self::PRODUCT_STOCK: |
| 64 | return __( 'Product stock', 'woocommerce' ); |
| 65 | case self::PAYMENT: |
| 66 | return __( 'Payment', 'woocommerce' ); |
| 67 | case self::EMAIL_NOTIFICATION: |
| 68 | return __( 'Email notification', 'woocommerce' ); |
| 69 | case self::ERROR: |
| 70 | return __( 'Error', 'woocommerce' ); |
| 71 | case self::FULFILLMENT: |
| 72 | return __( 'Fulfillment', 'woocommerce' ); |
| 73 | default: |
| 74 | return __( 'Order updated', 'woocommerce' ); |
| 75 | } |
| 76 | } |
| 77 | } |
| 78 |