WCMp Core
-
AuthorPosts
-
-
September 16, 2022 at 4:59 PM #142003l.ganParticipant
Hello
Unfortunately, I am forced to bring up an old (May) question:
https://github.com/multivendorx/dc-woocommerce-multi-vendor/issues/1082How 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_vendorBut 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.
-
September 16, 2022 at 5:05 PM #142004l.ganParticipantThis reply has been marked as private.
-
September 20, 2022 at 11:33 AM #142073NerdySupportExpert MoumitaKeymaster
@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?
-
September 20, 2022 at 4:50 PM #142083l.ganParticipant
Unfortunately I don’t have a developer for this
-
September 21, 2022 at 6:08 PM #142129NerdySupportExpert MoumitaKeymaster
@l.gan, you may hire our service team via this link : https://multivendorx.com/custom-development/
-
September 22, 2022 at 10:52 PM #142180NerdySupportExpert MoumitaKeymaster
@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.
-
September 30, 2022 at 7:31 PM #142436l.ganParticipant
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.
-
October 3, 2022 at 11:20 AM #142469NerdySupportExpert MoumitaKeymaster
Thanks, for helping out our user ๐
-
-
AuthorPosts
The topic ‘assign a vendor for a product using Woocommerce import/export’ is closed to new replies.