• How I can get parent product info?

    I have related products with variation ID’s but it is not showing in card parent product info.

    My related products where I pass variation ID:

    <section class="beige pt-5 pb-3">
            <div class="container-fluid px-0">
                <div class="row">
                    <div class="col-md-12">
                        <h2 class="mb-4 all-title"><?php _e('related products', 'rv'); ?></h2>
                        <article>
                            <div class="row">
                                <?php foreach($variation_ID as $related_product):
                                $post_object = get_post($related_product);
                                setup_postdata($GLOBALS['post'] =& $post_object);
                                    wc_get_template_part('single-product-card');
                                endforeach; ?>
                            </div>
                        </article>
                    </div>
                </div>
            </div>
        </section>

    My template card:

    <?php if( have_rows('product_info') ): ?>
                            <div class="product-info">
                            <?php while( have_rows('product_info') ) : the_row(); ?>
                                <div class="row">
                                    <div class="col-md-3">
                                        <p class="mb-0 heading"><?php the_sub_field('info_heading'); ?></p>
                                    </div>
                                    <div class="col-md-9">
                                        <p class="mb-0 value"><?php the_sub_field('info_value'); ?></p>
                                    </div>
                                </div>
                            <?php endwhile; ?>
                            </div>
                        <?php endif; ?>

    these the_sub_field(‘info_value)… etc.. not working with variation. I want parent product information to showed here.

Viewing 1 replies (of 1 total)
  • You should ask in the support forum for the plugin you are using for products. This is a WordPress forum, and WordPress doesn’t have products.

Viewing 1 replies (of 1 total)

The topic ‘How I can get parent product info’ is closed to new replies.