Home Forums Theme Support Dokan Dokan plugin – Notification email to multiple sellers BIG PROBLEM! PLEASE HELP!

This topic is: not resolved

This topic contains 10 replies, has 4 voices, and was last updated by  Anas Basalamah 4 years, 7 months ago.

Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #27230

    Olof
    Member
    Post count: 49

    Hello!

    Run te Dokan plugin only and when setting up and testing the site I found a big problem/bug…

    When customer is buying from just one seller the notification email is sent correctly but when a buyer is buying from two different sellers no mail is sent at all. Just the admin gets the notification mail.. I use the woocommerce “Cash on delivery payment” option only.

    Please help me with this problem..

    Cheers / O

    #27253

    Tareq Hasan
    Keymaster
    Post count: 2831

    Could you please open /includes/order-functions.php and delete the line 158 which has this code: dokan_disable_order_emails(); and see if it resolves the issue?

    #27257

    Olof
    Member
    Post count: 49

    Hello =)

    Cant find that at all… This is from lines 135 – 206.

    /**
    * Update the child order status when a parent order status is changed
    *
    * @global object $wpdb
    * @param int $order_id
    * @param string $old_status
    * @param string $new_status
    */
    function dokan_on_order_status_change( $order_id, $old_status, $new_status ) {
    global $wpdb;

    // make sure order status contains “wc-” prefix
    if ( stripos( $new_status, ‘wc-‘ ) === false ) {
    $new_status = ‘wc-‘ . $new_status;
    }

    // insert on dokan sync table
    $wpdb->update( $wpdb->prefix . ‘dokan_orders',
    array( ‘order_status' => $new_status ),
    array( ‘order_id' => $order_id ),
    array( ‘%s' ),
    array( ‘%d' )
    );

    // if any child orders found, change the orders as well
    $sub_orders = get_children( array( ‘post_parent' => $order_id, ‘post_type' => ‘shop_order' ) );
    if ( $sub_orders ) {
    foreach ($sub_orders as $order_post) {
    $order = new WC_Order( $order_post->ID );
    $order->update_status( $new_status );
    }
    }
    }

    add_action( ‘woocommerce_order_status_changed', ‘dokan_on_order_status_change', 10, 3 );

    /**
    * Mark the parent order as complete when all the child order are completed
    *
    * @param int $order_id
    * @param string $old_status
    * @param string $new_status
    * @return void
    */
    function dokan_on_child_order_status_change( $order_id, $old_status, $new_status ) {
    $order_post = get_post( $order_id );

    // we are monitoring only child orders
    if ( $order_post->post_parent === 0 ) {
    return;
    }

    // get all the child orders and monitor the status
    $parent_order_id = $order_post->post_parent;
    $sub_orders = get_children( array( ‘post_parent' => $parent_order_id, ‘post_type' => ‘shop_order' ) );

    // return if any child order is not completed
    $all_complete = true;

    if ( $sub_orders ) {
    foreach ($sub_orders as $sub) {
    $order = new WC_Order( $sub->ID );

    if ( $order->post_status != ‘wc-completed' ) {
    $all_complete = false;
    }
    }
    }

    // seems like all the child orders are completed

    #27260

    Tareq Hasan
    Keymaster
    Post count: 2831

    Seems like you are using the plugin, not the theme. So there shouldn't be any problem like this you say.

    #27261

    Olof
    Member
    Post count: 49

    Tried several times and not get any notification emails when order from 2 different sellers.

    Help?

    Cheers / O

    #27282

    Mahi
    Member
    Post count: 135

    can you please confirm first you are using theme or plugin? cause, we are confused here .

    #27289

    Olof
    Member
    Post count: 49

    Running Dokan plugin

    #27355

    Olof
    Member
    Post count: 49

    Hello?

    #27358

    Mahi
    Member
    Post count: 135

    I assigned this support topic to dev team. Please wait for their reply.

    #27360

    Olof
    Member
    Post count: 49

    Sure Mahi, ty.

    #27365

    Anas Basalamah
    Member
    Post count: 160

    this is the same problem

    http://wedevs.com/support/topic/notification-emails-not-working/

    They didn't fix it

Viewing 11 posts - 1 through 11 (of 11 total)

The topic ‘Dokan plugin – Notification email to multiple sellers BIG PROBLEM! PLEASE HELP!’ is closed to new replies.