BaseLocationCountryRuleProcessor.php
5 years ago
BaseLocationStateRuleProcessor.php
5 years ago
ComparisonOperation.php
5 years ago
DataSourcePoller.php
5 years ago
EvaluateAndGetStatus.php
5 years ago
FailRuleProcessor.php
5 years ago
GetRuleProcessor.php
5 years ago
IsEcommerceRuleProcessor.php
5 years ago
NotRuleProcessor.php
5 years ago
NoteStatusRuleProcessor.php
5 years ago
OnboardingProfileRuleProcessor.php
5 years ago
OptionRuleProcessor.php
5 years ago
OrRuleProcessor.php
5 years ago
OrderCountRuleProcessor.php
5 years ago
OrdersProvider.php
5 years ago
PassRuleProcessor.php
5 years ago
PluginVersionRuleProcessor.php
5 years ago
PluginsActivatedRuleProcessor.php
5 years ago
ProductCountRuleProcessor.php
5 years ago
PublishAfterTimeRuleProcessor.php
5 years ago
PublishBeforeTimeRuleProcessor.php
5 years ago
RemoteInboxNotificationsEngine.php
5 years ago
RuleEvaluator.php
5 years ago
RuleProcessorInterface.php
5 years ago
SpecRunner.php
5 years ago
StoredStateRuleProcessor.php
5 years ago
StoredStateSetupForProducts.php
5 years ago
WCAdminActiveForProvider.php
5 years ago
WCAdminActiveForRuleProcessor.php
5 years ago
OrdersProvider.php
37 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Provider for order-related queries and operations. |
| 4 | */ |
| 5 | |
| 6 | namespace Automattic\WooCommerce\Admin\RemoteInboxNotifications; |
| 7 | |
| 8 | defined( 'ABSPATH' ) || exit; |
| 9 | |
| 10 | /** |
| 11 | * Provider for order-related queries and operations. |
| 12 | */ |
| 13 | class OrdersProvider { |
| 14 | /** |
| 15 | * Allowed order statuses for calculating milestones. |
| 16 | * |
| 17 | * @var array |
| 18 | */ |
| 19 | protected $allowed_statuses = array( |
| 20 | 'pending', |
| 21 | 'processing', |
| 22 | 'completed', |
| 23 | ); |
| 24 | |
| 25 | /** |
| 26 | * Returns the number of orders. |
| 27 | * |
| 28 | * @return integer The number of orders. |
| 29 | */ |
| 30 | public function get_order_count() { |
| 31 | $status_counts = array_map( 'wc_orders_count', $this->allowed_statuses ); |
| 32 | $orders_count = array_sum( $status_counts ); |
| 33 | |
| 34 | return $orders_count; |
| 35 | } |
| 36 | } |
| 37 |