Ernie
---
Field E-mail to Form Review and Admin Search Filter OC v.2.0.1.1 - 2.3.0.2:
https://www.opencart.com/index.php?rout ... n_id=23586
---
Anti Spam Reviews OC v.1.5.4 - 2.3.0.2:
https://www.opencart.com/index.php?rout ... n_id=12651
---
found here:
https://www.opencart.com/index.php?rout ... rch=review
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.
Also, Whenever you create any question on community forum kindly mention OC version so that active people on this forum can help you better.
Thanks.
Well, you're using a paid Journal Theme, as you mentioned in an earlier Topic, anddon't have enough budget kindly guide me
I'm not eager to look into paid extensions, regardless of, how they were aquired.
Sorry and good Luck!
Ernie
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.
You need to edit the following files to make it happen -
1) catalog\view\theme\default\template\product\review.tpl
2) catalog\controller\product\product.php
3) catalog\model\catalog\product.php
Also, you need to create a new column in mysql review table.
Thanks.
Hope you can code yourself based on other fields.
Hi,synapseindia wrote: ↑Wed Jun 20, 2018 2:17 pmHi ,
You need to edit the following files to make it happen -
1) catalog\view\theme\default\template\product\review.tpl
2) catalog\controller\product\product.php
3) catalog\model\catalog\product.php
Also, you need to create a new column in mysql review table.
Thanks.
Hope you can code yourself based on other fields.
not only this files you should edit...
I have this extension, but not yet placed on Marketplace, if interesting for something you can PM me.
Cheers
Custom OpenCart modules and solutions. You can write PM with additional questions... Extensions you can find here
I have a good understanding of PHP and familiar with the OpenCart framework.
Followed can be coded with OCMod / VQMod based on your preferences.mehwishmalik wrote: ↑Wed Jun 20, 2018 2:47 pmHey thanx can u guide me with coding? and what about language folder?
In admin/controller/catalog/review.php file,
find:
Code: Select all
'rating' => $result['rating'],
Code: Select all
'email' => html_entity_decode($result['email'], ENT_QUOTES, 'UTF-8'),
Code: Select all
$data['sort_rating'] = $this->url->link('catalog/review', 'user_token=' . $this->session->data['user_token'] . '&sort=r.rating' . $url);
Code: Select all
$data['sort_email'] = $this->url->link('catalog/review', 'user_token=' . $this->session->data['user_token'] . '&sort=r.email' . $url);
Code: Select all
if (isset($this->request->get['filter_author'])) {
$url .= '&filter_author=' . urlencode(html_entity_decode($this->request->get['filter_author'], ENT_QUOTES, 'UTF-8'));
}
Code: Select all
$data['entry_email'] = $this->language->get('entry_email');
$data['column_email'] = $this->language->get('column_email');
if (isset($this->request->get['filter_email'])) {
$url .= '&filter_email=' . urlencode(html_entity_decode($this->request->get['filter_email'], ENT_QUOTES, 'UTF-8'));
}
Code: Select all
if (isset($this->request->get['filter_author'])) {
$filter_author = $this->request->get['filter_author'];
} else {
$filter_author = '';
}
Code: Select all
if (isset($this->request->get['filter_email'])) {
$filter_email = $this->request->get['filter_email'];
} else {
$filter_email = '';
}
Code: Select all
'filter_author' => $filter_author,
Code: Select all
'filter_email' => $filter_email,
Code: Select all
$data['filter_author'] = $filter_author;
Code: Select all
$data['filter_email'] = $filter_email;
Code: Select all
if (isset($this->error['rating'])) {
$data['error_rating'] = $this->error['rating'];
} else {
$data['error_rating'] = '';
}
Code: Select all
if (isset($this->error['email'])) {
$data['error_email'] = $this->error['email'];
} else {
$data['error_email'] = '';
}
Code: Select all
if (isset($this->request->post['rating'])) {
$data['rating'] = $this->request->post['rating'];
} elseif (!empty($review_info)) {
$data['rating'] = $review_info['rating'];
} else {
$data['rating'] = '';
}
Code: Select all
if (isset($this->request->post['email'])) {
$data['email'] = $this->request->post['email'];
} elseif (!empty($review_info)) {
$data['email'] = $review_info['email'];
} else {
$data['email'] = '';
}
Code: Select all
if ((utf8_strlen($this->request->post['author']) < 3) || (utf8_strlen($this->request->post['author']) > 64)) {
$this->error['author'] = $this->language->get('error_author');
}
Code: Select all
if ((!isset($this->request->post['email'])) || (isset($this->request->post['email']) && !filter_var($this->request->post['email'], FILTER_VALIDATE_EMAIL))) {
$this->error['email'] = $this->language->get('error_email');
}
add at the bottom:
Code: Select all
$_['column_email'] = 'Email';
$_['entry_email'] = 'Email';
$_['error_email'] = 'E-Mail Address does not appear to be valid!';
find all instances of:
Code: Select all
rating = '" . (int)$data['rating'] . "',
Code: Select all
rating = '" . (int)$data['rating'] . "', `email` = '" . $this->db->escape($data['email'']) . "',
Code: Select all
r.rating,
Code: Select all
r.rating, `r`.`email`,
Code: Select all
'r.rating',
Code: Select all
'r.email',
find:
Code: Select all
<div class="form-group row required">
<label class="col-sm-2 col-form-label" for="input-author"><?php echo $entry_author; ?></label>
<div class="col-sm-10">
<input type="text" name="author" value="<?php echo $author; ?>" placeholder="<?php echo $entry_author; ?>" id="input-author" class="form-control"/>
<?php if ($error_author) { ?>
<div class="invalid-tooltip"><?php echo $error_author; ?></div>
<?php } ?></div>
</div>
Code: Select all
<div class="form-group row required">
<label class="col-sm-2 col-form-label" for="input-email"><?php echo $entry_email; ?></label>
<div class="col-sm-10">
<input type="text" name="email" value="<?php echo $email; ?>" placeholder="<?php echo $entry_email; ?>" id="input-email" class="form-control"/>
<?php if ($error_email) { ?>
<div class="invalid-tooltip"><?php echo $error_email; ?></div>
<?php } ?></div>
</div>
Code: Select all
<div class="form-group row required">
<label class="col-sm-2 col-form-label" for="input-author"><?php echo $entry_author; ?></label>
<div class="col-sm-10">
<input type="text" name="author" value="<?php echo $author; ?>" placeholder="<?php echo $entry_author; ?>" id="input-author" class="form-control"/>
<?php if ($error_author) { ?>
<div class="invalid-tooltip"><?php echo $error_author; ?></div>
<?php } ?></div>
</div>
Code: Select all
<div class="form-group row required">
<label class="col-sm-2 col-form-label" for="input-email"><?php echo $entry_email; ?></label>
<div class="col-sm-10">
<input type="text" name="email" value="<?php echo $email; ?>" placeholder="<?php echo $entry_email; ?>" id="input-email" class="form-control"/>
<?php if ($error_email) { ?>
<div class="invalid-tooltip"><?php echo $error_email; ?></div>
<?php } ?></div>
</div>
Code: Select all
<td class="text-left"><?php if ($sort == 'r.author') { ?> <a href="<?php echo $sort_author; ?>" class="<?php echo strtolower($order); ?>"><?php echo $column_author; ?></a> <?php } else { ?> <a href="<?php echo $sort_author; ?>"><?php echo $column_author; ?></a> <?php } ?></td>
Code: Select all
<td class="text-left"><?php if ($sort == 'r.email') { ?> <a href="<?php echo $sort_email; ?>" class="<?php echo strtolower($order); ?>"><?php echo $column_email; ?></a> <?php } else { ?> <a href="<?php echo $sort_email; ?>"><?php echo $column_email; ?></a> <?php } ?></td>
Code: Select all
<td class="text-left"><?php echo $review['author']; ?></td>
Code: Select all
<td class="text-left"><?php echo $review['email']; ?></td>
Code: Select all
<td class="text-center" colspan="X">
Then, find:
Code: Select all
var filter_author = $('input[name=\'filter_author\']').val();
if (filter_author) {
url += '&filter_author=' + encodeURIComponent(filter_author);
}
Code: Select all
var filter_email = $('input[name=\'filter_email\']').val();
if (filter_email) {
url += '&filter_email=' + encodeURIComponent(filter_email);
}
find:
Code: Select all
$data['reviews'] = array();
Code: Select all
$data['entry_email'] = $this->language->get('entry_email');
Code: Select all
'author' => $result['author'],
Code: Select all
'email' => html_entity_decode($result['email'], ENT_QUOTES, 'UTF-8'),
Code: Select all
if ((utf8_strlen($this->request->post['name']) < 3) || (utf8_strlen($this->request->post['name']) > 25)) {
$json['error'] = $this->language->get('error_name');
}
Code: Select all
if ((!isset($this->request->post['email'])) || (isset($this->request->post['email']) && !filter_var($this->request->post['email'], FILTER_VALIDATE_EMAIL))) {
$json['error'] = $this->language->get('error_email');
}
add at the bottom:
Code: Select all
$_['entry_email'] = 'Email';
$_['error_email'] = 'E-Mail Address does not appear to be valid!';
find:
Code: Select all
rating = '" . (int)$data['rating'] . "',
Code: Select all
rating = '" . (int)$data['rating'] . "', `email` = '" . $this->db->escape($data['email']) . "',
Code: Select all
$message .= sprintf($this->language->get('text_reviewer'), html_entity_decode($data['name'], ENT_QUOTES, 'UTF-8')) . "\n";
Code: Select all
$message .= sprintf($this->language->get('text_email'), html_entity_decode($data['email'], ENT_QUOTES, 'UTF-8')) . "\n";
Code: Select all
r.rating,
Code: Select all
r.rating, `r`.`email`,
add at the bottom:
Code: Select all
$_['text_email'] = 'Email: %s';
find something similar to (based on the default theme):
Code: Select all
<div class="col-sm-12">
<label class="col-form-label" for="input-name"><?php echo $entry_name; ?></label>
<input type="text" name="name" value="<?php echo $customer_name; ?>" id="input-name" class="form-control" />
</div>
Code: Select all
<div class="col-sm-12">
<label class="col-form-label" for="input-email"><?php echo $entry_email; ?></label>
<input type="text" email="email" value="<?php echo $customer_email; ?>" id="input-email" class="form-control" />
</div>
Lastly, in your PHPMyAdmin's product table on your OC database, execute the following query:
Code: Select all
ALTER TABLE `oc_review` ADD `email` VARCHAR 96 NOT NULL AFTER `author`;
This should resolved the issue.
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
straightlight wrote: ↑Fri Jun 22, 2018 11:36 pmI have a good understanding of PHP and familiar with the OpenCart framework.Followed can be coded with OCMod / VQMod based on your preferences.mehwishmalik wrote: ↑Wed Jun 20, 2018 2:47 pmHey thanx can u guide me with coding? and what about language folder?
In admin/controller/catalog/review.php file,
find:
add right below:Code: Select all
'rating' => $result['rating'],
Then, find:Code: Select all
'email' => html_entity_decode($result['email'], ENT_QUOTES, 'UTF-8'),
add below:Code: Select all
$data['sort_rating'] = $this->url->link('catalog/review', 'user_token=' . $this->session->data['user_token'] . '&sort=r.rating' . $url);
Then, find all instances of:Code: Select all
$data['sort_email'] = $this->url->link('catalog/review', 'user_token=' . $this->session->data['user_token'] . '&sort=r.email' . $url);
add below all:Code: Select all
if (isset($this->request->get['filter_author'])) { $url .= '&filter_author=' . urlencode(html_entity_decode($this->request->get['filter_author'], ENT_QUOTES, 'UTF-8')); }
Then, find:Code: Select all
$data['entry_email'] = $this->language->get('entry_email'); $data['column_email'] = $this->language->get('column_email'); if (isset($this->request->get['filter_email'])) { $url .= '&filter_email=' . urlencode(html_entity_decode($this->request->get['filter_email'], ENT_QUOTES, 'UTF-8')); }
add below:Code: Select all
if (isset($this->request->get['filter_author'])) { $filter_author = $this->request->get['filter_author']; } else { $filter_author = ''; }
Then, find:Code: Select all
if (isset($this->request->get['filter_email'])) { $filter_email = $this->request->get['filter_email']; } else { $filter_email = ''; }
add right below:Code: Select all
'filter_author' => $filter_author,
Then, find:Code: Select all
'filter_email' => $filter_email,
add right below:Code: Select all
$data['filter_author'] = $filter_author;
Then, find:Code: Select all
$data['filter_email'] = $filter_email;
add below:Code: Select all
if (isset($this->error['rating'])) { $data['error_rating'] = $this->error['rating']; } else { $data['error_rating'] = ''; }
Then, find:Code: Select all
if (isset($this->error['email'])) { $data['error_email'] = $this->error['email']; } else { $data['error_email'] = ''; }
add below:Code: Select all
if (isset($this->request->post['rating'])) { $data['rating'] = $this->request->post['rating']; } elseif (!empty($review_info)) { $data['rating'] = $review_info['rating']; } else { $data['rating'] = ''; }
Then, find:Code: Select all
if (isset($this->request->post['email'])) { $data['email'] = $this->request->post['email']; } elseif (!empty($review_info)) { $data['email'] = $review_info['email']; } else { $data['email'] = ''; }
add below:Code: Select all
if ((utf8_strlen($this->request->post['author']) < 3) || (utf8_strlen($this->request->post['author']) > 64)) { $this->error['author'] = $this->language->get('error_author'); }
In admin/language/your_language/catalog/review.php file,Code: Select all
if ((!isset($this->request->post['email'])) || (isset($this->request->post['email']) && !filter_var($this->request->post['email'], FILTER_VALIDATE_EMAIL))) { $this->error['email'] = $this->language->get('error_email'); }
add at the bottom:
In admin/model/catalog/review.php file,Code: Select all
$_['column_email'] = 'Email'; $_['entry_email'] = 'Email'; $_['error_email'] = 'E-Mail Address does not appear to be valid!';
find all instances of:
replace all with:Code: Select all
rating = '" . (int)$data['rating'] . "',
Then, find:Code: Select all
rating = '" . (int)$data['rating'] . "', `email` = '" . $this->db->escape($data['email'']) . "',
replace with:Code: Select all
r.rating,
Then, find:Code: Select all
r.rating, `r`.`email`,
add right below:Code: Select all
'r.rating',
In admin/view/template/catalog/review_form.tpl file,Code: Select all
'r.email',
find:
add below:Code: Select all
<div class="form-group row required"> <label class="col-sm-2 col-form-label" for="input-author"><?php echo $entry_author; ?></label> <div class="col-sm-10"> <input type="text" name="author" value="<?php echo $author; ?>" placeholder="<?php echo $entry_author; ?>" id="input-author" class="form-control"/> <?php if ($error_author) { ?> <div class="invalid-tooltip"><?php echo $error_author; ?></div> <?php } ?></div> </div>
Then, find:Code: Select all
<div class="form-group row required"> <label class="col-sm-2 col-form-label" for="input-email"><?php echo $entry_email; ?></label> <div class="col-sm-10"> <input type="text" name="email" value="<?php echo $email; ?>" placeholder="<?php echo $entry_email; ?>" id="input-email" class="form-control"/> <?php if ($error_email) { ?> <div class="invalid-tooltip"><?php echo $error_email; ?></div> <?php } ?></div> </div>
add below:Code: Select all
<div class="form-group row required"> <label class="col-sm-2 col-form-label" for="input-author"><?php echo $entry_author; ?></label> <div class="col-sm-10"> <input type="text" name="author" value="<?php echo $author; ?>" placeholder="<?php echo $entry_author; ?>" id="input-author" class="form-control"/> <?php if ($error_author) { ?> <div class="invalid-tooltip"><?php echo $error_author; ?></div> <?php } ?></div> </div>
Then, find:Code: Select all
<div class="form-group row required"> <label class="col-sm-2 col-form-label" for="input-email"><?php echo $entry_email; ?></label> <div class="col-sm-10"> <input type="text" name="email" value="<?php echo $email; ?>" placeholder="<?php echo $entry_email; ?>" id="input-email" class="form-control"/> <?php if ($error_email) { ?> <div class="invalid-tooltip"><?php echo $error_email; ?></div> <?php } ?></div> </div>
add below:Code: Select all
<td class="text-left"><?php if ($sort == 'r.author') { ?> <a href="<?php echo $sort_author; ?>" class="<?php echo strtolower($order); ?>"><?php echo $column_author; ?></a> <?php } else { ?> <a href="<?php echo $sort_author; ?>"><?php echo $column_author; ?></a> <?php } ?></td>
Then, find:Code: Select all
<td class="text-left"><?php if ($sort == 'r.email') { ?> <a href="<?php echo $sort_email; ?>" class="<?php echo strtolower($order); ?>"><?php echo $column_email; ?></a> <?php } else { ?> <a href="<?php echo $sort_email; ?>"><?php echo $column_email; ?></a> <?php } ?></td>
add below:Code: Select all
<td class="text-left"><?php echo $review['author']; ?></td>
Then, find:Code: Select all
<td class="text-left"><?php echo $review['email']; ?></td>
Where X would be the current value that you see. Increment it to the next one.Code: Select all
<td class="text-center" colspan="X">
Then, find:
add below:Code: Select all
var filter_author = $('input[name=\'filter_author\']').val(); if (filter_author) { url += '&filter_author=' + encodeURIComponent(filter_author); }
In catalog/controller/product/product.php file,Code: Select all
var filter_email = $('input[name=\'filter_email\']').val(); if (filter_email) { url += '&filter_email=' + encodeURIComponent(filter_email); }
find:
add below:Code: Select all
$data['reviews'] = array();
Then, find:Code: Select all
$data['entry_email'] = $this->language->get('entry_email');
add below:Code: Select all
'author' => $result['author'],
Then, find:Code: Select all
'email' => html_entity_decode($result['email'], ENT_QUOTES, 'UTF-8'),
add below:Code: Select all
if ((utf8_strlen($this->request->post['name']) < 3) || (utf8_strlen($this->request->post['name']) > 25)) { $json['error'] = $this->language->get('error_name'); }
In catalog/language/your_language/product/product.php file,Code: Select all
if ((!isset($this->request->post['email'])) || (isset($this->request->post['email']) && !filter_var($this->request->post['email'], FILTER_VALIDATE_EMAIL))) { $json['error'] = $this->language->get('error_email'); }
add at the bottom:
In catalog/model/catalog/review.php file,Code: Select all
$_['entry_email'] = 'Email'; $_['error_email'] = 'E-Mail Address does not appear to be valid!';
find:
replace with:Code: Select all
rating = '" . (int)$data['rating'] . "',
Then, find:Code: Select all
rating = '" . (int)$data['rating'] . "', `email` = '" . $this->db->escape($data['email']) . "',
add below:Code: Select all
$message .= sprintf($this->language->get('text_reviewer'), html_entity_decode($data['name'], ENT_QUOTES, 'UTF-8')) . "\n";
Then, find:Code: Select all
$message .= sprintf($this->language->get('text_email'), html_entity_decode($data['email'], ENT_QUOTES, 'UTF-8')) . "\n";
replace with:Code: Select all
r.rating,
In catalog/language/your_language/mail/review.php file,Code: Select all
r.rating, `r`.`email`,
add at the bottom:
In catalog/view/theme/<your_theme>/template/product/product.tpl file,Code: Select all
$_['text_email'] = 'Email: %s';
find something similar to (based on the default theme):
add right below:Code: Select all
<div class="col-sm-12"> <label class="col-form-label" for="input-name"><?php echo $entry_name; ?></label> <input type="text" name="name" value="<?php echo $customer_name; ?>" id="input-name" class="form-control" /> </div>
and fit it as most as you can with your custom theme.Code: Select all
<div class="col-sm-12"> <label class="col-form-label" for="input-email"><?php echo $entry_email; ?></label> <input type="text" email="email" value="<?php echo $customer_email; ?>" id="input-email" class="form-control" /> </div>
Lastly, in your PHPMyAdmin's product table on your OC database, execute the following query:
Note: Replace the: oc_ database table prefix name to the one you're using (if using a different prefix name).Code: Select all
ALTER TABLE `oc_review` ADD `email` VARCHAR 96 NOT NULL AFTER `author`;
This should resolved the issue.
Hi thax for your reply kindly see attachment (undefined error)
Attachments
undefine.png (55.14 KiB) Viewed 1700 times
Users browsing this forum: No registered users and 6 guests