Jump to content

Remove first and last name from Commerce Support Tickets


Recommended Posts

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!

Link to comment
Share on other sites

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:

image.png.e114c5025b35edc832b92eab1c512ee6.png

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 by IPCommerceFan
Link to comment
Share on other sites

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:

image.png.e114c5025b35edc832b92eab1c512ee6.png

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.

Link to comment
Share on other sites

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:

image.png.fd2cc326fc9b89553592fa2065c62501.pngimage.png.9fbcabf8ddc8ddec56213d7a5bc10a4f.png

//<?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:

image.png.9b0439115d81292114c84ddccb84a63a.pngimage.png.d1459420f44adcab9ee4c549f7eec8e7.png

//<?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:

image.png.75f14669c8c429bba77bd5f2023a8e53.png

I'm no developer, but I'm open to feedback in case you want this plugin to do something else.  

Hope it helps!

Link to comment
Share on other sites

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:

image.png.fd2cc326fc9b89553592fa2065c62501.pngimage.png.9fbcabf8ddc8ddec56213d7a5bc10a4f.png


//<?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:

image.png.9b0439115d81292114c84ddccb84a63a.pngimage.png.d1459420f44adcab9ee4c549f7eec8e7.png


//<?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:

image.png.75f14669c8c429bba77bd5f2023a8e53.png

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 :smile:

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...