Skip to content

Instantly share code, notes, and snippets.

View nayemDevs's full-sized avatar

Md. Nazmul Hassan nayemDevs

View GitHub Profile
@nayemDevs
nayemDevs / Category loader
Created January 24, 2017 04:35
Load category in ajax
add_action( 'wp_ajax_dokan_fetch_product_child_category', 'dokan_fetch_product_child_category' );
function dokan_fetch_product_child_category() {
if ( ! isset( $_REQUEST['_wpnonce'] ) || ! wp_verify_nonce( $_REQUEST['_wpnonce'], 'marketica-child-theme-nonce' ) ) {
wp_send_json_error( __( 'Nonce Verfication faild', 'dokan' ) );
}
$category_id = ( isset( $_POST['category'] ) && ! empty( $_POST['category'] ) ) ? $_POST['category'] : '';
if ( empty( $category_id ) ) {
@nayemDevs
nayemDevs / Dashboard menu
Last active January 31, 2019 20:18
Add a new seller dashboard menu
<?php
add_filter( 'dokan_query_var_filter', 'dokan_load_document_menu' );
function dokan_load_document_menu( $query_vars ) {
$query_vars['document'] = 'document';
return $query_vars;
}
add_filter( 'dokan_get_dashboard_nav', 'dokan_add_document_menu' );
function dokan_add_document_menu( $urls ) {
/*MIME TYPE*/
function wpufe_custom_upload_extensions( $extensions ) {
$extensions['custom'] = array(
'label' => __( 'Custom Extensions', 'wpuf' ),
'ext' => 'eps,ai',
);
return $extensions;
}
@nayemDevs
nayemDevs / new-menu.php
Last active December 4, 2023 15:46
Adding extra dashboard menu for Vendor Dashboard ( this code need to be inserted on your theme's functions.php)
<?php
//copy from below line
add_filter( 'dokan_query_var_filter', 'dokan_load_document_menu' );
function dokan_load_document_menu( $query_vars ) {
$query_vars['help'] = 'help';
return $query_vars;
}
@nayemDevs
nayemDevs / help.php
Created October 11, 2017 04:10
Template file for the dashboard menu
<?php
/**
* Dokan Dashboard Template
*
* Dokan Main Dahsboard template for Fron-end
*
* @since 2.4
*
* @package dokan
*/
@nayemDevs
nayemDevs / functions.php
Last active September 14, 2019 08:40
adding sold by option on the single product page
add_action( 'woocommerce_single_product_summary', 'seller_name_on_single', 11 );
function seller_name_on_single(){
global $product;
$seller = get_post_field( 'post_author', $product->get_id());
$author = get_user_by( 'id', $seller );
$store_info = dokan_get_store_info( $author->ID );
if ( !empty( $store_info['store_name'] ) ) { ?>
<span class="details">
@nayemDevs
nayemDevs / functions.php
Last active January 31, 2019 20:18
icon missing
<?php
/*
- Missing icon fixing
- fontawesome v5
- Use the code from line number 7 to 12 on your child-theme functions.php
*/
add_filter ('dokan_get_dashboard_nav','change_icon',16);
function change_icon($urls){
$urls['reviews']['icon'] = '<i class="fas fa-comments"></i>';
$urls['reports']['icon'] = '<i class="fas fa-chart-line"></i>';
@nayemDevs
nayemDevs / functions.php
Last active August 29, 2023 08:29
Override seller setup-wizard via child-theme using Class
<?php
class Dokan_Setup_Wizard_Override extends Dokan_Seller_Setup_Wizard {
/**
* Introduction step.
*/
public function dokan_setup_introduction() {
$dashboard_url = dokan_get_navigation_url();
@nayemDevs
nayemDevs / functions.php
Last active April 11, 2023 19:19
Change Bank withdraw method fields in vendor dashboard settings in Dokan
<?php
/*
You can change any field title or remove any feild for the vendor -> settings -> payment -> bank transfer method. Please note that this
code need to be placed on your child-theme functions.php file
*/
add_filter( 'dokan_withdraw_methods', 'wp1923_change_whithdraw_callback', 12 );
function wp1923_change_whithdraw_callback( $methods ) {
@nayemDevs
nayemDevs / functions.php
Last active April 26, 2022 16:11
Show Store name on product thumbnail instead of vendor name
<?php
/*
Show Store name on the product thumbnail For Dokan Multivendor plugin
*/
add_action( 'woocommerce_after_shop_loop_item_title','sold_by' );
function sold_by(){
?>
</a>