Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix/product visibility #840

Merged
merged 3 commits into from
Jun 8, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions classes/class-ep-api.php
Original file line number Diff line number Diff line change
Expand Up @@ -698,10 +698,11 @@ private function prepare_terms( $post ) {
foreach ( $object_terms as $term ) {
if( ! isset( $terms_dic[ $term->term_id ] ) ) {
$terms_dic[ $term->term_id ] = array(
'term_id' => $term->term_id,
'slug' => $term->slug,
'name' => $term->name,
'parent' => $term->parent
'term_id' => $term->term_id,
'slug' => $term->slug,
'name' => $term->name,
'parent' => $term->parent,
'term_taxonomy_id' => $term->term_taxonomy_id,
);
if( $allow_hierarchy ){
$terms_dic = $this->get_parent_terms( $terms_dic, $term, $taxonomy->name );
Expand Down
7 changes: 4 additions & 3 deletions features/woocommerce/woocommerce.php
Original file line number Diff line number Diff line change
Expand Up @@ -133,10 +133,10 @@ function ep_wc_convert_post_object_to_id( $posts ) {
* @return array
*/
function ep_wc_whitelist_taxonomies( $taxonomies, $post ) {
$woo_taxonomies = array();
$product_type = get_taxonomy( 'product_type' );
$product_type = get_taxonomy( 'product_type' );
$product_visibility = get_taxonomy( 'product_visibility' );

$woo_taxonomies[] = $product_type;
$woo_taxonomies = array( $product_type, $product_visibility );

/**
* Note product_shipping_class, product_cat, and product_tag are already public. Make
Expand Down Expand Up @@ -233,6 +233,7 @@ function ep_wc_translate_args( $query ) {
'product_tag',
'product_type',
'pa_sort-by',
'product_visibility',
);

/**
Expand Down
3 changes: 3 additions & 0 deletions includes/mappings/5-0.php
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,9 @@
'term_id' => array(
'type' => 'long',
),
'term_taxonomy_id' => array(
'type' => 'long',
),
'parent' => array(
'type' => 'long',
),
Expand Down
5 changes: 4 additions & 1 deletion includes/mappings/pre-5-0.php
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,9 @@
'term_id' => array(
'type' => 'long',
),
'term_taxonomy_id' => array(
'type' => 'long',
),
'parent' => array(
'type' => 'long',
),
Expand Down Expand Up @@ -377,4 +380,4 @@
),
),
),
);
);