Multi Vendor Marketplace Plugin | WCFM Marketplace › Forums › WCFM – Marketplace (WooCommerce Multivendor Marketplace) › How to override views?
- This topic has 7 replies, 2 voices, and was last updated 4 years, 9 months ago by
Sushobhan.
- AuthorPosts
- May 8, 2020 at 4:34 pm #128388
inQrt Mobile Solutions
ParticipantHi,
I’m trying to override some things like the vendor store page header and tried to copy over the corresponding file from the views/ directory inside the marketplace plugin to a new wcfm/ folder inside my child theme (as I’ve seen in another post somewhere), but no changes show.Can you assist?
Thanks in advance!
- May 8, 2020 at 4:49 pm #128395
Sushobhan
KeymasterHi,
Thanks for getting in touch with us!
To override the wc-multivendor-marketplace\views\store\wcfmmp-view-store-header.php (vendor store page header file), you will need to copy it to [your-child-theme-folder]\wcfm\store\wcfmmp-view-store-header.php
Don’t create the view folder, it’s not needed.
I hope this answers your question.
Thank You! - May 10, 2020 at 12:55 pm #129095
inQrt Mobile Solutions
ParticipantHi Sushobhan,
thank you, this worked out nicely. There is another question related to this:I need to override the single product display and add the vendor shop slug since I need that as a custom CSS class on the main div (I did manage to do so in the vendor shop display) – how can this be achieved?
Thanks in advance!
- May 10, 2020 at 3:17 pm #129140
Sushobhan
KeymasterHi,
I’m not entirely sure about your requirement. Could you please send me a snapshot, annotating your requirement.
Thank You! - May 10, 2020 at 3:45 pm #129145
inQrt Mobile Solutions
ParticipantThis reply has been marked as private. - May 10, 2020 at 9:08 pm #129263
Sushobhan
KeymasterHi,
It’s theme dependant. Each theme does it their way. You could take a look here- woocommerce\templates\global\wrapper-start.php
If your theme overrides this file then you can copy that from your theme and edit. Alternatively, you can directly copy the WooCommerce template into your child theme and add vendor name class in thetag.
Now how to find the vendor store name, well in single product page you will get global $post. You can use that to get the vendor id and hence the store name like the following-global $post; $store_id = $post->post_author; if( wcfm_is_vendor($store_id) ) { $store_user = wcfmmp_get_store( $store_id ); $store_name = $store_user->get_shop_name(); }
Hope this helps.
Thank You! - May 11, 2020 at 11:10 am #129441
inQrt Mobile Solutions
ParticipantThis reply has been marked as private. - May 12, 2020 at 12:06 pm #129908
Sushobhan
KeymasterYou are always welcome 🙂
Let me know if there’s anything else we can help you with.
Can we ask for a favor? Would you mind taking a few minutes to review our plugin (if you haven’t already) at https://wordpress.org/support/plugin/wc-multivendor-marketplace/reviews/ and let others know about your 5 Star experience with WCFM Marketplace? Also, follow us on Twitter https://twitter.com/wcfmmp for more exciting news, important updates, and irresistible offers.
- AuthorPosts
- You must be logged in to reply to this topic.