beta 2.0 - "Be first to review..." is not checking "Allow anonymous users to write product reviews"

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
12 anni tempo fa
This is showing on product detail page
"Be the first to review this product"
when not logged in and Catalog Settings "Allow anonymous users to write product reviews" is not checked


This fixed it for me

Nop.Web.Controllers.catalogController

        public ActionResult ProductReviewOverview(int productId)
        ...
            var model = new ProductReviewOverviewModel()
            {
                ...
                AllowCustomerReviews = product.AllowCustomerReviews
                                        && (_workContext.CurrentCustomer.IsRegistered() || _catalogSettings.AllowAnonymousUsersToReviewProduct)
12 anni tempo fa
also looks like "Email a friend" button shows even when not logged in and "Allow anonymous users to email a friend:" unchecked
12 anni tempo fa
It should work this way. All stores work this way. "Be first to review..." should always be shown (if reviews are enabled). Guests should also be able to read other reviews.
12 anni tempo fa
Well, I'd have to disagree.  Not only because I'd think it would be odd to allow guest to do a First review but not a review  when a product has already been reviewed, but Nop seems to think so too...

A guest is able to write the review, but when it's submitted, this error message appears

"Only registered users can write reviews"
12 anni tempo fa
a.m. wrote:
Guests should also be able to read other reviews.

Yes, I missed that.  So my code fix is really not the right place to check, but as per prior post, I still don't think it makes sense to allow them to enter a review, only to be told that they can't when they submit it.
12 anni tempo fa
If your interested, I've made a few more changes to make this work the way I think it should (Guest can see reviews but does not see links or form to enter one, unless "Allow Anon..." is checked)

Basically added properties to the ProductReview... Models:

    public class ProductReviewOverviewModel : BaseNopModel
    {
    ...
        public bool ShowCustomerReviews { get; set; }  //!!! Added
        
        public bool AllowCustomerReviews { get; set; }
    }

    [Validator(typeof(ProductReviewsValidator))]
    public class ProductReviewsModel : BaseNopModel
    {
     ...
        public bool AllowCustomerReviews { get; set; } //!!! Added
    }

and a few minor code changes to CatalogController, ProductReviews.cshtml, and ProductReviewOverview.cshtml.
12 anni tempo fa
OK. Thanks for suggestion. I'll create a work item for this issue
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.