<?php

class Wiaas_Cart_Documents {

	private static $document_types = array(
		'template_questionaire' => 'template_agreement',
		'order_questionaire' => 'order_agreement'
	);

	public static function get_cart_documents() {
		$packages_data = Wiaas_Cart::get_cart_packages();

		$templates = array();

		foreach ($packages_data as $package_data) {
			$package = wc_get_product($packages_data['package_id']);

			$documents = $package->get_downloads();
		}

		get_terms(array(
			'taxonomy' => 'wiaas_document_types',
			'include' => 'template_questionaire, order_questionaire'
		));
	}

	private static function _get_packages_templates($packages) {
		$documents_ids = array_map(function($package) {
			return array_keys($package->get_downloads());
		}, $packages);

		wp_get_object_terms($documents_ids, 'wiaas_document_types', array(

		));
	}
}