Add vendor articles to store tab

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 6 reply threads
  • Author
    Posts
    • #123545
      Kay
      Participant

      Hi, I will like to display vendor articles and events on the store tab on vendors’ page.

      How to do this please?

    • #123551
      Auhouse.ru
      Participant

      +

    • #123620

      Hello,

      To display vendor articles in vendor store page,
      Add this code in your theme’s functions.php

      add_filter( 'wcfmmp_store_tabs', 'new_wcfmmp_store_tabs',90,2);
      function new_wcfmmp_store_tabs($store_tabs, $id) {  
         $store_tabs['articles'] =  __( 'Articles', 'wc-multivendor-marketplace' );  
         return $store_tabs;
      }
      
      add_action('wcfmmp_store_article_template','store_article_html');
      function store_article_html() {
      	$article_id = get_the_ID();
      	?>
      	<a href="<?php echo esc_url(get_permalink($article_id)); ?>"><?php echo esc_attr(get_the_title()); ?></a>
      	<?php
      }

      To modify the article view You can override the article template ,from wp-content\plugins\wc-multivendor-marketplace\views\store\wcfmmp-view-store-articles.php
      Override at – child theme\wcfm\store\wcfmmp-view-store-articles.php

      Regarding vendor event in vendor store page, Can you let us know which plugin/theme are you using for event in your site?

      Thanks.

      • #123787
        Kay
        Participant

        Thanks for the snippet.

        Regarding vendor event in vendor store page, Can you let us know which plugin/theme are you using for event in your site?

        I use fooevents plugin with Martfury theme.

        • #123804

          Hi,

          Ok.
          This is not possible using code snippet.
          It requires serious custom development.
          Please contact us here –https://wclovers.com/setup-guidance/ with topic link.

          Thank You

    • #123631
      Auhouse.ru
      Participant

      Added code, how to make this bunch of text more beautiful and with pictures?

      Attachments:
      You must be logged in to view attached files.
    • #123643

      Hello,

      You have write own HTML structure as per your requirement how to display the articles. To show images modify this code

      add_action('wcfmmp_store_article_template','store_article_html');
      function store_article_html() {
      	$article_id = get_the_ID();
      	$src = wp_get_attachment_image_src( get_post_thumbnail_id($article_id), 'thumbnail' );
      	$url = $src[0];
      	?>
              <!-- Add your own HTML-->
      	<div style="display: inline-block;">
      		<img src="<?php echo $url;?>" alt="<?php echo esc_attr(get_the_title()); ?>" />
      		<p><a href="<?php echo esc_url(get_permalink($article_id)); ?>"><?php echo esc_attr(get_the_title()); ?></a></p>
      	</div>
      	<?php
      }

      Thanks.

    • #123646
      Auhouse.ru
      Participant

      It turned out like this, now align the mesh as it should

      Attachments:
      You must be logged in to view attached files.
    • #123780

      Hello,

      As mentioned earlier we have provided you the code which will display the articles in a “article” tab.
      But now you have to structured and design (write code in HTML and css) the each article as per your requirement to be displayed.
      If you asking us to designed the template as per your requirement, then this is not possible using code snippet.
      It requires serious custom development.
      If you are interested then please contact us here –https://wclovers.com/setup-guidance/

      Thanks

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