$tree */ public static function quizAdditions(array $tree): bool { foreach ($tree['steps'] ?? [] as $screen) foreach ($screen['results'] ?? [] as $result) { if (isset($result['product_action']) && $result['product_action'] !== 'link') return true; } return false; } public static function active(): bool { return (bool) apply_filters('wconvert_commerce', false); } /** Whether any module that puts a product in a campaign is active: journeys or commerce (ADR 0127). */ public static function productModuleActive(): bool { return self::active() || JourneySupport::active(); } /** @param array $tree */ public static function used(array $tree): bool { foreach ($tree['steps'] ?? [] as $step) foreach (CaptureJourney::nodes($step['content'] ?? []) as $node) { if (($node['type'] ?? '') === 'products') return true; } return false; } }