GTAPoliceMods Posted May 25, 2020 Posted May 25, 2020 Hi everyone, I want to give several of our staff members the ability to help our administrative team respond to support tickets. The only issue is I would not like the member's first and last name (if it was provided during checkout) to be displayed on the support ticket. Is there any way for us to disable a setting to remove the member's the name and show their username instead? Thank you!
GTAPoliceMods Posted May 25, 2020 Author Posted May 25, 2020 We also tried looking at CSS/HTML but no luck either.
IPCommerceFan Posted May 27, 2020 Posted May 27, 2020 (edited) There is no built-in switch for this. Could you provide a screenshot showing the exact areas where you see the first/last name? My feeling is this would likely be doable via a custom plugin. Possibly a switch that can be added to this group of admin restrictions: For the front end support module, this plugin would make it so the customer sees their display name instead of their first/last aka their "customer name": Change Commerce cm_name to name.xml Edited May 27, 2020 by IPCommerceFan GTAPoliceMods and Maxxius 1 1
GTAPoliceMods Posted May 27, 2020 Author Posted May 27, 2020 24 minutes ago, IPCommerceFan said: There is no built-in switch for this. Could you provide a screenshot showing the exact areas where you see the first/last name? My feeling is this would likely be doable via a custom plugin. Possibly a switch that can be added to this group of admin restrictions: For the front end support module, this plugin would make it so the customer sees their display name instead of their first/last aka their "customer name": Change Commerce cm_name to name.xml 1.54 kB · 0 downloads Appreciate the response! Will look into that plugin that you posted but what concerns me the most is the backend. This is what I mean https://prnt.sc/sofrek. By default it shows the username, but if they provided their first name and lastname during checkout then it will switch it to that instead. Main issue is that I want our moderators to view support tickets but not view their real name. Ill see if I can reach out to someone to make a custom plugin for something like this. IPCommerceFan 1
IPCommerceFan Posted May 27, 2020 Posted May 27, 2020 You're welcome! This piqued my interest, so I gave it a shot: AdminCP Commerce Display Name.xml It works as far as I can tell/tested, but this should do it! In case its of interest, heres what this plugin consists of: We hooked into \IPS\nexus\Support\Author\Member to change the name on the sidebar: //<?php /* To prevent PHP errors (extending class does not exist) revealing path */ if ( !\defined( '\IPS\SUITE_UNIQUE_KEY' ) ) { exit; } class hook479 extends _HOOK_CLASS_ { /** * Get name * * @return string */ public function name() { if( !\IPS\Member::loggedIn()->hasAcpRestriction( 'nexus', 'customers', 'customers_view_statistics' ) ) { return $this->customer->name; } else { return $this->customer->cm_name; } return parent::name(); } } and we hooked into \IPS\nexus\Customer to change the name on each reply: //<?php /* To prevent PHP errors (extending class does not exist) revealing path */ if ( !\defined( '\IPS\SUITE_UNIQUE_KEY' ) ) { exit; } class hook480 extends _HOOK_CLASS_ { /** * Get customer name * * @return string */ public function get_cm_name() { if( !\IPS\Member::loggedIn()->hasAcpRestriction( 'nexus', 'customers', 'customers_view_statistics' ) ) { return $this->name; } else { return ( $this->cm_first_name or $this->cm_last_name ) ? "{$this->cm_first_name} {$this->cm_last_name}" : $this->name; } return parent::get_cm_name(); } } In order to make full names display as their respective Display Name, just make sure the administrator you want to restrict has "Can view customer statistics?" disabled: I'm no developer, but I'm open to feedback in case you want this plugin to do something else. Hope it helps! Cyboman, Maxxius, CoffeeCake and 1 other 2 2
GTAPoliceMods Posted May 27, 2020 Author Posted May 27, 2020 2 hours ago, IPCommerceFan said: You're welcome! This piqued my interest, so I gave it a shot: AdminCP Commerce Display Name.xml It works as far as I can tell/tested, but this should do it! In case its of interest, heres what this plugin consists of: We hooked into \IPS\nexus\Support\Author\Member to change the name on the sidebar: //<?php /* To prevent PHP errors (extending class does not exist) revealing path */ if ( !\defined( '\IPS\SUITE_UNIQUE_KEY' ) ) { exit; } class hook479 extends _HOOK_CLASS_ { /** * Get name * * @return string */ public function name() { if( !\IPS\Member::loggedIn()->hasAcpRestriction( 'nexus', 'customers', 'customers_view_statistics' ) ) { return $this->customer->name; } else { return $this->customer->cm_name; } return parent::name(); } } and we hooked into \IPS\nexus\Customer to change the name on each reply: //<?php /* To prevent PHP errors (extending class does not exist) revealing path */ if ( !\defined( '\IPS\SUITE_UNIQUE_KEY' ) ) { exit; } class hook480 extends _HOOK_CLASS_ { /** * Get customer name * * @return string */ public function get_cm_name() { if( !\IPS\Member::loggedIn()->hasAcpRestriction( 'nexus', 'customers', 'customers_view_statistics' ) ) { return $this->name; } else { return ( $this->cm_first_name or $this->cm_last_name ) ? "{$this->cm_first_name} {$this->cm_last_name}" : $this->name; } return parent::get_cm_name(); } } In order to make full names display as their respective Display Name, just make sure the administrator you want to restrict has "Can view customer statistics?" disabled: I'm no developer, but I'm open to feedback in case you want this plugin to do something else. Hope it helps! This is exactly what we needed! Thank you very much for taking the time to develop this and even better sharing it to the entire community. We have gone ahead and implemented this and so far it works like a charm. Once again thank you so much IPCommerceFan and Maxxius 2
IPCommerceFan Posted May 27, 2020 Posted May 27, 2020 Glad I could help! Nice site btw, makes me feel like installing GTA5 again 😄 GTAPoliceMods 1
GTAPoliceMods Posted May 28, 2020 Author Posted May 28, 2020 On 5/27/2020 at 2:05 AM, IPCommerceFan said: Glad I could help! Nice site btw, makes me feel like installing GTA5 again 😄 You can never go wrong with a little GTA in life ;) Thanks again and stay safe! IPCommerceFan 1
Recommended Posts