Skip Navigation

[Gelöst] Woocommerce 3.0 issue with hidden fields _visibility and _featured

This support ticket is created vor 7 Jahre. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Kolkata (GMT+05:30)

This topic contains 5 Antworten, has 2 Stimmen.

Last updated by Minesh vor 6 Jahre, 12 Monate.

Assisted by: Minesh.

Author
Artikel
#516701

I am trying to: Use a Toolset Woocommerce Archive to display products that are only set to visible in the Woocommerce back end.

I visited this URL: hidden link

I expected to see: Woocommerce archive showing 30 invitation suites.

Instead, I got: Woocommerce archive showing 25 invitation suites. The five missing are ones I've added since updating to Woocommerce 3.0.

A peek at the database shows that one of the changes they made for 3.0 was to stop using the custom fields _featured and _visibility. The new products instead are using a new taxonomy called product_visibility.

This taxonomy does not show in the views interface, so I can't figure out how to update my views to work. I know how to add hidden fields, but not hidden taxonomies.

#516786

Minesh
Supporter

Languages: Englisch (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

Could you please let me know where you able to see the taxonomy product_visibility? Few screenshots will be helpful.

#517111
Screen Shot 2017-04-25 at 3.35.13 PM.png

It's in the documentation for 3.0: hidden link

#517477

Minesh
Supporter

Languages: Englisch (English )

Timezone: Asia/Kolkata (GMT+05:30)

Please allow me to consult our developers and I'll get in touch with you as soon as I know more. I need to check how product visibility is working now.

#517751

Minesh
Supporter

Languages: Englisch (English )

Timezone: Asia/Kolkata (GMT+05:30)

I checked with WooCommerce source files and found that with WC 3.XX the new WC product_visibility taxonomy is NOT ‘public’ so it means it's not queryable right away by Views. I'm escalating this to our next level support and lets see if we find any way to access the private taxonomy product_visibility.

#517790

Minesh
Supporter

Languages: Englisch (English )

Timezone: Asia/Kolkata (GMT+05:30)

We found a filter to display product visibility taxonomy.

Please try to add following code to your current theme's functions.php file and you will see taxonomy Product Visibility in admin menu as well as with views filter.

function func_new_args( $args) {

    $labels = array(
        'name'                       => _x( 'Product Visibilities', 'Product Visibility Plural', 'text_domain' ),
        'singular_name'              => _x( 'Product Visibility', 'Product Visibility Singular', 'text_domain' ),
        'menu_name'                  => __( 'Product Visibility', 'text_domain' ),
    );
    $args = array(
                'labels'                     => $labels,
                'hierarchical'      => false,
                'show_ui'           => true,
                'show_in_nav_menus' => false,
                'query_var'         => is_admin(),
                'rewrite'           => false,
                'public'            => false,
            ) ;
    return $args;
}
add_filter( 'woocommerce_taxonomy_args_product_visibility', 'func_new_args', 10, 3 );

Please note that we added this new changes made by WC 3.0 as a new feature request and it will me implemented after developer assessment. For now, you can use this as this way if this may help you otherwise you need to wait until we implement this feature.

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.