documents fix

This commit is contained in:
Almira Krdzic
2018-11-07 03:05:54 +01:00
parent e6b372f5d0
commit 0ba27b2f1d
13 changed files with 88 additions and 28 deletions

View File

@@ -740,6 +740,7 @@ class Wiaas_Cart {
$documents_ids = array();
// Retrieve all document ids attached to cart content
foreach ($items as $key => $item) {
if (!isset($item['_wiaas_standard_package'])) {
continue;
@@ -757,16 +758,19 @@ class Wiaas_Cart {
}
}
// Retrieve all customer visible template documents attached to cart content
$q = new WP_Query();
$retrieved_items = $q->query(array(
'post_status' => 'publish',
'post_type' => 'wiaas_doc',
'post__in' => array_keys($documents_ids),
'meta_key' => '_wiaas_doc_visible',
'meta_value' => 'yes', // visible to customer
'tax_query' => array(
array(
'taxonomy' => 'wiaas_doc_type',
'field' => 'slug',
'terms' => array_keys(self::$cart_doc_types),
'terms' => array_keys(self::$cart_doc_types), // templates only
)
)
));