Account Details page. * * Loaded automatically from woocow.php when WooCommerce is active. */ defined( 'ABSPATH' ) || exit; class WooCow_PW_Sync { public function __construct() { // Render the checkbox below the password fields add_action( 'woocommerce_edit_account_form', [ $this, 'render_checkbox' ] ); } public function render_checkbox(): void { // Only show if the current customer has mailcow assignments global $wpdb; $count = (int) $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(*) FROM {$wpdb->prefix}woocow_assignments WHERE customer_id = %d", get_current_user_id() ) ); if ( ! $count ) { return; } ?>