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 | |
$userID = 2; | |
$args = array( 'author' => $userID, 'post_type' => 'product', 'posts_per_page' => -1, 'post_status' => array( 'publish', 'pending', 'draft', 'future' ) ); | |
$the_query = new WP_Query( $args ); | |
// The Loop | |
if ( $the_query->have_posts() ) { | |
while ( $the_query->have_posts() ) { | |
$the_query->the_post(); | |
wp_delete_post( get_the_ID(), true ); |
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
/** | |
* Dokan product page downloadable and virtual force always checked | |
*/ | |
function dokan_product_page_downloadable_virtual_checkbox_force_checked() { | |
if ( is_user_logged_in() && function_exists( 'dokan_is_seller_dashboard' ) && dokan_is_seller_dashboard() ) { | |
?> | |
<script> | |
(function($) { | |
var Dokan_Product_Virtual_Download_Checkbox_Customized = { | |
init: function() { |
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
remove_action( 'woocommerce_register_form', 'dokan_seller_reg_form_fields' ); | |
add_action( 'woocommerce_register_form', 'dokan_custom_reg_vendor_selected', 12 ); | |
function dokan_custom_reg_vendor_selected() { | |
$postdata = wc_clean( $_POST ); // WPCS: CSRF ok, input var ok. | |
$role = isset( $postdata['role'] ) ? $postdata['role'] : 'seller'; | |
$role_style = ( $role == 'customer' ) ? 'display:none' : ''; | |
dokan_get_template_part( 'global/seller-registration-form', '', array( | |
'postdata' => $postdata, | |
'role' => $role, |
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
#-- Modify the number of products column of the single store page --# | |
function single_store_page_product_columns($columns){ | |
if(dokan_is_store_page()){ | |
return $columns = 4; | |
} else { | |
return $columns; | |
} | |
} | |
add_filter( 'loop_shop_columns', 'single_store_page_product_columns'); |
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 | |
function dokan_store_listing_orderby_ramdom_filter( $seller_args ) { | |
$seller_args['orderby'] = 'dokan_store_rand'; | |
return $seller_args; | |
} | |
add_filter( 'dokan_seller_listing_args', 'dokan_store_listing_orderby_ramdom_filter', 99 ); | |
function dokan_store_listing_orderby_filter_query( $query ) { | |
if ( $query->query_vars['orderby'] === 'dokan_store_rand' ) { | |
$order_by = [ |
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
/** | |
* Hide shipping rates when free shipping is available. | |
* | |
* @param array $rates Array of rates found for the package. | |
* @return array | |
*/ | |
function dokan_vendor_shipping_hide_when_free_is_available( $rates ) { | |
$free = array(); | |
foreach ( $rates as $rate_id => $rate ) { |
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
/* Store notice field seller settings */ | |
add_filter( 'dokan_settings_form_bottom', 'extra_fields', 10, 2); | |
function extra_fields( $current_user, $profile_info ){ | |
$booth_news= get_user_meta( $current_user, 'booth_news', true ); | |
?> | |
<div class="gregcustom dokan-form-group"> | |
<label class="dokan-w3 dokan-control-label" for="setting_address"> | |
<?php _e( 'Store Notice', 'dokan' ); ?> | |
</label> |
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
//showing avatar on my-account page | |
function showing_custom_avatar(){ | |
$current_user = wp_get_current_user(); | |
echo'<div class="myaccount_custom">'.get_avatar($current_user->user_email,72,'',$current_user->display_name). '</div>'; | |
} |
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
You may need to do custom code to show your custom order status on the frontend in both order list and order details.php. | |
When you will add new order Status for WooCommerce you need to use the same filter to ADD NEW CASE to show and save the | |
order status when someone updates the order and to send order status changes through order-notes on the frontend. | |
Kindly use the below hooks to get it done. | |
dokan_get_order_status_translated & dokan_get_order_status_class | |
Kindly open dokan-lite/templates/orders/listing.php and check this filter- dokan_bulk_order_statuses which should help you. |
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','remove_wc_tab',12); | |
function remove_wc_tab($tabs){ | |
unset($tabs['reviews']); //removing review tab | |
unset($tabs['additional_information']); //removing additional info tab | |
return $tabs; | |
} |
NewerOlder