MultivendorX Pro
-
AuthorPosts
-
-
July 24, 2023 at 9:42 PM #194642Nathan WolhendlerParticipant
On my marketplace I want to be able to display the vendor stores as the first display and once. clicked inside you can see the products being offered (instead of filtering by product from all vendors. How can I do this?
-
July 25, 2023 at 8:29 PM #194692Nathan WolhendlerParticipant
Any update on this?
-
July 25, 2023 at 8:30 PM #194693NerdySupportExpert MoumitaKeymaster
Hi, by default WooCommerce by default displays only products.
So, as a solution, you can create a page that will show all the vendors in a list using this shortcode : [mvx_vendorslist orderby=”registered” order=”ASC”]Once user will select the vendor, they will be directed to that vendor’s shop page.
Let us know if you need any further help.
-
July 25, 2023 at 8:57 PM #194698Nathan WolhendlerParticipant
I need to be able to filter the vendors by category and that the list should update dynamically.
Using this we cannot filter. Any other solution? -
July 26, 2023 at 6:36 AM #194706Nathan WolhendlerParticipant
or a possible widget to make this work?
-
July 26, 2023 at 3:55 PM #194718Sangita Support SquadKeymaster
You can use our category wise vendor list short code in order to have a list with all of your vendors and let your customers have the possibility to filter vendors as per category –
[mvx_vendorslist orderby=”category”]
CopyI think this would be able to help you out.
-
July 26, 2023 at 8:15 PM #194720Nathan WolhendlerParticipant
This is good for orderby but is there a way to use this short-code and filter by category and location? So I only see the vendors let’s say in food and usa?
-
July 26, 2023 at 8:16 PM #194721Nathan WolhendlerParticipant
also is there a way to customise what this looks like and what is shown (now it is showing. top. selling products but I dont want that
-
July 28, 2023 at 11:21 AM #194743Sangita Support SquadKeymaster
@Nathan In the vendor list page there is already an option for the users to search for vendors by putting address or distance https://prnt.sc/yoaJ2bGBtGaj.
Now if you want to customize the page then you will have to add custom code for that.
For example, if you add the below code in the functions.php file of you current active theme then the top products section will be removed –add_action( 'init', 'remove' ); function remove() { remove_action( 'mvx_vendor_lists_vendor_top_products', 'mvx_vendor_lists_vendor_top_products' ); }
Copy -
July 28, 2023 at 9:28 PM #194755Nathan WolhendlerParticipant
that’s great is there a way to filter / sort by a custom field?
-
July 29, 2023 at 12:01 PM #194762Sangita Support SquadKeymaster
@Nathan Wolhendler I am afraid but there is no such short code using which you can filter vendors by custom field on the vendor list page.
However, you can do custom code and add this support for your site. If you need a reference of hook/filter, let us know. -
August 1, 2023 at 8:23 PM #194807Nathan WolhendlerParticipant
Yes please, so we need a hook/filter that can generate a gallery of vendors filtered by location and another filtered by category of products offered
-
August 2, 2023 at 6:48 PM #194825Sangita Support SquadKeymaster
There are already options to filter vendors by products category and also search for vendors according to location on the vendor list page. Kindly check the video https://watch.screencastify.com/v/yX59XesT3hZiPGQF84hc.
If you need any further help, please do not hesitate to ask. -
August 3, 2023 at 8:06 AM #194840Nathan WolhendlerParticipant
yes, I want to be able to display only 1 category of vendors per category view (ex show all the vendors for women on the womens page and all the vendors. for baby. on the baby page) how can I do that?
-
August 3, 2023 at 7:56 PM #194860Nathan WolhendlerParticipant
any update on this, also our location is a custom field that is by neighborhood, so we would need to created filtered views by category. and this custom location field
-
August 3, 2023 at 9:02 PM #194863Sangita Support SquadKeymaster
@Nathan Wolhendler
Our team is looking into this. Kindly provide them some time. -
August 3, 2023 at 10:03 PM #194865Nathan WolhendlerParticipant
thank you!
-
August 4, 2023 at 6:42 PM #194890Sangita Support SquadKeymaster
Hello @Nathan Wolhendler
You need to add the below code in the functions.php file of your current active theme and use the below short code for the vendor list page to show vendors of different categories on different page –[mvx_vendorslist orderby=”category” order=”ASC” category="hoodies"]
Copy/**** Add category attribute on vendor list shortcode *****/ add_filter('mvx_vendor_list_get_mvx_vendors_args', 'mvx_vendor_list_shortcode_category_attribute' , 10 , 4 ); function mvx_vendor_list_shortcode_category_attribute( $query, $order_by, $qst, $atts ){ if( empty( $atts ) ) return $query; $block_vendors = wp_list_pluck(mvx_get_all_blocked_vendors(), 'id'); $include_vendors = array(); $pro_args = array( 'posts_per_page' => -1, 'post_type' => 'product', 'tax_query' => array( array( 'taxonomy' => 'product_cat', 'terms' => array_map('sanitize_title', explode(',',$atts['category'])), 'field' => 'slug', 'operator' => 'IN' ) ) ); $products = get_posts($pro_args); $product_ids = wp_list_pluck($products, 'ID'); foreach ($product_ids as $product_id) { $vendor = get_mvx_product_vendors($product_id); if ($vendor && !in_array($vendor->id, $block_vendors)) { $include_vendors[] = $vendor->id; } } $query['include'] = $include_vendors; return $query; }
CopyNote – modify the short accordingly for different categories.
-
August 4, 2023 at 8:32 PM #194898Nathan WolhendlerParticipant
thank you so much for this! I see this works for the custom view by category can this be used for custom fields as well or just the category field?
-
August 7, 2023 at 10:59 AM #194923Sangita Support SquadKeymaster
@Nathan Wolhendler The code and short code that we have shared is to show the vendor list as per category. Now if you want to do the same for custom fields then you will have to modify the code and short code accordingly .
-
August 8, 2023 at 12:46 AM #194935Nathan WolhendlerParticipant
I added the code to my site as instructed but it is not filtering, it is still showing all the vendors on the site.
Here is a link: https://buizmo.com/test/ -
August 8, 2023 at 12:45 PM #194950Sangita Support SquadKeymaster
@Nathan Wolhendler We have added the code in the functions.php file of the current active theme and on the sort code added category as pant and on the vendor list only the vendor having product of the category pant is displayed on the page and if we change the category then the vendor will be displayed accordingly on the vendor list page.
Kindly check the video :https://fluvid.com/videos/detail/6Mp2Kuw3nrs9kjy1L -
August 12, 2023 at 1:10 AM #195074Nathan WolhendlerParticipant
I see now that if the category does not have any vendors then it shows everything that is why I thought it was not working.
Is it possible to show blank instead of all when there are no vendors for that category?
Also how can I get the vendors to display without showing top products? -
August 12, 2023 at 4:12 PM #195082Sangita Support SquadKeymaster
@Nathan Wolhendler The code we have shared with you using that if you put a category on the shortcode that no vendor has a product of that category then on the vendor list page a message “No vendor found!” will be shown. Kindly check the video – https://watch.screencastify.com/v/PdUVvBzfIsSUBaPsi0NA.
You can add the below code in the functions.php file of your current active theme to remove the top products section –add_action( 'init', 'remove' ); function remove() { remove_action( 'mvx_vendor_lists_vendor_top_products', 'mvx_vendor_lists_vendor_top_products' ); }
Copy -
August 13, 2023 at 2:11 PM #195096Nathan WolhendlerParticipant
I don’t have access to the video. Also, Is there a way to display the store description on there?
-
August 13, 2023 at 2:23 PM #195097Nathan WolhendlerParticipant
And one more point, can you help me modify the code to add my custom taxonomy there (I am not familiar with coding php). The custom taxonomy that I want to filter by in addition to the category is called ‘location’. What code would I add into the snippet you gave me to add this filter?
-
August 14, 2023 at 8:35 PM #195133NerdySupportExpert MoumitaKeymaster
Hi, our replies are inline :
– I don’t have access to the video. Also, Is there a way to display the store description on there?
>> Make sure that you have passed category name in this shortcode :
[mvx_vendorslist orderby=”category” order=”ASC” category=”hoodies”]
Regarding the store description, can you share a scrrenshot of the changes you are looking for so we can assist you.
– And one more point, can you help me modify the code to add my custom taxonomy there (I am not familiar with coding php). The custom taxonomy that I want to filter by in addition to the category is called ‘location’. What code would I add into the snippet you gave me to add this filter?
>> We’re happy to try help with these modifications, but only if customization requires few lines (10-15) of new code. However, if your requirement requires more than that kind of effort, we recommend you to contact a developer.
You may also hire our experts for this : https://multivendorx.com/custom-development/ -
August 15, 2023 at 6:47 AM #195146Nathan WolhendlerParticipant
I have attached the vendor as it looks. now and how I would want it to look.
For the code you already gave me the code to filter by category (above in the thread) If you can just modify it to add the custom taxonomy called location that would be really helpful! thanks -
August 16, 2023 at 1:10 PM #195190NerdySupportExpert MoumitaKeymaster
@Nathan Wolhendler, as we are not able to enlarge the video, hence please share the site link so we can check the flow and understand the requirement.
-
August 16, 2023 at 8:25 PM #195211Nathan WolhendlerParticipant
-
August 17, 2023 at 5:28 PM #195230Sangita Support SquadKeymaster
@Nathan Wolhendler Kindly refer to our code for map and how we are detecting the current location and then showing the nearest vendors as per that.
Now you need to incorporate that code with the code we have shared earlier with you to achieve your required flow.
However, we provide custom code for modifications that need a few lines of code (12-15 lines). But the modification you are looking for needs a huge amount of code and providing that is quite difficult for us.
So I would request you to contact your developer for this or You may also hire our experts for this : https://multivendorx.com/custom-development/ -
August 18, 2023 at 10:04 PM #195273Nathan WolhendlerParticipant
Thanks, I think you misunderstood my question. I have a custom taxonomy called ‘Location’. I want to filter by that in addition to the category in this code:
[mvx_vendorslist orderby=”category” order=”ASC” category=”hoodies”]
/**** Add category attribute on vendor list shortcode *****/
add_filter(‘mvx_vendor_list_get_mvx_vendors_args’, ‘mvx_vendor_list_shortcode_category_attribute’ , 10 , 4 );
function mvx_vendor_list_shortcode_category_attribute( $query, $order_by, $qst, $atts ){
if( empty( $atts ) ) return $query;
$block_vendors = wp_list_pluck(mvx_get_all_blocked_vendors(), ‘id’);
$include_vendors = array();
$pro_args = array(
‘posts_per_page’ => -1,
‘post_type’ => ‘product’,
‘tax_query’ => array(
array(
‘taxonomy’ => ‘product_cat’,
‘terms’ => array_map(‘sanitize_title’, explode(‘,’,$atts[‘category’])),
‘field’ => ‘slug’,
‘operator’ => ‘IN’
)
)
);
$products = get_posts($pro_args);
$product_ids = wp_list_pluck($products, ‘ID’);
foreach ($product_ids as $product_id) {
$vendor = get_mvx_product_vendors($product_id);
if ($vendor && !in_array($vendor->id, $block_vendors)) {
$include_vendors[] = $vendor->id;
}
}
$query[‘include’] = $include_vendors;
return $query;
}Can you help?
-
August 21, 2023 at 8:30 PM #195338Sangita Support SquadKeymaster
Our team is looking in to this. We will keep you posted.
-
October 25, 2023 at 11:54 AM #197485Sangita Support SquadKeymaster
We somehow missed this thread. Kindly let us know if your issue/query is resolved now or not.
-
October 25, 2023 at 7:15 PM #197496Nathan WolhendlerParticipant
I ended up using custom code, you can close the thread
-
-
AuthorPosts
The topic ‘Way to display and filter by vendor instead of product’ is closed to new replies.