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 | |
/** | |
* WooCommerce price adjustment for WPUF | |
* | |
* @param int $post_id | |
* | |
* @return void | |
*/ | |
function wpufe_update_post_price( $post_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
add_action( 'woocommerce_before_customer_login_form', 'before_login_message' ); | |
function before_login_message() { | |
if ( get_option( 'woocommerce_enable_myaccount_registration' ) == 'yes' ) { | |
?> | |
<div class="woocommerce-info"> | |
<p><?php _e( 'Returning customers login. New users register for next time so you can:' ); ?></p> | |
<ul> | |
<li><?php _e( 'View your order history' ); ?></li> | |
<li><?php _e( 'Check on your orders' ); ?></li> | |
<li><?php _e( 'Edit your addresses' ); ?></li> |
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
/*Extra field on the seller settings and show the value on the store banner -Dokan*/ | |
// Add extra field in seller settings | |
add_filter( 'dokan_settings_form_bottom', 'extra_fields', 10, 2); | |
function extra_fields( $current_user, $profile_info ){ | |
$seller_url= isset( $profile_info['seller_url'] ) ? $profile_info['seller_url'] : ''; | |
?> | |
<div class="gregcustom dokan-form-group"> |
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 Seller name on the product thumbnail | |
For Dokan Multivendor plugin | |
*/ | |
add_action( 'woocommerce_after_shop_loop_item_title','sold_by' ); | |
function sold_by(){ | |
?> | |
</a> | |
<?php |
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
/* global shipping for each seller into the seller profile */ | |
add_action( 'show_user_profile', 'my_show_extra_profile_fields' ); | |
add_action( 'edit_user_profile', 'my_show_extra_profile_fields' ); | |
function my_show_extra_profile_fields( $user ) { | |
$country_obj = new WC_Countries(); | |
$countries = $country_obj->countries; | |
$states = $country_obj->states; |
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_registration_redirect', 'ps_wc_registration_redirect'); | |
function ps_wc_registration_redirect( $redirect_to ) { | |
if ( is_user_logged_in() ){ | |
$current_user = wp_get_current_user(); | |
if( $current_user->roles[0] == 'seller' ) { | |
$redirect_to = dokan_get_navigation_url( 'dashboard' ); | |
return $redirect_to; | |
} | |
} | |
return $redirect_to; |
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
// First Register the Tab by hooking into the 'woocommerce_product_data_tabs' filter | |
add_filter( 'woocommerce_product_data_tabs', 'add_my_custom_product_data_tab' ); | |
function add_my_custom_product_data_tab( $product_data_tabs ) { | |
$product_data_tabs['my-custom-tab'] = array( | |
'label' => __( 'My Custom Tab', 'my_text_domain' ), | |
'target' => 'my_custom_product_data', | |
); | |
return $product_data_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
add_action( 'wpuf_add_post_after_insert', function( $post_id ) { | |
wp_set_post_terms( $post_id, get_post_meta( $post_id, 'wpuf_hidden_cat', true ), 'your taxonomies name' ); | |
}); |
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
function remove_wc_password_meter() { | |
wp_dequeue_script( 'wc-password-strength-meter' ); | |
} | |
add_action( 'wp_print_scripts', 'remove_wc_password_meter', 100 ); |
OlderNewer