Since you're using a custom theme, any URL you could provide?
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
In catalog/controller/information/contact.php file,
find:
add above:
Then, find:
add above:
In catalog/language/<your_language_code>/information/contact.php file,
at the bottom of the file, add:
In catalog/view/theme/<your_theme>/template/information/contact.tpl file,
find:
add below:
Clear all caches from the admin. This should clarify the issue.
find:
Code: Select all
if ((utf8_strlen($this->request->post['enquiry']) < 10) || (utf8_strlen($this->request->post['enquiry']) > 3000)) {
Code: Select all
if (!empty($this->request->post['phone'])) {
if (!preg_match('/^[0-9-+]$/', $this->request->post['phone']) || strlen(trim($this->request->post['phone'])) < 10) {
$this->error['phone'] = $this->language->get('error_phone');
}
}
Code: Select all
if (isset($this->error['enquiry'])) {
Code: Select all
if (isset($this->error['phone'])) {
$data['error_phone'] = $this->error['phone'];
} else {
$data['error_phone'] = '';
}
at the bottom of the file, add:
Code: Select all
$_['error_phone'] = 'Please provide a valid phone number!';
find:
Code: Select all
<div class="form-group required">
<label class="col-sm-2 control-label" for="input-enquiry">{{ entry_enquiry }}</label>
<div class="col-sm-10">
<textarea name="enquiry" rows="10" id="input-enquiry" class="form-control">{{ enquiry }}</textarea>
{% if error_enquiry %}
<div class="text-danger">{{ error_enquiry }}</div>
{% endif %}
</div>
</div>
Code: Select all
<div class="form-group required">
<label class="col-sm-2 control-label" for="input-phone">{{ entry_phone }}</label>
<div class="col-sm-10">
<textarea name="phone" rows="10" id="input-phone" class="form-control">{{ phone }}</textarea>
{% if error_phone %}
<div class="text-danger">{{ error_phone }}</div>
{% endif %}
</div>
</div>
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
You are posting your request in the v3.x releases of Opencart and your error message mentions a TPL file.
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
Well, the above mentioned Solution will not function, as long as OC v.3 Code is
part of a contact.tpl file:
catalog/view/theme/<your_theme>/template/information/contact.tpl file
---
But it can be done, and probably easier, by use of an Extension like this:
Phone in Form free, OC v.2.0.0.0 - 2.1.0.2:
https://www.opencart.com/index.php?rout ... n_id=27735
it possibly just has to be rewritten a little, to make it work in later OC-2 Versions as well. Just try it!
---
Another Solution for such:
X-Form paid, OC v.2.0.x - 3.0.2.x:
https://www.opencart.com/index.php?rout ... n_id=23081
found here:
https://www.opencart.com/index.php?rout ... earch=Form
---
For OC v.1.5.6.x, a nice free Extension exists, to keep User-Contact-Infos in the Admin Section,
but it requires additional Code in several Front Side and Back Side Pages, to make the Phone
Number work, as shown on the image below. Just to mention this ...
Ernie
---
Opencart Contact form to DB free, OC v.1.5.x - 1.5.6.5_rc:
https://www.opencart.com/index.php?rout ... n_id=17495
---
part of a contact.tpl file:
catalog/view/theme/<your_theme>/template/information/contact.tpl file
Code: Select all
<{% if error_enquiry %}
<div class="text-danger">{{ error_enquiry }}</div>
But it can be done, and probably easier, by use of an Extension like this:
Phone in Form free, OC v.2.0.0.0 - 2.1.0.2:
https://www.opencart.com/index.php?rout ... n_id=27735
it possibly just has to be rewritten a little, to make it work in later OC-2 Versions as well. Just try it!
---
Another Solution for such:
X-Form paid, OC v.2.0.x - 3.0.2.x:
https://www.opencart.com/index.php?rout ... n_id=23081
found here:
https://www.opencart.com/index.php?rout ... earch=Form
---
For OC v.1.5.6.x, a nice free Extension exists, to keep User-Contact-Infos in the Admin Section,
but it requires additional Code in several Front Side and Back Side Pages, to make the Phone
Number work, as shown on the image below. Just to mention this ...
Ernie
---
Opencart Contact form to DB free, OC v.1.5.x - 1.5.6.5_rc:
https://www.opencart.com/index.php?rout ... n_id=17495
---
My Github OC Site: https://github.com/IP-CAM
5'200 + FREE OC Extensions, on the World's largest private Github OC Repository Archive Site.
Who is online
Users browsing this forum: No registered users and 421 guests