• Resolved saulodefaria

    (@saulodefaria)


    Hi guys. I have some products that are just bundles of a product with different variations, so I want to unite all reviews from these bundles into the main product. This in Woocommerce, I now that inside Cusrev.com I won’t be able to do that.
    So far I’ve tried:

    
    add_action('wp_insert_comment','update_post_id_if_review',99,2);
    function update_post_id_if_review($comment_id, $comment_object) {	
        // Get the post's ID
        $post_id = $comment_object->comment_post_ID;
        if ($post_id === BUNDLE_ID) {
    		// Form an array of data to be updated
    		$commentarr = array();
    		$commentarr['comment_ID'] = $comment_id;
    		$commentarr['comment_post_ID'] = MAIN_PRODUCT_ID;
    		wp_update_comment( $commentarr );	
        }
    }

    But it’s not working.

    Any ideas?

    Thanks!!

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author cusrev

    (@ivole)

    Thanks for the interest in our plugin!

    The plugin uses the standard WooCommerce reviews format. As far as I know, unfortunately, there is no concept of product ‘bundles’ in the standard WooCommerce.

    Each review is associated with a product ID. If you have several variations of the same product, please try using ‘variable products’ instead of ‘bundles’. Variable products are available in WooCommerce. Reviews collected for a variable product will be displayed for each of its variations.

    Thread Starter saulodefaria

    (@saulodefaria)

    Hi @ivole! Thanks for the answer.
    Maybe I wasn’t clear. Let’s say I have a product X. I have created 2 products, Y and Z, where Y is two units of X and Z is 4 units of X. Now, when they buy Y or Z, they will make a review for Y and Z. What I want is to programmatically change the reviews from Y and Z to X, because in the end, it’s just X that I sell.
    Makes sense?
    Thanks!!

    Plugin Author cusrev

    (@ivole)

    Thanks for providing additional information.

    The setup you described is seen by WooCommerce as three independent products. Unfortunately, there is no option to group independent products for review purposes.

    If you would like to follow the standard WooCommerce approach, then you should create your product X as a ‘variable product’. After that, you will be able to add two ‘variations’ of this product – one for 2 units and another for 4 units. Variations will have different prices but WooCommerce will display them as the same product. Please refer to WooCommerce documentation: https://docs.woocommerce.com/document/variable-product/

    Plugin Author cusrev

    (@ivole)

    We haven’t heard from you for more than two weeks. For this reason, I’ll assume that either you are not interested in this question/problem anymore or it has been resolved. If this is not the case, please let us know and we’ll be happy to help.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Edit comment_post_ID on Review’ is closed to new replies.