Last active
May 16, 2023 20:35
-
-
Save kreamweb/1411d2025e90bf2fef89ff8979f4a98b to your computer and use it in GitHub Desktop.
**YITH Point of Sale for WooCommerce** Hide cash in hand to cashiers
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 | |
if ( defined( 'YITH_POS_VERSION' ) && ! function_exists( 'yith_pos_add_user_role_to_pos_class' ) ) { | |
add_filter( 'yith_pos_body_classes', 'yith_pos_add_user_role_to_pos_class' ); | |
function yith_pos_add_user_role_to_pos_class( $body_class ) { | |
if ( is_user_logged_in() ) { | |
$user = wp_get_current_user(); | |
$body_class = array_merge( $body_class, (array) $user->roles ); | |
} | |
return $body_class; | |
} | |
if ( ! function_exists( 'yith_pos_customization_css' ) ) { | |
add_action( 'wp_enqueue_scripts', 'yith_pos_customization_css', 99 ); | |
function yith_pos_customization_css() { | |
$css = ".yith_pos_cashier .modal-wrap.modal-cash-in-hand, | |
.yith_pos_cashier .dropdown .dropdown-menu > div.dropdown-item.manage-cash { | |
display: none; | |
}"; | |
wp_add_inline_style( 'yith-pos-frontend', $css ); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You don't have a code to hide the buttons, add surcharge or fee and apply coupon from the frontend of this same plugin.