Skip to content

Instantly share code, notes, and snippets.

@kreamweb
Last active May 16, 2023 20:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kreamweb/1411d2025e90bf2fef89ff8979f4a98b to your computer and use it in GitHub Desktop.
Save kreamweb/1411d2025e90bf2fef89ff8979f4a98b to your computer and use it in GitHub Desktop.
**YITH Point of Sale for WooCommerce** Hide cash in hand to cashiers
<?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 );
}
}
}
@Jbrizue
Copy link

Jbrizue commented May 16, 2023

You don't have a code to hide the buttons, add surcharge or fee and apply coupon from the frontend of this same plugin.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment