我需要更改它以仅显示类别ID中的产品

Basically I need this code to display only products from a category id.

Its from a woocomerrce template.

Any help would be appreciated!

 <div class="book_wrapper" <?php echo (!empty($book_wrapper)) ? 'style="background-image:url('.esc_url($book_wrapper).');"' : ''; ?>>
                <a id="next_page_button"></a>
                <a id="prev_page_button"></a>
                <div id="loading" class="loading"><?php _e('Loading pages!', THEME_NAME); ?>...</div>
                <div id="mybook" style="display:none;">
                    <div class="b-load">
                        <?php
                           $args = array( 'post_type' => 'product', 'posts_per_page' => -1 );
                           $loop = new WP_Query( $args );
                           $counter = 0;
                           echo "<div><ul>";
                           if ( $loop->have_posts() ) : while ( $loop->have_posts() ) : $loop->the_post(); global $product; ?>
                           <?php if ($counter == 8): ?>
                            <?php echo '</ul></div><div><ul>'; $counter = 0; ?>
                           <?php endif ?>
                                <li>
                                    <a href="<?php the_permalink(); ?>">
                                        <div class="meal-name"><?php the_title(); ?></div>
                                        <div class="meal-price"><?php echo $product->get_price_html(); ?></div>
                                    </a>
                                </li>
                        <?php $counter++; endwhile; endif; ?>
                        <?php echo '</ul></div>'; ?>
                    </div>
                </div>
            </div>

</div>

Check this url for more info https://codex.wordpress.org/Class_Reference/WP_Query#Category_Parameters You will need to add cat in your argument for WP_Query with specific category.

 <div class="book_wrapper" <?php echo (!empty($book_wrapper)) ? 'style="background-image:url('.esc_url($book_wrapper).');"' : ''; ?>>
                <a id="next_page_button"></a>
                <a id="prev_page_button"></a>
                <div id="loading" class="loading"><?php _e('Loading pages!', THEME_NAME); ?>...</div>
                <div id="mybook" style="display:none;">
                    <div class="b-load">
                        <?php
                           $args = array( 'post_type' => 'product', 'posts_per_page' => -1, cat=> 'Replace with cat id here' );
                           $loop = new WP_Query( $args );
                           $counter = 0;
                           echo "<div><ul>";
                           if ( $loop->have_posts() ) : while ( $loop->have_posts() ) : $loop->the_post(); global $product; ?>
                           <?php if ($counter == 8): ?>
                            <?php echo '</ul></div><div><ul>'; $counter = 0; ?>
                           <?php endif ?>
                                <li>
                                    <a href="<?php the_permalink(); ?>">
                                        <div class="meal-name"><?php the_title(); ?></div>
                                        <div class="meal-price"><?php echo $product->get_price_html(); ?></div>
                                    </a>
                                </li>
                        <?php $counter++; endwhile; endif; ?>
                        <?php echo '</ul></div>'; ?>
                    </div>
                </div>
            </div>

</div>