CatalogVisibility.php
1 month ago
CurrencyPosition.php
3 days ago
DefaultCustomerAddress.php
2 months ago
DimensionUnit.php
3 days ago
FeaturePluginCompatibility.php
1 month ago
OrderInternalStatus.php
1 month ago
OrderItemType.php
2 months ago
OrderStatus.php
1 month ago
PaymentGatewayFeature.php
7 months ago
ProductStatus.php
1 month ago
ProductStockStatus.php
1 month ago
ProductTaxStatus.php
1 year ago
ProductType.php
1 month ago
TaxBasedOn.php
2 months ago
TaxDisplayMode.php
3 days ago
WeightUnit.php
3 days ago
WeightUnit.php
58 lines
| 1 | <?php |
| 2 | |
| 3 | declare( strict_types = 1 ); |
| 4 | |
| 5 | namespace Automattic\WooCommerce\Enums; |
| 6 | |
| 7 | /** |
| 8 | * Enum class for the possible values of the `woocommerce_weight_unit` option, |
| 9 | * which determines the weight unit used throughout the store. |
| 10 | * |
| 11 | * @since 11.0.0 |
| 12 | */ |
| 13 | final class WeightUnit { |
| 14 | /** |
| 15 | * Kilogram. |
| 16 | * |
| 17 | * @var string |
| 18 | */ |
| 19 | public const KILOGRAM = 'kg'; |
| 20 | |
| 21 | /** |
| 22 | * Gram. |
| 23 | * |
| 24 | * @var string |
| 25 | */ |
| 26 | public const GRAM = 'g'; |
| 27 | |
| 28 | /** |
| 29 | * Pound. |
| 30 | * |
| 31 | * @var string |
| 32 | */ |
| 33 | public const POUND = 'lbs'; |
| 34 | |
| 35 | /** |
| 36 | * Ounce. |
| 37 | * |
| 38 | * @var string |
| 39 | */ |
| 40 | public const OUNCE = 'oz'; |
| 41 | |
| 42 | /** |
| 43 | * Returns all weight unit values defined in this class. |
| 44 | * |
| 45 | * @since 11.0.0 |
| 46 | * |
| 47 | * @return string[] |
| 48 | */ |
| 49 | public static function get_all(): array { |
| 50 | return array( |
| 51 | self::KILOGRAM, |
| 52 | self::GRAM, |
| 53 | self::POUND, |
| 54 | self::OUNCE, |
| 55 | ); |
| 56 | } |
| 57 | } |
| 58 |