This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Plugin Name: Dokan Vendor Biography Shortcode | |
*/ | |
add_shortcode( 'dokan_vendor_bio', 'dokan_vendor_bio_shortcode' ); | |
function dokan_vendor_bio_shortcode() { | |
$vendor = dokan()->vendor->get( get_query_var( 'author' ) ); | |
$store_info = $vendor->get_shop_info(); | |
if ( empty( $store_info['vendor_biography'] ) ) { | |
return; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_action( 'before_delete_post', function( $id ) { | |
$product = wc_get_product( $id ); | |
if ( ! $product ) { | |
return; | |
} | |
$all_product_ids = []; | |
$product_thum_id_holder = []; | |
$gallery_image_id_holder = []; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_filter( 'woocommerce_product_tabs', 'woo_reorder_tabs', 98 ); | |
function woo_reorder_tabs( $tabs ) { | |
$tabs['reviews']['priority'] = 5; // Reviews first | |
$tabs['description']['priority'] = 10; // Description second | |
$tabs['additional_information']['priority'] = 15; // Additional information third | |
return $tabs; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*Show store name on single product*/ | |
add_action( 'woocommerce_single_product_summary', 'seller_name_on_single', 12 ); | |
function seller_name_on_single(){ | |
global $product; | |
$seller = get_post_field( 'post_author', $product->get_id()); | |
$author = get_user_by( 'id', $seller ); | |
$vendor = dokan()->vendor->get( $seller ); | |
$store_info = dokan_get_store_info( $author->ID ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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 ) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class Dokan_Setup_Wizard_Override extends Dokan_Seller_Setup_Wizard { | |
/** | |
* Introduction step. | |
*/ | |
public function dokan_setup_introduction() { | |
$dashboard_url = dokan_get_navigation_url(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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>'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Dokan Dashboard Template | |
* | |
* Dokan Main Dahsboard template for Fron-end | |
* | |
* @since 2.4 | |
* | |
* @package dokan | |
*/ |