I know, as simple as it sounds but I don't get it running: How can I select the product visibility for a product by his id via SQL?

This is what I have:

global $wpdb;
$result = $wpdb->get_col( "SELECT catalog_visibility FROM XXX WHERE product_id = 3" );

And yes, I need to do this via SQL because I'm working on a large SQL select where this must be a part from.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.