Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
866d4da
add: fullwidth template support for Dokan dashboard with custom templ…
MdAsifHossainNadim Oct 16, 2025
186b791
enhance: conditionally apply fullwidth template filter and improve te…
MdAsifHossainNadim Oct 16, 2025
9b1bed1
refactor: update vendor dashboard template logic with action-based ap…
MdAsifHossainNadim Oct 17, 2025
8c90af5
enhance: Implement full width layout for vendor dashbaord. (#2955)
MdAsifHossainNadim Oct 29, 2025
3cff7c6
Merge branch 'develop' into enhance/add-custom-dokan-dashboard-full-w…
MdAsifHossainNadim Oct 29, 2025
2dc6128
refactor: simplify vendor dashboard template logic, improve header na…
MdAsifHossainNadim Oct 29, 2025
2d17a94
feat: refine vendor dashboard layout and style for improved UI/UX, ad…
MdAsifHossainNadim Oct 31, 2025
2e10f07
feat: optimize vendor dashboard for responsiveness across devices, up…
MdAsifHossainNadim Nov 5, 2025
d035c76
enhance: Adjust button padding and simplify styles in `dataviews` com…
MdAsifHossainNadim Nov 6, 2025
87db47a
feat: add default vendor layout setting in `dokan_appearance` options…
MdAsifHossainNadim Nov 7, 2025
69d8c52
Merge branch 'develop' into enhance/add-custom-dokan-dashboard-full-w…
MdAsifHossainNadim Nov 13, 2025
57336c8
Merge branch 'develop' into enhance/add-custom-dokan-dashboard-full-w…
MdAsifHossainNadim Nov 20, 2025
284935d
feat: improve sidebar URL handling and store name display with enhanc…
MdAsifHossainNadim Nov 20, 2025
ad89b7f
feat: add target attribute for store link and toggle onClick handler …
MdAsifHossainNadim Nov 21, 2025
3ee82f9
feat: normalize list styling in Sidebar and Header components for con…
MdAsifHossainNadim Nov 21, 2025
9e077d6
feat: fix xstore theme conflicts with vendor dashboard layout styles
MdAsifHossainNadim Nov 24, 2025
f56491c
feat: refine layout styling for Sidebar, Header, and Withdraw table c…
MdAsifHossainNadim Nov 24, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 44 additions & 0 deletions assets/src/less/dashboard.less
Original file line number Diff line number Diff line change
Expand Up @@ -533,6 +533,12 @@ div.media-sidebar a.edit-attachment{
padding-right: 5px;
}
}

#dokan-dashboard-fullwidth-wrapper {
.dokan-dashboard-content {
width: calc(100% - var(--dokan-sidebar-width, 250px));
}
}
}

.dokan-column-name-with-avatar {
Expand All @@ -548,3 +554,41 @@ div.media-sidebar a.edit-attachment{
box-shadow: 0 1px 0 0 #e0e0e0;
}
}

@media screen and ( max-width: 768px ) {
#dokan-dashboard-fullwidth-wrapper {
.dokan-dashboard-content {
width: 100%;
}

.dokan-frontend-layout {
header {
padding: 0 22px;
min-height: 60px;
height: 60px;
}

.visit-store,
.header-avatar {
padding: 0;
}

.header-avatar {
padding-left: 20px;
}

.visit-store {
font-size: 12px;
padding-right: 20px;
}
}
}
}

@media screen and ( max-width: 600px ) {
#dokan-dashboard-fullwidth-wrapper {
#dokan-vendor-dashboard-layout-root {
top: 0;
}
}
}
51 changes: 51 additions & 0 deletions assets/src/less/site-navigation.less
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,31 @@
}
}
}

#dokan-dashboard-fullwidth-wrapper {
.dokan-dash-sidebar {
transition: width .2s ease;
width: var(--dokan-sidebar-width, 250px);
max-width: var(--dokan-sidebar-width, 250px);
}

