This file contains 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('after_setup_theme', 'remove_admin_bar'); | |
function remove_admin_bar() { | |
if (!current_user_can('administrator') && !is_admin()) { | |
show_admin_bar(false); | |
} | |
} |
This file contains 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
// This changes the Product Commission to "Percentage". You can change it to Fixed or anything else. just edit the meta key value (wcv_commission_type) | |
// This also adds a checkbox in WooCommerce--> Product--> General. The Code to add the same checkbox to the front end form producty-edit.php (see below) | |
// NOTE: When Commission is set per product that value goes to the vendor. This is oposite when setting Commission in WC Vendors--> Settings | |
// WC Vendors--> Settings Commission set to 90 is the same as a vendors product set to 10. | |
function update_product_commission ($post_id) { | |
$wcv_percentage_to_pay = get_post_meta( $post_id, '_wcv_custom_product_percentage_to_vendor', true ); | |
$give_to_afs = isset( $_POST['give_product_commission'] ) ? 'yes' : 'no'; |