Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- function woo_add_cart_fee() {
- global $woocommerce;
- $current_user = wp_get_current_user();
- if ( in_array( 'residential', $current_user->roles, true) ) {
- $woocommerce->cart->add_fee( __( 'Custom', 'woocommerce' ), 5 );
- }
- }
- add_action( 'woocommerce_cart_calculate_fees', 'woo_add_cart_fee' );
Add Comment
Please, Sign In to add comment