.dokan-dashboard-wrap {
z-index: 1;
position: relative;

.dokan-dashboard-content {
position: relative;
padding: 48px;
}

> div:not(.dokan-dashboard-content) {
visibility: hidden;
}
> .dokan-dashboard-content {
display: none;
}
}
}
}

@keyframes showNav {
Expand Down Expand Up @@ -338,3 +363,29 @@
}
}
}

@media screen and ( max-width: 768px ) {
.dokan-dashboard {
#dokan-dashboard-fullwidth-wrapper {
position: relative;

.dokan-dash-sidebar {
display: none;
}

.dokan-dashboard-wrap {
.dokan-dashboard-content {
padding: 24px;
}
}
}
}
}

@media screen and ( max-width: 600px ) {
#dokan-dashboard-fullwidth-wrapper {
#dokan-vendor-dashboard-layout-root {
z-index: 99999;
}
}
}
45 changes: 41 additions & 4 deletions includes/Admin/Settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ public function __construct() {
add_filter( 'dokan_get_settings_values', [ $this, 'set_withdraw_limit_gateways' ], 20, 2 );
add_filter( 'dokan_get_settings_values', [ $this, 'set_commission_type_if_not_set' ], 20, 2 );
add_filter( 'dokan_settings_general_site_options', [ $this, 'add_dokan_data_clear_setting' ], 310 );
add_filter( 'dokan_get_settings_values', [ $this, 'set_vendor_latest_layout' ], 20, 2 );
}

/**
Expand Down Expand Up @@ -812,11 +813,29 @@ public function get_settings_fields() {
],
],
'dokan_appearance' => [
'appearance_options' => [
'name' => 'appearance_options',
'vendor_layout_options' => [
'name' => 'vendor_layout_options',
'type' => 'sub_section',
'label' => __( 'Store Appearance', 'dokan-lite' ),
'description' => __( 'Configure your site appearances.', 'dokan-lite' ),
'label' => esc_html__( 'Vendor Dashboard Appearance', 'dokan-lite' ),
'description' => esc_html__( 'Configure the appearance and style of the vendor dashboard.', 'dokan-lite' ),
],
'vendor_layout_style' => [
'name' => 'vendor_layout_style',
'label' => esc_html__( 'Vendor Dashboard Style', 'dokan-lite' ),
'desc' => esc_html__( 'Select the user interface for the vendor dashboard.', 'dokan-lite' ),
'type' => 'radio',
'default' => 'latest',
'options' => [
'latest' => esc_html__( 'New UI', 'dokan-lite' ),
'legacy' => esc_html__( 'Legacy UI', 'dokan-lite' ),
],
],
'appearance_options' => [
'name' => 'appearance_options',
'type' => 'sub_section',
'label' => esc_html__( 'Store Appearance', 'dokan-lite' ),
'description' => esc_html__( 'Configure your site appearances.', 'dokan-lite' ),
'content_class' => 'sub-section-styles',
],
'store_map' => [
'name' => 'store_map',
Expand Down Expand Up @@ -1185,4 +1204,22 @@ public function sanitize_custom_store_url( $value ) {

return $value;
}

/**
* Set the default settings for vendor layout.
*
* @since DOKAN_SINCE
*
* @param mixed $option_name
* @param mixed $option_value
*
* @return void|mixed $option_value
*/
public function set_vendor_latest_layout( $option_value, $option_name ) {
if ( 'dokan_appearance' === $option_name && empty( $option_value['vendor_layout_style'] ) ) {
$option_value['vendor_layout_style'] = 'latest';
}

return $option_value;
}
}
1 change: 1 addition & 0 deletions includes/ReverseWithdrawal/Hooks.php
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,7 @@ public function add_reverse_withdrawal_nav( $urls ) {
'icon' => '<i class="fas fa-dollar-sign"></i>',
'url' => dokan_get_navigation_url( 'reverse-withdrawal' ),
'pos' => 71,
'icon_name' => 'Redo2',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

Verify the icon name exists in the icon library.

The addition of 'icon_name' => 'Redo2' looks appropriate for the reverse withdrawal navigation item. Please confirm that the 'Redo2' icon exists in the icon library used by the new React dashboard layout and renders correctly.


🏁 Script executed:

#!/bin/bash
# Description: Search for the Redo2 icon definition or usage in the React components

# Search for Redo2 icon in component files, icon definitions, or imports
rg -n --type=js --type=ts -C3 "Redo2"

# Also search in any icon registry or mapping files
fd -e js -e ts -e jsx -e tsx | xargs rg -l "icon.*registry|iconMap|icon.*metadata" | head -5 | xargs cat

Length of output: 1700


'Redo2' icon name is not defined in the icon registry and will fail at runtime.

The 'icon_name' => 'Redo2' references an icon that does not exist in the codebase's iconMap. When the component receives this key, it will:

  1. Log a console warning: "Icon with key 'Redo2' not found in icon map"
  2. Return null (render nothing)

The available icon keys are: 'whats-new', 'support', 'facebook', 'documentation', 'faq', 'settings', 'feature-request', 'setup-wizard', 'import-data', 'custom-icon'.

Either use an existing icon name from this list, or add the 'Redo2' icon component to the registry (import it and add it to iconMap).

🤖 Prompt for AI Agents
In includes/ReverseWithdrawal/Hooks.php around line 256, the item uses
'icon_name' => 'Redo2' which is not present in the app's iconMap and will cause
a runtime warning and render nothing; fix it by either replacing 'Redo2' with
one of the available keys (e.g., 'custom-icon' or another listed:
'whats-new','support','facebook','documentation','faq','settings','feature-request','setup-wizard','import-data')
or add the Redo2 icon to the registry by importing/defining the Redo2 component
and adding it to the iconMap with the corresponding key.

'permission' => 'dokan_view_withdraw_menu',
];

