Multi Vendor Marketplace Plugin | WCFM Marketplace › Forums › WCFM – Marketplace (WooCommerce Multivendor Marketplace) › Catagory widget can't work
- This topic has 6 replies, 3 voices, and was last updated 5 years, 1 month ago by clickeke.
- AuthorPosts
- September 21, 2019 at 11:14 pm #82850clickekeParticipant
Hi,
https://sportown.com.tw/store/
Category widget in sidebar at store and vendor list can not show all subcategory,only display the subcategory which vendor latest post product。
I think the full function should show all products in category and subcategory add by this vendor。
Help me out ,please! - September 22, 2019 at 3:40 pm #82949WCFM ForumMember
Hi,
Well, this category filter shows only those categories and sub-categories which are associated with vendors’ products.
Thank You
- September 22, 2019 at 8:31 pm #82982clickekeParticipant
Hi,
We’ve checked that categories and sub-categories which associated with vendor are more than two sub-categories.
And we don’t know why $vendor_categories in wcfmmp-view-store-category.php are only 1 category and 1 sub-category.
Could you help us to check database by using sql or any way we can check that $vendor_categories is query correctly?Thank you for your quickly responding.
- September 22, 2019 at 11:09 pm #82998MakersParticipant
@clickeke I’ve been having this issue for 3 months as WC Lovers is aware and debugging still. I’ve been pulling my hair out trying to figure what causes this issue. I hate to say it, but I’m glad I’m not the only one because it shows it’s not an isolated issue. I’m going to follow this thread in hopes a solution to this problem is found, because this is a major problem for us for obvious reasons.
Please see attached for temporary workaround. This is only a partial workaround and not a fix, because the workaround itself only lets you select sub-categories but no main categories.
“I added this code temporarily….
add_filter( ‘wcfmmp_force_store_taxonomy_refresh’, ‘__return_true’ );
added code to a snippet after unchecking the main category “Main Category 1” and only leaving the sub-categories for “Main Category 1” checked and it populated the sub-categories for “Main Category 1” correctly. I was able to break the sub-categories again for “Main Category 1” by checking the main category “Main Category 1” along with the sub-categories.”
Best of luck to us!
Attachments:
You must be logged in to view attached files. - September 26, 2019 at 12:50 am #83624clickekeParticipant
@Makers Thank you for the information, we’ve tried your workaround and the result is the same as yours.
About the workaround, we use woocommerce to disable main category at first, and it’s useless.
So we take a look about the $vendor_categories.Please refer our analysis as below
1. The SQL query is in function “wcfmmp_get_vendor_taxonomy” under wc-multivendor-marketplace\core\class-wcfmmp-vendor.php
2. There are a huge logic after query, so we skip to verify those code.
But we think the problem is in that.
3. We take a shortcut by modifying SQL query.You can make the $vendor_categories return correctly by adding code
$sql .= ” GROUP BY
term
,parent
ORDER BYparent
“;right after $sql is assembled.
The SQL will force query return the correct structure for the logic after assembled.
Even though this problem should be piece of a cake without changing sql.Wish we can see the fix coming.
Attachments:
You must be logged in to view attached files. - September 26, 2019 at 8:17 pm #83868MakersParticipant
@clickeke Wow! Thank you very much for this information.
I’d like to see what @WCfMForum response is to your findings before I implement this into my site. Maybe they can utilize your findings to implement a fix in the next update for those of us effected that doesn’t require sql like you mentioned. Either way I really appreciate this information!
Thank you!
- October 5, 2019 at 9:01 pm #85297clickekeParticipant
WCFM Marketplace – Multivendor Marketplace 3.2.3 fix this issue verified.
Thank you for your helps.
- AuthorPosts
- The topic ‘Catagory widget can't work’ is closed to new replies.