Adding menu option to wcfm vendor view

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!

Multi Vendor Marketplace Plugin | WCFM Marketplace Forums WCFM – Ultimate Adding menu option to wcfm vendor view

Viewing 3 reply threads
  • Author
    Posts
    • #81434
      rajshekhar
      Participant

      Hello, I am trying to add my own menu option to vendor view of wcfm-maraketplace plugin. I am attaching two files ‘functions.php’ for adding StorePep option and ‘storepep.php’ where my article is located. my problem is when click on storePep my article is not loading properly. so please tell me what are all changes needed for ‘storepep.php’ file.

    • #81435
      rajshekhar
      Participant

      file extensions changed for uploading error

    • #81436
      rajshekhar
      Participant

      `//functions.php

      <?php
      add_filter(‘wcfm_menus’,’ws_get_wcfm_menus’, 30, 1);
      function ws_get_wcfm_menus($wcfm_menus) {
      $wcfm_menus[‘ws-storepep’] = array(
      ‘label’ => __( ‘StorePep’, ‘whiteshop’),
      ‘url’ => get_wcfm_storepep_url(),
      ‘icon’ => ‘shield’
      );
      // errr_log(‘wcfm functions’);
      return $wcfm_menus;
      }

      function get_wcfm_storepep_url() {
      global $WCFM;
      $wcfm_page = get_wcfm_page();
      $get_wcfm_settings_url = wcfm_get_endpoint_url( ‘ws-storepep’, ”, $wcfm_page );
      return $get_wcfm_settings_url;
      }

      // // ADD storepep VIEW
      add_action( ‘before_wcfm_load_views’, function($end_point) { // wcfm_load_views
      //$path = __DIR__ . ‘/wcfm/’;
      switch( $end_point ) {
      case ‘ws-storepep’:
      require_once dirname(__FILE__) . ‘/storepep.php’;
      break;
      }
      });

      add_filter( ‘wcfm_query_vars’, function( $fields ) {
      $wcfm_modified_endpoints = (array) get_option( ‘wcfm_endpoints’ );
      $fields[‘ws-storepep’] = ! empty( $wcfm_modified_endpoints[‘ws-storepep’] ) ? $wcfm_modified_endpoints[‘ws-storepep’] : ‘ws-storepep’;
      return $fields;
      });

      add_filter( ‘wcfm_endpoints_slug’, function( $fields ) {
      $fields[‘ws-storepep’] = ‘ws-storepep’;
      return $fields;
      });

      add_filter( ‘wcfm_endpoint_ws-storepep_title’, function( $title ) {
      $title = __( ‘WS storepep’, ‘wc-frontend-manager’ );
      return $title;
      });

      add_action( ‘init’, function() {
      global $WCFM_Query;

      // Intialize WCFM End points
      $WCFM_Query->init_query_vars();
      $WCFM_Query->add_endpoints();

      if( !get_option( ‘wcfm_updated_end_point_ws-storepep’ ) ) {
      // Flush rules after endpoint update
      flush_rewrite_rules();
      update_option( ‘wcfm_updated_end_point_ws-storepep’, 1 );
      }
      } );

    • #81749
      WCFM Forum
      Keymaster
Viewing 3 reply threads
  • You must be logged in to reply to this topic.