Expand Down
184 changes: 184 additions & 0 deletions includes/Shortcodes/Dashboard.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,195 @@
namespace WeDevs\Dokan\Shortcodes;

use WeDevs\Dokan\Abstracts\DokanShortcode;
use WeDevs\Dokan\Utilities\OrderUtil;
use WeDevs\Dokan\Utilities\VendorUtil;

class Dashboard extends DokanShortcode {

protected $shortcode = 'dokan-dashboard';

/**
* Script/style handle key for vendor dashboard React app.
*
* @var string
*/
protected $script_key = 'dokan-vendor-dashboard';

/**
* Dashboard constructor.
*
* @return void
*/
public function __construct() {
parent::__construct();

// Register vendor dashboard assets if the vendor layout is not legacy.
$vendor_layout = dokan_get_option( 'vendor_layout_style', 'dokan_appearance', 'latest' );
if ( 'legacy' !== $vendor_layout ) {
add_action( 'init', [ $this, 'register_vendor_dashboard_assets' ] );
add_action( 'wp_enqueue_scripts', [ $this, 'enqueue_vendor_dashboard_assets' ] );
add_action( 'template_redirect', [ $this, 'rewrite_vendor_dashboard_template' ], 1 );
}
}

/**
* Rewrite vendor dashboard template
*
* This method intercepts the template_redirect action and loads
* a custom full-width template for the vendor dashboard.
*
* @since 4.1.3
*
* @return void
*/
public function rewrite_vendor_dashboard_template() {
// Check if the user is logged in and is on the vendor dashboard.
if ( is_user_logged_in() && dokan_is_seller_dashboard() ) {
$dashboard_template = DOKAN_DIR . '/templates/dashboard/fullwidth-dashboard.php';

// Check if the custom template exists.
if ( file_exists( $dashboard_template ) ) {
// Load dokan full width vendor dashboard template.
include_once $dashboard_template;
wp_print_media_templates();
exit;
}
}
}

/**
* Register and enqueue React vendor dashboard assets when viewing the seller dashboard.
*
* @since 4.1.3
*
* @return void
*/
public function register_vendor_dashboard_assets() {
$admin_dashboard_file = DOKAN_DIR . '/assets/js/vendor-dashboard/layout/index.asset.php';
if ( file_exists( $admin_dashboard_file ) ) {
$dashboard_script = require $admin_dashboard_file;
$dependencies = $dashboard_script['dependencies'] ?? [];
$version = $dashboard_script['version'] ?? '';

wp_register_script(
$this->script_key,
DOKAN_PLUGIN_ASSEST . '/js/vendor-dashboard/layout/index.js',
$dependencies,
$version,
true
);

wp_register_style(
$this->script_key,
DOKAN_PLUGIN_ASSEST . '/js/vendor-dashboard/layout/index.css',
[ 'dokan-tailwind' ],
$version
);

wp_set_script_translations(
$this->script_key,
'dokan-lite'
);

$user_id = get_current_user_id();
$vendor = dokan()->vendor->get( $user_id );
$is_admin = current_user_can( 'manage_options' );
$user_name = wp_get_current_user()->display_name ?? '';
$admin_access = dokan_get_option( 'admin_access', 'dokan_general', 'on' );
$no_access = OrderUtil::is_hpos_enabled() ? 'on' : $admin_access;

// Frontend header nav items.
// Build base with My Account and Log out; insert conditional admin links next.
$header_nav = [
[
'label' => esc_html__( 'My Account', 'dokan-lite' ),
'icon' => 'UserRound',
'url' => dokan_get_navigation_url( 'edit-account' ),
],
[
'label' => esc_html__( 'Log out', 'dokan-lite' ),
'icon' => 'LogOut',
'url' => esc_url_raw( wp_logout_url( home_url() ) ),
],
];

if ( $is_admin ) {
// Only administrators: show Back to WP Panel.
array_splice(
$header_nav,
1,
0,
[
[
'label' => esc_html__( 'Back to WP Panel', 'dokan-lite' ),
'icon' => 'WPLogo',
'url' => admin_url(),
'isSvg' => true,
],
]
);
} elseif ( 'on' !== $no_access ) {
// Non-admins with admin panel access: show Access Admin Panel.
array_splice(
$header_nav,
1,
0,
[
[
'label' => esc_html__( 'Access Admin Panel', 'dokan-lite' ),
'icon' => 'LockOpen',
'url' => admin_url(),
],
]
);
}

wp_add_inline_script(
$this->script_key,
'var vendorDashboardLayoutConfig = ' . wp_json_encode(
apply_filters(
'dokan_vendor_dashboard_layout_config',
[
'siteInfo' => [
'siteTitle' => get_bloginfo( 'name' ),
'siteIcon' => get_site_icon_url(),
],
'vendor' => [
'name' => $vendor ? $vendor->get_shop_name() : $user_name,
'avatar' => $vendor->get_avatar() ?? VendorUtil::get_vendor_default_avatar_url(),
],
'editUrl' => dokan_get_navigation_url( 'edit-account' ),
'user' => [
'name' => $user_name,
'avatar' => get_avatar_url( $user_id ),
],
'sidebarNav' => dokan_get_dashboard_nav(),
'headerNav' => $header_nav,
],
$vendor
)
),
'before'
);
}
}

/**
* Enqueue React vendor dashboard assets when viewing the seller dashboard.
*
* @since 4.1.3
*
* @return void
*/
public function enqueue_vendor_dashboard_assets() {
if ( ! is_user_logged_in() || ! dokan_is_seller_dashboard() ) {
return;
}

wp_enqueue_script( $this->script_key );
wp_enqueue_style( $this->script_key );
}

/**
* Load template files
*
Expand Down
Loading
Loading