• I would like to use this plugin together with Product Vendors, to group products into shipping packages by vendor.

    When I selected the option “Group by: Product owner (vendor)”, it didn’t appear to work. Investigation revealed that this was because the products in question were all added by the site-administrator and assigned to a vendor afterwards. Apparently, the packaging-option “Group by: Product owner (vendor)” groups by product owner, which in this case was not the vendor but the site administrator.

    Is there a way to use this plugin to group by the actual vendor, so that products added by the site administrator are split up by vendor and grouped with other products submitted by the same vendors?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter greenlightsolutions

    (@greenlightsolutions)

    I should have clarified: the Product Vendors plugin I use is the plugin ‘WooCommerce Product Vendors’ by WooCommerce, from https://woocommerce.com/products/product-vendors/

    Thread Starter greenlightsolutions

    (@greenlightsolutions)

    I have now added support for the ‘WooCommerce Product Vendors’ plugin by modifying the file ‘Academe_Multiple_Packages.php’, replacing on 3 locations the lines

    if (isset( $item['data']->post->post_author ) ) {
      $post_author = $item['data']->post->post_author;
    } else {
      $post_author = '-1';
    }

    by

    if (method_exists("WC_Product_Vendors_Utils", "get_vendor_id_from_product") && ($vendor_id = WC_Product_Vendors_Utils::get_vendor_id_from_product($product_id))) {
       $post_author = "vendor:$vendor_id";
    } else if (isset( $item['data']->post->post_author ) ) {
        $post_author = $item['data']->post->post_author;
    } else {
        $post_author = '-1';
    }

    This might be worth including in new updates for the ‘Package Configuration for WooCommerce’ plugin.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Group by Product Vendors if Vendor != Owner?’ is closed to new replies.