Skip to content

Instantly share code, notes, and snippets.

View rashedripon's full-sized avatar

Rashed Ripon rashedripon

View GitHub Profile
@rashedripon
rashedripon / functions.php
Last active December 29, 2019 22:07
Dokan Vendor Dashboard Navigation Customization
<?php
/**
* The filter you want to use is dokan_get_dashboard_nav() / dokan_get_dashboard_settings_nav()
* Place these codes under your themes functions.php
*/
/**
* Remove a menu link from vendor dashboard
* @param array $urls
@rashedripon
rashedripon / functions.php
Created December 29, 2019 22:20
Remove Dokan vendor information from cart and checkout page
<?php
// Remove the default Dokan Vendor name from cart or checkout page
remove_filter( 'woocommerce_get_item_data', 'dokan_product_seller_info', 10 );
@rashedripon
rashedripon / functions.php
Created December 29, 2019 22:23
Remove tabs under Dokan Vendor Dashboard > Booking
<?php
//Remove resources tab under Vendor Dashboard > Booking menu
add_filter('dokan_booking_nav_titles', function ($bookings) {
unset($bookings['resources']);
return $bookings;
});
@rashedripon
rashedripon / functions.php
Created December 29, 2019 22:29
Remove Dokan Gelocation map from shop page
<?php
//Remove Geolocation map from shop page with the help of a Dokan function
dokan_remove_hook_for_anonymous_class( 'woocommerce_before_shop_loop', 'Dokan_Geolocation_Product_View', 'before_shop_loop', 10 );
@rashedripon
rashedripon / functions.php
Created December 29, 2019 22:31
Remove progressbar from vendor dashboard
<?php
//Remove progressbar from vendor dashboard
if(class_exists('Dokan_Pro_Dashboard')) {
remove_action( 'dokan_dashboard_before_widgets', array( Dokan_Pro_Dashboard::init(), 'show_profile_progressbar' ), 10 );
}
if(class_exists('Dokan_Pro_Settings')) {
remove_action( 'dokan_settings_load_ajax_response', array( Dokan_Pro_Settings::init(), 'render_pro_settings_load_progressbar' ), 25 );
}
@rashedripon
rashedripon / functions.php
Created December 29, 2019 22:32
Remove shipping, tax & attributes from vendor product edit page
<?php
//Remove shipping, tax & attributes from product edit page
if(class_exists('Dokan_Pro_Products')) {
remove_action( 'dokan_product_edit_after_inventory_variants', array( Dokan_Pro_Products::init(), 'load_shipping_tax_content' ), 10, 2 );
remove_action( 'dokan_product_edit_after_inventory_variants', array( Dokan_Pro_Products::init(), 'load_variations_content' ), 20, 2 );
}
@rashedripon
rashedripon / functions.php
Created December 29, 2019 22:35
Remove "Become a vendor" button from customers account
<?php
// Remove "Become a vendor" button from customers account
if(class_exists('Dokan_Pro')) {
remove_action( 'woocommerce_after_my_account', array( Dokan_Pro::init(), 'dokan_account_migration_button' ) );
}
@rashedripon
rashedripon / functions.php
Last active February 7, 2022 08:03
Dokan store open-close in single product page
<?php
//Remove the <?php while using it in your theme's functions.php file
//Add store open-show information before single product add-to-cart button
add_action('woocommerce_before_add_to_cart_form', 'dokan_open_close', 1000);
function dokan_open_close() {
global $product;
@rashedripon
rashedripon / functions.php
Last active July 1, 2020 04:23
Add store open/close notice on Dokan vendor's order page
add_action('dokan_order_content_inside_before', function() {
$seller_id = dokan_get_current_user_id();
var_dump($seller_id);
global $wp;
$current_url = home_url();
$store_settings_page = $current_url . "/dashboard/settings/store";
@rashedripon
rashedripon / store.php
Created July 15, 2020 13:59
Hide products when Dokan store is closed by adding store open checker in store.php file
<?php
/**
* The Template for displaying all single posts.
*
* @package dokan
* @package dokan - 2014 1.0
*/
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly