Post by scottyboyyy » Wed Jul 18, 2018 6:40 pm

2.3.0.2

Hi there,

I am trying to get the customer ID (The customer who left the review) onto review.tpl.

Currently review.tpl pulls data including the author, date and rating from the review table (which also contains the customer ID value).

It comes from the controller product.php: $this->model_catalog_review->getReviewsByProductId(...).

getReviewsByProductId(...), currently selects all values from the review table other than customer_id ... simply adding ", r.customer_id," doesn't work for me. I just get undefined index. Can someone tell me what I'm doing wrong ???

Thanks!

Active Member

Posts

Joined
Fri Apr 07, 2017 2:36 am

Post by straightlight » Wed Jul 18, 2018 9:13 pm

That is correct. Since we do not display the customer's profile information from the store-front end other than the actual customer profile's page where the current customer is being logged in, it is not an issue but rather for confidentiality reasons.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by scottyboyyy » Wed Jul 18, 2018 9:20 pm

straightlight wrote:
Wed Jul 18, 2018 9:13 pm
That is correct. Since we do not display the customer's profile information from the store-front end other than the actual customer profile's page where the current customer is being logged in, it is not an issue but rather for confidentiality reasons.
Thanks for the reply straightlight !

I see it no more of a confidentiality issue than publishing the authors name unless of course there is a security issue. Is there a security reason why the customer_id is kept / should be kept hidden for confidentiality reasons?

Is this value not possible to retrieve through the getReviewsByProductId function? Is something stopping it? Or is it retrievable and I'm just not doing it properly - what way would I go about doing this?

Any help would be appreciated!

Active Member

Posts

Joined
Fri Apr 07, 2017 2:36 am

Post by straightlight » Wed Jul 18, 2018 9:28 pm

It is retrievable and you are not doing it properly.
Is there a security reason why the customer_id is kept / should be kept hidden for confidentiality reasons?
Of course. The customer profile's information would also allow to display all confidential information which may be against the customer's consent while the author's name is simply showing the name of the poster as it does not refer to any profiles.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by scottyboyyy » Wed Jul 18, 2018 9:50 pm

straightlight wrote:
Wed Jul 18, 2018 9:28 pm
It is retrievable and you are not doing it properly.
Is there a security reason why the customer_id is kept / should be kept hidden for confidentiality reasons?
Of course. The customer profile's information would also allow to display all confidential information which may be against the customer's consent while the author's name is simply showing the name of the poster as it does not refer to any profiles.
I am confused? Does retrieving the customer ID from the review table (review_id, customer_id, rating, text, date, status and author) allow access to all the customer's profile information? I am a beginner to this.

This is what I am doing on the tpl: <?php echo $review['customer_id']; ?>

In the controller product.php:

foreach ($results as $result) {
$data['reviews'][] = array(
'customer_id' => $result['customer_id'],

And the model review.php in function getReviewsByProductId

$query = $this->db->query("SELECT r.review_id, r.customer_id,

Could you tell me where I am going wrong?

Thanks again!

Active Member

Posts

Joined
Fri Apr 07, 2017 2:36 am

Post by scottyboyyy » Fri Jul 20, 2018 1:18 am

Anyone know?

Active Member

Posts

Joined
Fri Apr 07, 2017 2:36 am
Who is online

Users browsing this forum: Google [Bot] and 136 guests