Working with a json feed & trying to figure out how best to import

You could use a combination of update_post_meta(), set_objetc_terms(), and wp_update_post() to update your products. It is a good idea to use taxonomies (product categories and product attributes in WooC) as extensively as possible to store common product data as it makes searching for products faster compared to storing the data in post_meta. Here’s a concept … Read more

Display Products Associated with Specific Attribute [closed]

Error in wc_get_products caught by @SallyCJ fixed my problem. Where I had ingredients, I needed pa_ingredients. Working code is as follows: $taxonomy = ‘pa_ingredients’; $terms = get_terms( $taxonomy ); foreach ( $terms as $term ) { $products = wc_get_products( array( ‘pa_ingredients’ => $term->slug ) ); foreach ( $products as $product ) { $product_id = wc_get_product_id_by_sku( … Read more