Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

Truncate Product Review to Only 1st Name

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions
 
Thread Tools Search this Thread
  #1  
Old 07-30-2021, 12:38 PM
 
keystone keystone is offline
 

X-Adept
  
Join Date: Jul 2006
Location: USA
Posts: 787
 

Default Truncate Product Review to Only 1st Name

Is there a way to make only the 1st name show on product review listings? As it stands right now both first and last name show up and sometimes middle initial if it was included on the customer order I'm guessing.

It looks like if a customer is not responding to an email request to review the purchase they can just enter whatever they want to show up on the "add review" page. If responding to the email I think it includes whatever name they had on the order.

I'm using the Advanced Customer Review module on x-cart version 4.7.11
__________________
www.uscandleco.com - X-Cart Version 4.7.11 Gold Plus php7.3
mods:
reCaptcha
running on UNIX

www.keystonecandle.com X-Cart Gold Plus - Version 4.7.11 php7.2
mods:
reCaptcha
cdseo pro
running on UNIX
Reply With Quote
  #2  
Old 07-30-2021, 10:29 PM
 
PhilJ PhilJ is offline
 

X-Guru
  
Join Date: Nov 2002
Posts: 4,094
 

Default Re: Truncate Product Review to Only 1st Name

/skin/common_files/modules/Advanced_Customer_Reviews/customer_review.tpl

Replace...
Code:
{$review.author|default:$lng.lbl_acr_guest}

With...
Code:
{$review.author|default:$lng.lbl_acr_guest|regex_replace:'/[^a-zA-Z0-9].*/':''}
That'll truncate the review author name after the first space character.
__________________
xcartmods.co.uk
Reply With Quote

The following user thanks PhilJ for this useful post:
peggyr (07-31-2021)
  #3  
Old 08-02-2021, 09:31 AM
 
keystone keystone is offline
 

X-Adept
  
Join Date: Jul 2006
Location: USA
Posts: 787
 

Default Re: Truncate Product Review to Only 1st Name

Perfect, thank you.
__________________
www.uscandleco.com - X-Cart Version 4.7.11 Gold Plus php7.3
mods:
reCaptcha
running on UNIX

www.keystonecandle.com X-Cart Gold Plus - Version 4.7.11 php7.2
mods:
reCaptcha
cdseo pro
running on UNIX
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 08:36 AM.

   

 
X-Cart forums © 2001-2020