Skip to content

Instantly share code, notes, and snippets.

View J-H-Mojumder's full-sized avatar
💻
Learning

Md Jahidul Hassan Mojumder J-H-Mojumder

💻
Learning
  • Dhaka, Bangladesh
View GitHub Profile
@J-H-Mojumder
J-H-Mojumder / functions.php
Last active September 19, 2023 07:35
Add a custom message for the enabled sellers on the vendor dashboard in Dokan
<?php
//Add a new message for the enabled sellers on the vendor dashboard
function add_message_for_active_vendors(){
dokan_remove_hook_for_anonymous_class( 'dokan_dashboard_content_inside_before', 'WeDevs\Dokan\Dashboard\Templates\Dashboard', 'show_seller_dashboard_notice', 10 );
function show_custom_seller_dashboard_notice(){
$user_id = get_current_user_id();
if ( ! dokan_is_seller_enabled( $user_id ) ) {
@J-H-Mojumder
J-H-Mojumder / functions.php
Created June 9, 2022 11:17
Control number of products to be shown on the single store page's featured section
<?php
add_filter( 'dokan_featured_product_section_item_count' , 'control_featured_section_of_single_store' );
function control_featured_section_of_single_store ($columns){
$columns = 4; //enter your desired number of products
return $columns;
}
@J-H-Mojumder
J-H-Mojumder / functions.php
Created May 13, 2022 10:18
Remove Dokan menus from the my account page.
<?php
add_filter ( 'woocommerce_account_menu_items', 'remove_links_from_my_account_page' );
unset($menu_links["support-tickets"]);
unset($menu_links["bookings"]);
unset($menu_links["following"]);
return $menu_links;
}
@J-H-Mojumder
J-H-Mojumder / functions.php
Created May 13, 2022 06:39
Apply CSS on seller setup wizard.
<?php
CSS in seller setup wizard
function hide_email_from_seller_setup_wizard() {
?>
<style>
/* Add your own CSS here within the <style> tag*/
.dokan-seller-setup-form table tr:last-child{
display: none !important;
}
@J-H-Mojumder
J-H-Mojumder / functions.php
Created May 13, 2022 06:36
Remove steps from the seller setup wizard.
<?php
#-- Remove seller setup wizard step --#
function seller_setup_wizard_steps($steps){
/*
To remove your required step follow the below mentioned array values
To remove introduction $steps['introduction'];
To remove store info $steps['store'];
@J-H-Mojumder
J-H-Mojumder / functions.php
Created May 13, 2022 05:55
Change the position of the vendor dashboard menus
<?php
add_filter( 'dokan_get_dashboard_nav', 'move_the_booking_tab_up', 13 );
function move_the_booking_tab_up( $urls ) {
/*Urls of the menus
Dashboard ['dashboard']['pos']
Dashboard ['products']['pos']
Dashboard ['orders']['pos']
@J-H-Mojumder
J-H-Mojumder / functions.php
Created May 13, 2022 04:14
Add custom Shipping tracking provider
<?php
add_filter( 'dokan_shipping_status_tracking_providers_list', 'add_shipping_tracking_provider' );
function add_shipping_tracking_provider( $providers ){
$providers['sp-your-custom-name'] = array( //use a custom name instead of sp-your-custom-name as your wish
'label' => __( 'Your custom one', 'dokan' ), //This text will be shown in the backend and frontend
'url' => '',
@J-H-Mojumder
J-H-Mojumder / functions.php
Created May 13, 2022 03:54
Change column number of the single store page.
<?php
function single_store_page_product_columns( $columns ){
if( dokan_is_store_page() ){
return $columns = 4; //enter your desired number
} else {
return $columns;
}
}
add_filter( 'loop_shop_columns', 'single_store_page_product_columns', 99);
@J-H-Mojumder
J-H-Mojumder / functions.php
Created May 13, 2022 03:52
Remove tabs from the single store page.
<?php
//You can use the below-mentioned code to remove any tab from the single store page of Dokan. Just keep the line of unset()
//that you need as per your requirement
add_filter( 'dokan_store_tabs', 'remove_product_tab', 14);
function remove_product_tab( $tabs) {
//unset($tabs['products']); //For removing the product tab
unset($tabs['terms_and_conditions']); //For removing the terms and conditions tab
@J-H-Mojumder
J-H-Mojumder / functions.php
Created May 13, 2022 03:42
Show only one shipping fee in case of multivendor checkout
<?php
//Show only one shipping fee in case of multivendor checkout
remove_filter( 'woocommerce_cart_shipping_packages', 'dokan_custom_split_shipping_packages' );
remove_filter( 'woocommerce_shipping_package_name', 'dokan_change_shipping_pack_name');
remove_action( 'woocommerce_checkout_create_order_shipping_item', 'dokan_add_shipping_pack_meta');`
?>