Review
Forum rules
Always add your Laravel, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
Always add your Laravel, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
Re: Review
You can add a decorator for the catalog detail HTML client that handles fetching and saving reviews in the detail page:
https://aimeos.org/docs/latest/frontend ... omponents/
You can't use the review frontend controller because it allows creating reviews only for logged in users:
https://github.com/aimeos/ai-controller ... andard.php
Instead, use the review manager directly to store new reviews:
- https://aimeos.org/docs/latest/models/managing-items/
- https://github.com/aimeos/aimeos-core/b ... andard.php
Please be aware that you will get a lot of fake reviews and vandalism if everyone can create reviews.
https://aimeos.org/docs/latest/frontend ... omponents/
You can't use the review frontend controller because it allows creating reviews only for logged in users:
https://github.com/aimeos/ai-controller ... andard.php
Instead, use the review manager directly to store new reviews:
- https://aimeos.org/docs/latest/models/managing-items/
- https://github.com/aimeos/aimeos-core/b ... andard.php
Please be aware that you will get a lot of fake reviews and vandalism if everyone can create reviews.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, give us a star
If you like Aimeos, give us a star
Re: Review
Hello sir
I try to create its working fine
i create with these data
$data = array();
$data['review.domain'] = 'product';
$data['review.refid'] = '252570';
$data['review.name'] = 'Pratik Sharma';
$data['review.comment'] = 'Good Product';
$data['review.rating'] = '5';
$data['review.status'] = '1';
without order product id and customer id
this review display in admin panel and also in frontend
the issue is that when i try to add 2nd review with same product id then its show duplicate entry error
I need to add multiple review with one product
error is:
SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '1.--product-252570' for key 'mshop_review.unq_msrev_sid_cid_dom_rid': INSERT INTO "mshop_review" ( "domain", "refid", "customerid", "ordprodid", "name", "comment", "response", "rating", "status", "mtime", "editor", "siteid", "ctime" ) VALUES ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? ) ["product","252570","","","Pratik Sharma","Good Product","",5,1,"2022-01-23 13:44:44","Admin","1.","2022-01-23 13:44:44"]
I try to create its working fine
i create with these data
$data = array();
$data['review.domain'] = 'product';
$data['review.refid'] = '252570';
$data['review.name'] = 'Pratik Sharma';
$data['review.comment'] = 'Good Product';
$data['review.rating'] = '5';
$data['review.status'] = '1';
without order product id and customer id
this review display in admin panel and also in frontend
the issue is that when i try to add 2nd review with same product id then its show duplicate entry error
I need to add multiple review with one product
error is:
SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '1.--product-252570' for key 'mshop_review.unq_msrev_sid_cid_dom_rid': INSERT INTO "mshop_review" ( "domain", "refid", "customerid", "ordprodid", "name", "comment", "response", "rating", "status", "mtime", "editor", "siteid", "ctime" ) VALUES ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? ) ["product","252570","","","Pratik Sharma","Good Product","",5,1,"2022-01-23 13:44:44","Admin","1.","2022-01-23 13:44:44"]
Re: Review
The customer ID is required and adding more than one review without will result in a duplicate error from the database.
We've changed that in the current development version and you can use that as reference for own changes:
https://github.com/aimeos/aimeos-core/c ... 24eaf13074
We've changed that in the current development version and you can use that as reference for own changes:
https://github.com/aimeos/aimeos-core/c ... 24eaf13074
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, give us a star
If you like Aimeos, give us a star
Re: Review
Hello sir
I want to add review by api without customer id and order product id.
but in review database table add a unique column "unq_msrev_sid_cid_dom_rid" which are duplicate because there are not customer id
and i want to create 2 review with a single product like
1.--product-252570
1.--product-252570
you create this string unique with siteid - customer id - domain - product id
here if i change directly in database for that unique column like
siteid - id - domain - product id
1.-1-product-252570
1.-2-product-252570
then its working, we can add multiple review with single product without customer id
I want to confirm, it is ok, if i change this column pattern , see attachment so here i change customer id to id, which will always unique
thanks
I want to add review by api without customer id and order product id.
but in review database table add a unique column "unq_msrev_sid_cid_dom_rid" which are duplicate because there are not customer id
and i want to create 2 review with a single product like
1.--product-252570
1.--product-252570
you create this string unique with siteid - customer id - domain - product id
here if i change directly in database for that unique column like
siteid - id - domain - product id
1.-1-product-252570
1.-2-product-252570
then its working, we can add multiple review with single product without customer id
I want to confirm, it is ok, if i change this column pattern , see attachment so here i change customer id to id, which will always unique
thanks
Re: Review
This change is better:
aimeos wrote: ↑24 Jan 2022, 14:29 We've changed that in the current development version and you can use that as reference for own changes:
https://github.com/aimeos/aimeos-core/c ... 24eaf13074
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, give us a star
If you like Aimeos, give us a star
Re: Review
Yes but in this case customer id null, and its show
Duplicate entry '1.--product-252570' for key 'mshop_review.unq_msrev_sid_cid_dom_rid'
duplicate error for unq_msrev_sid_cid_dom_rid column, i want to add multiple review with a single product
according to your change its create
1.--product-252570 for first review for product id 252570
1.--product-252570 for 2nd review for same product (here duplicate error)
so i ask to is it ok ? if i change in unq_msrev_sid_cid_dom_rid column customer id to review id , which will be always unique
and its not generate duplicate error.
Duplicate entry '1.--product-252570' for key 'mshop_review.unq_msrev_sid_cid_dom_rid'
duplicate error for unq_msrev_sid_cid_dom_rid column, i want to add multiple review with a single product
according to your change its create
1.--product-252570 for first review for product id 252570
1.--product-252570 for 2nd review for same product (here duplicate error)
so i ask to is it ok ? if i change in unq_msrev_sid_cid_dom_rid column customer id to review id , which will be always unique
and its not generate duplicate error.
Re: Review
If you insert NULL into a column covered by an unique constraint, it's possible to insert multiple records with NULL values. Guess, the problem in your setup is that empty values are used instead.
Instead of using the id column in the unique constraint, you should leave out the second column completely.
Instead of using the id column in the unique constraint, you should leave out the second column completely.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, give us a star
If you like Aimeos, give us a star