Hello
Please,I need help , when a client add review her full name appears, how can add and change this how add username field when client register and when add review
Please,I need help , when a client add review her full name appears, how can add and change this how add username field when client register and when add review
Do you have that username field already created?
Opencart Developer - My Extension Showcase
Contact me at aeon.yoda@gmail.com
If you look at the DB table for reviews you will see author. All OC is doing is pre-filling the customer name when they are signed in.
Really, if review is your only concern, then you should be able to easily allow a customer to specify the review name without touching the controller or adding additional DB columns.
For the default theme -
catalog/view/theme/default/template/product/product.twig
Find
Replace
You can add a new language definition in place of {{ entry_name }} or put a note that the name used will be shown publicly.
Backup, untested, try at your own risk.
If the above doesn't work then another option would be to just show the first name and first letter of the last name. (e.g John Doe, would become John D.).
You would need to do this from the controller, which is separate code.
Really, if review is your only concern, then you should be able to easily allow a customer to specify the review name without touching the controller or adding additional DB columns.
For the default theme -
catalog/view/theme/default/template/product/product.twig
Find
Code: Select all
<label class="control-label" for="input-name">{{ entry_name }}</label>
<input type="text" name="name" value="{{ customer_name }}" id="input-name" class="form-control" />
Code: Select all
<label class="control-label" for="input-name">{{ entry_name }}</label>
<input type="text" name="name" id="input-name" class="form-control" />
Backup, untested, try at your own risk.
If the above doesn't work then another option would be to just show the first name and first letter of the last name. (e.g John Doe, would become John D.).
You would need to do this from the controller, which is separate code.
Backup and learn how to recover before you make any changes!
Thanks a lot for useful information provided, best wishessw!tch wrote: ↑Sat May 19, 2018 3:03 amIf you look at the DB table for reviews you will see author. All OC is doing is pre-filling the customer name when they are signed in.
Really, if review is your only concern, then you should be able to easily allow a customer to specify the review name without touching the controller or adding additional DB columns.
For the default theme -
catalog/view/theme/default/template/product/product.twig
FindReplaceCode: Select all
<label class="control-label" for="input-name">{{ entry_name }}</label> <input type="text" name="name" value="{{ customer_name }}" id="input-name" class="form-control" />
You can add a new language definition in place of {{ entry_name }} or put a note that the name used will be shown publicly.Code: Select all
<label class="control-label" for="input-name">{{ entry_name }}</label> <input type="text" name="name" id="input-name" class="form-control" />
Backup, untested, try at your own risk.
If the above doesn't work then another option would be to just show the first name and first letter of the last name. (e.g John Doe, would become John D.).
You would need to do this from the controller, which is separate code.
Who is online
Users browsing this forum: Google [Bot] and 15 guests