• Resolved streamworksaudio

    (@streamworksaudio)


    I am looking for a way to dequeue Dokan Lite’s select2 CSS styles.

    WooCommerce already has it’s styles for select2 elements and my theme adds to (and overwrites) the WooCommerce select2 styles.

    But in some spots the Dokan Lite plugin is overwriting our theme’s select2 styles – for example on the Edit Address page the Dokan styles are applied to the select2 elements, but on the checkout (billing) form our theme’s styles are applied.

    While on Dokan Dashboard pages (for example the edit product page) the styles are a mix of Dokan’s style and our theme’s.

    I would like to dequeue Dokan’s select2 styles and just have my theme (and WooCommerce) apply styles.

    I see that the function ‘register_all_scripts’ on the assets.php is what is used to load the styles, but I cannot figure out how to filter which styles are loaded.

    Cheers

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Support Jahidul Hassan Mojumder

    (@jahidulhassan)

    Hi @streamworksaudio

    To dequeue the style for select2 elements enqueued by Dokan, you can add the below-mentioned code in your child theme’s functions.php file.

    function dequeue_dokan_select2_stylesheet(){
        wp_deregister_style( 'dokan-select2-css' ); //Name of Style ID wihtout css.
    }
    add_action( 'wp_enqueue_scripts', 'dequeue_dokan_select2_stylesheet', 999 );

    I hope this helps. Thanks!

    Thread Starter streamworksaudio

    (@streamworksaudio)

    Thanks @jahidulhassan

    That does remove the styles, however it appears that on the Dokan dashboard then only load my theme’s select2 styles and not WooCommerce’s (need both WooCommerce and my theme’s).

    Need to find a way to remove the Dokan select2 styles from just certain pages (i.e WooCommmerce pages).

    Thread Starter streamworksaudio

    (@streamworksaudio)

    This is working for the WooCommerce account page…

    add_action('wp_enqueue_scripts',function(){
    	if ( is_account_page() ) :
    	wp_deregister_style( 'dokan-select2-css' );
    	endif;
    });

    Perhaps there is a function that checks to see if the user is on the Dokan Dashboard? If so then I can load the dokan select2 styles on the dashboard page only.

    Cheers

    Shafinoid

    (@shafinahmad01)

    Hello @streamworksaudio

    Thank you for reaching us.

    I have checked the codebase and as per my knowledge, I am unable to find any functions that can meet your requirements completely. I believe you will need to perform customizations on the codebase to achieve your requirements.

    Moreover, I am resolving this topic as the query is being satisfied. Feel free to create another one anytime.

    Best Regards!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Dequeue Select2 styles’ is closed to new replies.