Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for vendor reviews #7297

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

nirzaf
Copy link

@nirzaf nirzaf commented Aug 13, 2024

Fixes #7244

Add support for vendor reviews, both written about a vendor and aggregated from product reviews.

  • VendorReview Class: Add VendorReview class in src/Libraries/Nop.Core/Domain/Vendors/VendorReview.cs to handle vendor reviews with properties for VendorId, CustomerId, Rating, ReviewText, IsApproved, and CreatedOnUtc.
  • Vendor Class: Update Vendor class in src/Libraries/Nop.Core/Domain/Vendors/Vendor.cs to include a list of VendorReview and a method to calculate the average rating from the reviews.
  • VendorController: Update VendorController in src/Presentation/Nop.Web/Areas/Admin/Controllers/VendorController.cs to handle vendor reviews.
    • Add actions to handle vendor reviews, such as VendorReviewsSelect, VendorReviewAdd, and VendorReviewDelete.
    • Update the Edit action to include vendor reviews in the model.
  • Caching: Add VendorReviewCacheEventConsumer class in src/Libraries/Nop.Services/Catalog/Caching/VendorReviewCacheEventConsumer.cs to handle caching for vendor reviews.

Fixes nopSolutions#7244

Add support for vendor reviews, both written about a vendor and aggregated from product reviews.

* **VendorReview Class**: Add `VendorReview` class in `src/Libraries/Nop.Core/Domain/Vendors/VendorReview.cs` to handle vendor reviews with properties for `VendorId`, `CustomerId`, `Rating`, `ReviewText`, `IsApproved`, and `CreatedOnUtc`.
* **Vendor Class**: Update `Vendor` class in `src/Libraries/Nop.Core/Domain/Vendors/Vendor.cs` to include a list of `VendorReview` and a method to calculate the average rating from the reviews.
* **VendorController**: Update `VendorController` in `src/Presentation/Nop.Web/Areas/Admin/Controllers/VendorController.cs` to handle vendor reviews.
  - Add actions to handle vendor reviews, such as `VendorReviewsSelect`, `VendorReviewAdd`, and `VendorReviewDelete`.
  - Update the `Edit` action to include vendor reviews in the model.
* **Caching**: Add `VendorReviewCacheEventConsumer` class in `src/Libraries/Nop.Services/Catalog/Caching/VendorReviewCacheEventConsumer.cs` to handle caching for vendor reviews.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Vendor reviews
2 participants