delivery step actions
This commit is contained in:
@@ -187,4 +187,44 @@ function wiaas_get_standard_package_order_item_documents($order, $package_item_i
|
||||
|
||||
return $doc;
|
||||
}, $order_documents);
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve documents for order item
|
||||
*
|
||||
* @param $order_item
|
||||
* @param string|null $doc_type
|
||||
*
|
||||
* @return array {
|
||||
* $param string key Unique key used for frontend downloand
|
||||
* $param string name Document name visible in download link
|
||||
* $param string version Relative path from upload directory to physical document file
|
||||
* $param string type Document type
|
||||
*
|
||||
* @reference Wiaas_Document
|
||||
* }
|
||||
*/
|
||||
function wiaas_get_order_item_documents($order_item, $doc_type = null) {
|
||||
|
||||
$documents = empty($order_item['wiaas_documents']) ? array() : $order_item['wiaas_documents'];
|
||||
|
||||
if (empty($doc_type)) {
|
||||
return $documents;
|
||||
}
|
||||
|
||||
$filtered_documents = array();
|
||||
|
||||
foreach ($documents as $document) {
|
||||
|
||||
if ($document['type'] === $doc_type) {
|
||||
$filtered_documents[] = $document;
|
||||
}
|
||||
}
|
||||
|
||||
return $filtered_documents;
|
||||
}
|
||||
|
||||
function wiaas_get_order_item_document_admin_download_link($order_id, $item_id, $version) {
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user