Banner Logo

Be a part of the family: Connect, Receive Support,
Contribute, and Reap Abundant Rewards!

assign a vendor for a product using Woocommerce import/export

WCMp Core

Resolved
Viewing 7 reply threads
  • Author
    Posts
    • #142003
      l.gan
      Participant

      Hello

      Unfortunately, I am forced to bring up an old (May) question:
      https://github.com/multivendorx/dc-woocommerce-multi-vendor/issues/1082

      How can I assign a vendor for a product using Woocommerce import/export?

      Now, when uploading, metas are available:
      _vendor_id
      _dc_vendor_shop
      tax:dc_vendor_shop
      dc_vendor_shop
      choose_vendor

      But they don’t assign a vendor for the product, neither when specifying id:5, nor when specifying “Vendor Name” Nor when specifying a “vendor-name”.

      Please see the explanation below.

    • #142004
      l.gan
      Participant
      This reply has been marked as private.
    • #142073

      @l.gan, currently we don’t have support for this.

      so if you want you can do custom code to add this support. Do you have any developers?

    • #142083
      l.gan
      Participant

      Unfortunately I don’t have a developer for this

    • #142129

      @l.gan, you may hire our service team via this link : https://multivendorx.com/custom-development/

      • #142134
        l.gan
        Participant

        Great joke Moumita ๐Ÿ™‚ Re-read my post above.

        Your answer means that there is no way to solve my question by your development team.

    • #142180

      @l.gan, Weโ€™re happy to try help with these modifications, but only if a customization requires few lines (10-15) of new code. However, if your requirement requires more than that kind of efforts, we recommend you to hire developer.

    • #142436
      l.gan
      Participant

      For everyone who has a similar problem, there is a solution for the mass assignment of the vendor (if you use the standard import / export of WooCommerce)

      1. Create the Brand attribute.
      2. Add the ability to sort by brand attribute. (see code below)
      3. In bulk editing of products, filter:
      Attribute: Brand – Brand Name
      and choose a brand for these products.


      add_action( ‘restrict_manage_posts’, ‘aws_brand_products_sorting’ );
      function aws_brand_products_sorting() {
      global $typenow;
      $post_type = ‘product’; // change to your post type
      $taxonomy = ‘pa_brand’; // change to your taxonomy
      if ($typenow == $post_type) {
      $selected = isset($_GET[$taxonomy]) ? $_GET[$taxonomy] : ”;
      $info_taxonomy = get_taxonomy($taxonomy);
      //$selected = isset($_GET[$info_taxonomy->name]) ? $_GET[$info_taxonomy->name] : ”;
      wp_dropdown_categories(array(
      ‘show_option_all’ => __(“Show all {$info_taxonomy->label}”, “aws-multi-functions”),
      ‘taxonomy’ => $taxonomy,
      ‘name’ => $taxonomy,
      ‘orderby’ => ‘name’,
      ‘selected’ => $selected,
      ‘show_count’ => true,
      ‘hide_empty’ => true,
      ));
      };
      }
      add_filter( ‘parse_query’, ‘aws_brand_products_sorting_query’ );
      function aws_brand_products_sorting_query( $query ) {
      global $pagenow;
      $post_type = ‘product’; // change to your post type
      $taxonomy = ‘pa_brand’; // change to your taxonomy
      $q_vars = &$query->query_vars;
      if ( $pagenow == ‘edit.php’ && isset($q_vars[‘post_type’]) && $q_vars[‘post_type’] == $post_type && isset($q_vars[$taxonomy]) && is_numeric($q_vars[$taxonomy]) && $q_vars[$taxonomy] != 0 ) {
      $term = get_term_by(‘id’, $q_vars[$taxonomy], $taxonomy);
      $q_vars[$taxonomy] = $term->slug;
      }
      }

      I have been looking for an answer to this question for a while and glad if it helps someone.

      Moumita, please mark the question as solved.

    • #142469

      Thanks, for helping out our user ๐Ÿ™‚

Viewing 7 reply threads

The topic ‘assign a vendor for a product using Woocommerce import/export’ is closed to new replies.