• Resolved niikk

    (@niikk)


    Hey there,

    We use dokan for our market place and we also want to use your plugin for customer reviews. When a customer orders items from one Vendor only one order is created. If a customer orders items from different vendors, then dokan creates a parent order with all items from every vendor in it and also sub orders for each vendor.

    Now we noticed, that when a customer orders items from different vendors, the review plugin setups also review reminder for the sub orders. But only parent order should get a review. Because when a customer also geta a reminder for review for every sub order, then he can review each product twice (from the reminder of the parent order AND from the items in the sub order).

    So this is no error with dokan plugin or customer review plugin. It is more a logical workflow.

    Target: The customer review plugin should not setup a reminder for product review for sub orders.

    How can we do this? ??

    Cheers.

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

    (@ivole)

    Thanks for trying our plugin!

    Can you please let me know which function can be used to determine the type of an order (order or sub order)?

    Thread Starter niikk

    (@niikk)

    Hello @ivole

    Hmm I’m not sure but maybe we can work with dokan_is_sub_order.

    I found this.. what you mean?

    /**
     * Get if an order is a sub order or not
     *
     * @since 2.4.11
     *
     * @param int $order_id
     *
     * @return boolean
     */
    function dokan_is_sub_order( $order_id ) {
        $parent_order_id =  wp_get_post_parent_id( $order_id );
    
        if ( 0 != $parent_order_id ) {
            return true;
        }
    
        return false;
    }
    Thread Starter niikk

    (@niikk)

    Hello @ivole

    Did you had some time to check my response? ??

    Cheers & thanks

    Plugin Author cusrev

    (@ivole)

    Thanks for providing additional information!

    It should be possible to add a filter to exclude sub-orders. We will check if it can be done in the next update.

    Thread Starter niikk

    (@niikk)

    Hello @ivole

    Thanks! That is awesome! Thanks for support!

    If it is not in the next update, can you then maybe guide us to get that done for our system?

    Cheers

    Plugin Author cusrev

    (@ivole)

    Please update the plugin to the version 3.132. Then, you should be able to use the following code snippet in your functions.php:

    add_filter( 'cr_skip_reminder_generic', 'cr_skip_reminder_generic_function', 10, 2 );
    function cr_skip_reminder_generic_function( $skip, $order_id ) {
    	$parent_order_id =  wp_get_post_parent_id( $order_id );
    	if ( 0 != $parent_order_id ) {
    		$skip = true;
    	}
    	return $skip;
    }
    Thread Starter niikk

    (@niikk)

    hu @ivole

    This is working! Thanks! Very nice! ??

    Cheers

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Send no review for suborders (dokan)’ is closed to new replies.