• Resolved Artyom

    (@ryabchuk)


    Hi! Is there solution to merge or link form and comments between product and post type? For example, I have a product and a review of it in a post. How to link comments, perhaps by ID?

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Support gVectors Support

    (@gvectorssupport)

    Hi Artyom,

    The global object (before the comments_template() function) of the product and post should be the same. In this case the comments will be merged.

    Thread Starter Artyom

    (@ryabchuk)

    Hey! Its almost working.
    I added comment form from the post but when I adding new comment from product page to this form, comment not adding to post ID. Comment still adding to product page (but I got rid of woo-tab). Hope I clear explain. Maybe need to disable comment form on product page? But when I uncheck product in the wpDiscuz form or in the Woocommerce->product->review form not displaying.

                             function woo_comments(){
                                global $obzor_id;
                                $args = array(
                                  'p' => $obzor_id // ID
                                );
                                $qry = new WP_Query($args);
    
                                if ($qry->have_posts()) {
                                  while ($qry->have_posts()) {
                                    $qry->the_post();
                                    comments_template();
                                  }
                                }
                                wp_reset_postdata();
                             }
    
    • This reply was modified 5 years ago by Artyom.
    Plugin Support gVectors Support

    (@gvectorssupport)

    Please try to call the same function before the wp_enqueue_scripts() hook.

    Thread Starter Artyom

    (@ryabchuk)

    Thanks you for answer. But I’m not sure I get it. I added this function woo_comments(); in functions.php. And call in product template. And added
    <?php add_action('wp_enqueue_scripts', 'woo_comments', 5); ?>
    in product template. No result.

    • This reply was modified 4 years, 12 months ago by Artyom.
    • This reply was modified 4 years, 12 months ago by Artyom.
    • This reply was modified 4 years, 12 months ago by Artyom.
    Thread Starter Artyom

    (@ryabchuk)

    Standard wp comments form working right, but with redirect after submit button (without ajax)

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Merge comment form’ is closed to new replies.