X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Dev Questions (https://forum.x-cart.com/forumdisplay.php?f=20)
-   -   Truncate Product Review to Only 1st Name (https://forum.x-cart.com/showthread.php?t=78280)

keystone 07-30-2021 12:38 PM

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

PhilJ 07-30-2021 10:29 PM

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.

keystone 08-02-2021 09:31 AM

Re: Truncate Product Review to Only 1st Name
 
Perfect, thank you.


All times are GMT -8. The time now is 05:22 PM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.