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, 7 months ago by Sushobhan.
- AuthorPosts
- May 8, 2020 at 4:34 pm #128388inQrt Mobile SolutionsParticipant
Hi,
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 #128395SushobhanKeymaster
Hi,
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 #129095inQrt Mobile SolutionsParticipant
Hi 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 #129140SushobhanKeymaster
Hi,
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 #129145inQrt Mobile SolutionsParticipantThis reply has been marked as private.
- May 10, 2020 at 9:08 pm #129263SushobhanKeymaster
Hi,
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 #129441inQrt Mobile SolutionsParticipantThis reply has been marked as private.
- May 12, 2020 at 12:06 pm #129908SushobhanKeymaster
You 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.