Closed bjarnef closed 3 years ago
@mattbrailsford maybe you have some initial thoughts on the DB structure?
As minimum I think we need:
A relation between product and review (in a relation table). Since Vendr use Umbraco nodes for products, it would have a entry with review id and Umbraco node id. Since variants later might use a new structure similar to the new block editor, it might change this structure. I think some ecommerce systems allow to add reviews for a specific variants other just use the main product. This could be used to add a content app on product node with reviews for the specific product.
A relation to customer. We can probably use customer reference here. This would make it possible to get reviews for a specific customer and enhance the member view (with content app?).
Some specific properties for the review like rating/score, date, name, email, description etc.
Maybe an initial, approved and declined state e.g. to configurate reviews not being auto approved. For example a dashboard to approve reviews.
Regarding the API we could have a ReviewService
or similar, e.g. IReviewService
to inject into the controller and a few different methods.
Some inspiration: https://csharp.hotexamples.com/examples/-/ReviewService/-/php-reviewservice-class-examples.html
GetProductReview(string productReference)
GetProductReviews(string customerReference)
AddProductReview(string productReference, string customerReference, decimal rating, string name, string description)
AddProductReview
could alternatively be named CreateProductReview
.
The reason for having rating/score as decimal
is that some might want allow half-star rating.
Some inspiration for review form on product page: https://ecommerce.aheadworks.com/magento-2-extensions/advanced-reviews
http://magento2ar.demo2.aheadworks.com/travel-laptop-backpack.html
There a lot of configurations for this, but for Vendr we could keep it simple, but maybe with a few configurations in Vendr settings?
Furthermore there is a dashboard with paged reviews. This could be useful and maybe a few filter options.
Furthermore there's a few bulk actions, e.g. to delete review(s) or change status of these.
Finally you can also click each review to edit this. In general you should modify reviews from customers, but it could contains words or similar you would need to remove to approve the review.
As star rating it would be great with a basic vanilla JS code (eventually a plugin). The star rating in backoffice could be readonly font/svg icons.
With SVG the same icons could probably be used as well in frontend (but developers can replace this with their own icons or plugin if they want).
It could include a example partial which could be used as a foundation.
A simple example with css, svg and vanilla JS: https://zellwk.com/blog/star-rating/
@mattbrailsford I guess we can close this for now and open separate issues on https://github.com/vendrcontrib/vendr-reviews/issues for future development πππ
It would be great to support product reviews in Vendr. However since not all sites/stores need this feature and some might implement their own solution or use a third party system, it would be great to have this as a separate add-on, e.g.
Vendr.ProductReviews
, similar toVendr.WishList
https://github.com/vendrhub/vendr/issues/94Some inspiration from Shopify: https://apps.shopify.com/product-reviews and nopCommerce https://docs.nopcommerce.com/en/running-your-store/catalog/products/product-reviews.html
Features