WC Lovers

WooCommerce Frontend Manager - Multivendor marketplace vendor dashboard

We're shifting our Forum based support to a more dedicated support system!

We'll be closing our Forum support from 10th June, 2020 and move to Email Support assistance.

  • If you are a WCFM premium add-ons user, contact us- here
  • Want to know more before buying our add-ons? Send Pre sale queries- here
  • If you are a WCFM free user, please open a support ticket at WordPress.org
  • For WCFM App related queries, reach us- here
From now the forum will be read-only!

Forum Replies Created

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • in reply to: store new order mail #91132
    daniel.oizumi
    Participant

    Hi, thank you for the replay.

    If you are talking about the mixed items on New Order Email that is sent to vendors. No. They are placed from a client account. No vendor role associated to their account.

    Thanks!

    in reply to: store new order mail #90498
    daniel.oizumi
    Participant

    Sorry, I also had to change the SQL Query.

    from:
    $sql = “SELECT product_id, item_id FROM {$wpdb->prefix}wcfm_marketplace_orders WHERE vendor_id = {$this->vendor_id} AND order_id = {$order_id}”;

    to:
    $sql = “SELECT product_id FROM {$wpdb->prefix}wcfm_marketplace_orders WHERE vendor_id = {$this->vendor_id} AND order_id = {$order_id}”;

    and change this as well

    from:

    foreach( $valid_products as $valid_product ) {
    $valid_items[] = $valid_product->item_id;
    $valid_items[] = $valid_product->product_id;
    }

    to:
    foreach( $valid_products as $valid_product ) {
    //$valid_items[] = $valid_product->item_id;
    $valid_items[] = $valid_product->product_id;
    }

    daniel.oizumi
    Participant

    Had to change this as well

    foreach( $valid_products as $valid_product ) {
    //$valid_items[] = $valid_product->item_id;
    $valid_items[] = $valid_product->product_id;
    }

    in reply to: store new order mail #90354
    daniel.oizumi
    Participant

    ?

    daniel.oizumi
    Participant

    Sorry, I also had to change the SQL Query.

    from:
    $sql = “SELECT product_id, item_id FROM {$wpdb->prefix}wcfm_marketplace_orders WHERE vendor_id = {$this->vendor_id} AND order_id = {$order_id}”;

    to:
    $sql = “SELECT product_id FROM {$wpdb->prefix}wcfm_marketplace_orders WHERE vendor_id = {$this->vendor_id} AND order_id = {$order_id}”;

    in reply to: store new order mail #90312
    daniel.oizumi
    Participant

    Hi,
    I have a similar problem with mixed orders from different vendors. This was happening on the New Order Email and on the Order Dashboard of the Marketplace.

    I fixed the problem removing this part of the code “|| in_array( $value->get_id(), $valid_items )” on the wc-frontend-manager\core\class-wcfm-wcfmmarketplace.php file.

    Line 406

    // Filter Order Details Line Items as Per Vendor
    function wcfmmp_valid_line_items( $items, $order_id ) {
    global $WCFM, $wpdb;

    $sql = “SELECT product_id, item_id FROM {$wpdb->prefix}wcfm_marketplace_orders WHERE vendor_id = {$this->vendor_id} AND order_id = {$order_id}”;
    $valid_products = $wpdb->get_results($sql);
    $valid_items = array();
    if( !empty($valid_products) ) {
    foreach( $valid_products as $valid_product ) {
    $valid_items[] = $valid_product->item_id;
    $valid_items[] = $valid_product->product_id;
    }
    }

    $valid = array();
    foreach ($items as $key => $value) {
    if ( in_array( $value->get_variation_id(), $valid_items ) || in_array( $value->get_product_id(), $valid_items ) ) {
    $valid[$key] = $value;
    } elseif( $value->get_product_id() == 0 ) {
    $_product_id = wc_get_order_item_meta( $key, ‘_product_id’, true );
    if ( in_array( $_product_id, $valid_items ) ) {
    $valid[$key] = $value;
    }
    }
    }
    return $valid;
    }

    Could you let me know if this fixes your problema? Also, I would like to implement this fix on my function.php. Would you know how?

    daniel.oizumi
    Participant

    I fixed the problem removing a part of the code “|| in_array( $value->get_id(), $valid_items )” on the wc-frontend-manager\core\class-wcfm-wcfmmarketplace.php file.

    Line 406

    // Filter Order Details Line Items as Per Vendor
    function wcfmmp_valid_line_items( $items, $order_id ) {
    global $WCFM, $wpdb;

    $sql = “SELECT product_id, item_id FROM {$wpdb->prefix}wcfm_marketplace_orders WHERE vendor_id = {$this->vendor_id} AND order_id = {$order_id}”;
    $valid_products = $wpdb->get_results($sql);
    $valid_items = array();
    if( !empty($valid_products) ) {
    foreach( $valid_products as $valid_product ) {
    $valid_items[] = $valid_product->item_id;
    $valid_items[] = $valid_product->product_id;
    }
    }

    $valid = array();
    foreach ($items as $key => $value) {
    if ( in_array( $value->get_variation_id(), $valid_items ) || in_array( $value->get_product_id(), $valid_items ) ) {
    $valid[$key] = $value;
    } elseif( $value->get_product_id() == 0 ) {
    $_product_id = wc_get_order_item_meta( $key, ‘_product_id’, true );
    if ( in_array( $_product_id, $valid_items ) ) {
    $valid[$key] = $value;
    }
    }
    }
    return $valid;
    }

    However, I would like to implement this fix on my function.php. Does anyone know how?

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