Although our Vendor Dashboard page is independent of the theme, it may still happen that their script gets loaded in our dashboard page. It will cause functionality issues on the dashboard page.
Here are some solutions for each theme. Add those codes in your function.php of your currently active theme.
Enfold theme #
add_action( 'wp_enqueue_scripts', 'theme_issue_fix', -1 );
function theme_issue_fix() {
if( is_vendor_dashboard() && is_user_logged_in() ) {
wp_dequeue_script( 'avia-woocommerce-js' );
wp_dequeue_script( 'avia-module-contact' );
wp_dequeue_script( 'avia-module-gallery' );
wp_dequeue_script( 'avia-module-hotspot' );
wp_dequeue_script( 'avia-module-slideshow' );
wp_dequeue_script( 'avia-module-slideshow-fullscreen' );
wp_dequeue_script( 'avia-module-slideshow-video' );
wp_dequeue_script( 'avia-module-tabs' );
wp_dequeue_script( 'avia-module-toggles' );
wp_dequeue_script( 'avia-module-video' );
wp_dequeue_script( 'avia-parallax' );
wp_dequeue_script( 'avia-parallax-support' );
wp_dequeue_script( 'avia-megamenu' );
wp_dequeue_script( 'avia-sticky-header' );
wp_dequeue_script( 'avia-footer-effects' );
wp_dequeue_script( 'avia-widget-js' );
wp_deregister_script( 'avia_blocks_front_script' );
}
}
add_action('wp_enqueue_scripts', 'dequeue_function', -1);
function dequeue_function(){
if (is_vendor_dashboard() && is_user_logged_in() ) {
remove_action( 'wp_enqueue_scripts', 'avia_register_frontend_scripts' );
}
}
WoodMart Theme #
add_action( 'wp_enqueue_scripts', 'theme_issue_fix', 99999999999999 );
function theme_issue_fix() {
if( is_vendor_dashboard() && is_user_logged_in() ) {
wp_dequeue_style( 'wppb_stylesheet' );
wp_dequeue_style( 'xts-google-fonts' );
wp_dequeue_style( 'xts-style-theme_settings_default' );
wp_dequeue_style( 'xts-style-header_541962' );
wp_dequeue_style( 'wd-scroll-top' );
wp_dequeue_style( 'wd-social-icons' );
wp_dequeue_style( 'wd-text-block' );
wp_dequeue_style( 'wd-footer-base' );
wp_dequeue_style( 'wd-widget-collapse' );
wp_dequeue_style( 'wd-page-title' );
wp_dequeue_style( 'wd-mod-nav-menu-label' );
wp_dequeue_style( 'wd-widget-shopping-cart' );
wp_dequeue_style( 'wd-header-cart' );
wp_dequeue_style( 'wppb_stylesheet' );
wp_dequeue_style( 'wd-header-cart-side' );
wp_dequeue_style( 'wd-header-my-account' );
wp_dequeue_style( 'wd-wd-search-cat' );
wp_dequeue_style( 'wd-wd-search-form' );
wp_dequeue_style( 'wd-wd-search-results' );
wp_dequeue_style( 'wd-header-search-form' );
wp_dequeue_style( 'wd-header-search' );
wp_dequeue_style( 'wd-header-elements-base' );
wp_dequeue_style( 'wd-mod-tools' );
wp_dequeue_style( 'wd-header-base' );
wp_dequeue_style( 'wd-woo-mod-shop-attributes' );
wp_dequeue_style( 'wd-woo-gutenberg' );
wp_dequeue_style( 'wd-woo-el-track-order' );
wp_dequeue_style( 'wd-mod-star-rating' );
wp_dequeue_style( 'wd-woocommerce-base' );
wp_dequeue_style( 'wd-elementor-pro-base' );
wp_dequeue_style( 'wd-elementor-base' );
wp_dequeue_style( 'wd-base-deprecated' );
wp_dequeue_style( 'wd-woo-wc-marketplace' );
wp_dequeue_style( 'wd-revolution-slider' );
wp_dequeue_style( 'wd-woo-curr-switch' );
wp_dequeue_style( 'wd-wpcf7' );
wp_dequeue_style( 'wd-wp-gutenberg' );
wp_dequeue_style( 'wd-widget-slider-price-filter' );
wp_dequeue_style( 'wd-widget-product-list' );
wp_dequeue_style( 'wd-widget-layered-nav-stock-status' );
wp_dequeue_style( 'wd-woo-mod-swatches-filter' );
wp_dequeue_style( 'wd-woo-mod-swatches-base' );
wp_dequeue_style( 'wd-widget-wd-layered-nav' );
wp_dequeue_style( 'wd-widget-nav' );
wp_dequeue_style( 'wd-widget-wd-recent-posts' );
wp_dequeue_style( 'wd-widget-recent-post-comments' );
wp_dequeue_style( 'woodmart-style' );
wp_deregister_style( 'woodmart-style' );
}
}
MarketPlace Theme #
// dequeue some script
add_action('init', function() {
if (isset($_SERVER['REQUEST_URI']) && strpos($_SERVER['REQUEST_URI'], 'dashboard') !== false && is_user_logged_in()) {
remove_action( 'wp_enqueue_scripts', 'organic_market_woocommerce_scripts' );
}
});
In order to work this code, you need to have set the dashboard name as “dashboard”.
Astra Theme #
Use the below CSS for fixing the issue on vendor store page.
.tax-dc_vendor_shop .ast-container {
display: block !important;
}
Leave a Reply
You must be logged in to post a comment.