How do you find a product by SKU?
wc_get_product_id_by_sku( $sku ) — a lookup table query. Not a meta_query on _sku.
questions
wc_get_product_id_by_sku( $sku ) — a lookup table query. Not a meta_query on _sku.
$product->get_variation_price( 'min' ) and ( 'max' ), or get_price_html(). Don't loop over all variations by hand.
A _ prefix doesn't protect it from REST: meta_data returns all meta. Filter it with woocommerce_rest_prepare_product_object, or don't keep sensitive data in product meta.
A global attribute is a pa_* taxonomy shared by all products: you can filter the catalog by it. A local one lives only in one product and has no filters.
Not in principle: wc_get_products() is a wrapper that creates a WC_Product_Query and returns the result.
With the outofstock term in the product_visibility taxonomy and the "Hide out of stock items" option. Catalog queries add a tax_query on that taxonomy.
Hundreds are technically possible, but the product form and price calculation slow down. If there are thousands of combinations, rethink the model: separate products, add-ons or options instead of variations.
When the product behaves differently: pricing, cart, shipping, post-payment handling. If only a few fields change, meta fields are enough.
save_post fires for any post and before WooCommerce saves its own data. woocommerce_admin_process_product_object gives you the product object and makes your changes part of the main save.
No questions found. Try another search.