public static function findProductInTreeWithConfig(array $tree, array $config) {
    if (isset($tree['products'])) {
      $attributes = [];
      foreach ($config as $key => $value) {
        $attributes[$key] = $value;
      }

      foreach ($tree['combinations']['by_sku'] ?? [] as $sku => $sku_attributes) {
        if (count(array_intersect_assoc($sku_attributes, $attributes)) === count($sku_attributes)) {
          return $tree['products'][$sku];
        }
      }
    }

    return NULL;
  }