Home Forums WC Vendors Pro Support Is it possible to display the pro dashboard nav bar on a custom page?

NOTICE: We've Moved to a Ticket System for Support

As of August 31, 2017 (12am EST) our support forums will be retired (read-only), and we will be moving to a support ticket system.  This will allow us to better organize and answer support requests, and provide a more personalized experience as we assist our customers.

For the time being, we will leave our forums open for reading and learning while we work on creating a more robust Knowledge Base for everyone to use.

If you are a WC Vendors Pro customer please open a support ticket here. 

If you are a WC Vendors user please open a support ticket on the Wordpress.org forums.

The information on this forum is outdated and in most instances no longer relevant. Please be sure to check our documentation for the most up to date information.

https://docs.wcvendors.com/

Thank you to all of our customers!

 

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #29117
    criticalachievement
    Participant

    Hi!

    All of the WCVendors Pro pages on my website show the WCVendors Pro nav bar (with “Dashboard”, “Products”, “Orders”, etc.). Even the product edit page at, for example, “https://www.mywebsite.com/dashboard/product/edit” shows the nav bar. This is exactly what I want.

    Here is my problem:

    I created a custom page with a url of “https://www.mywebsite.com/dashboard/settings/my-custom-page”. However, my custom page does NOT show the WCVendors Pro nav bar.

    Is it possible to display the nav bar on my custom page?

    #29118
    WC Vendors Support
    Participant

    Not yet! We’ll be creating a shortcode to output the nav bar on other pages, to help facilitate a smoother transition to and from custom pages that arent natively part of Pro. Look for it in an upcoming release.

    #29119
    criticalachievement
    Participant

    Ok. Thank you for the fast response!

    #35367
    criticalachievement
    Participant

    Hi Ben,

    I browsed through the changelog but I didn’t see anything regarding this since my original question. Any updates?

    I’ve developed a system for website maintenance that allows me to edit core files, so if that’s what it takes to accomplish this, then that’s fine. Is there a solution that involves editing core files?

    #35375
    WC Vendors Support
    Participant

    This is planned for v1.4.0! 🙂

    #35393
    criticalachievement
    Participant

    Ben,

    Thanks for the fast response, but at the same time…ARRRRRRRRRRGH!!!

    #35395
    criticalachievement
    Participant

    Ben,

    I think I figured it out. The basic approach is copying how the product-edit.php file is set up. The solution requires editing a core file (class-wcvendors-pro-dashboard.php) as well as creating a new file in a core directory. This is what seems to be working for me:

    1. create a new file in the same directory as product-edit.php (mine is called settings-location.php) and put your custom page code in it

    2. edit class-wcvendors-pro-dashboard.php with the part between the comment lines (the first part is just shown for context)

    		// if action is set send to edit page with or without object_id else list type 
    		if ('edit' == $action ) { 
    			wc_get_template( $object.'-'.$action.'.php', 
    				array( 
    					'action' 		=> $action, 
    					'object_id' 	=> $object_id 
    				), 
    				'wc-vendors/dashboard/', $this->base_dir . '/templates/dashboard/' );
    				
    /**********************************************************************/
    
    		}
    		
    		// this is to get the nav menu to show up on each location page
    		elseif ('location' == $action ) { // "location" is used because the custom page is at url /dashboard/settings/location/123 for example
    			
    			wc_get_template( 'settings-location.php', 
    				array( 
    					'action' 		=> $action, 
    					'object_id' 	=> $object_id 
    				), 
    				'wc-vendors/dashboard/', $this->base_dir . '/templates/dashboard/' );
    
    /**********************************************************************/

    3. edit class-wcvendors-pro-dashboard.php again, this time with the part between the comment lines (the first part is again just shown for context)

    	public function get_dashboard_pages()  { 
    			
    		$this->dashboard_pages[ 'product' ] = array( 
    			'slug'			=> 'product', 
    			'label'			=> __('Products', 'wcvendors-pro' ), 
    			'actions'		=> array( 
    								'edit' 		=> __('Edit', 'wcvendors-pro' ), 
    								'delete'	=> __('Delete', 'wcvendors-pro' )
    							)
    		);
    
    		$this->dashboard_pages[ 'order' ] = array( 
    			'slug'			=> 'order', 
    			'label'			=> __('Orders', 'wcvendors-pro' ), 
    			'actions'		=> array()
    		);
    
    		$this->dashboard_pages[ 'settings' ] = array( 
    		
    /********************************************************************/
    		
    			'slug'		=> 'settings',
    			'label'		=> __('Settings', 'wcvendors-pro' ),
    			 
    			//this is to get the nav menu to show up on each location page
    			//'actions'		=> array( )
    			'actions'		=> array( 
    								'location' 		=> __('Location', 'wcvendors-pro' )
    							)
    							
    /********************************************************************/

    I think that’s it. Overall, not very straightforward, but not a huge tear up either.

    #35414
    WC Vendors Support
    Participant

    That would certainly work for the time being, yup!

Viewing 8 posts - 1 through 8 (of 8 total)
  • The forum ‘WC Vendors Pro Support’ is closed to new topics and replies.