How to override views?

We're shifting our Forum based support to a more dedicated support system!

We'll be closing our Forum support from 10th June, 2020 and move to Email Support assistance.

  • If you are a WCFM premium add-ons user, contact us- here
  • Want to know more before buying our add-ons? Send Pre sale queries- here
  • If you are a WCFM free user, please open a support ticket at WordPress.org
  • For WCFM App related queries, reach us- here
From now the forum will be read-only!

Viewing 7 reply threads
  • Author
    Posts
    • #128388

      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!

    • #128395
      Sushobhan
      Keymaster

      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!

    • #129095

      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!

    • #129140
      Sushobhan
      Keymaster

      Hi,
      I’m not entirely sure about your requirement. Could you please send me a snapshot, annotating your requirement.
      Thank You!

    • #129145
      This reply has been marked as private.
    • #129263
      Sushobhan
      Keymaster

      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 the

      tag.
      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!

    • #129441
      This reply has been marked as private.
    • #129908
      Sushobhan
      Keymaster

      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.

Viewing 7 reply threads
  • You must be logged in to reply to this topic.