Product Review Helpfulness

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
4 years ago
Hi,

I think that javascript in _ProductReviewHelpfulness may be optimize to avoid code repetition


bye
4 years ago
What exactly code is duplicated? Please clarify

https://github.com/nopSolutions/nopCommerce/blob/2db68aaed43dfdfccbeb3dab33a8eb8cd85a5a8d/src/Presentation/Nop.Web/Views/Product/_ProductReviewHelpfulness.cshtml
4 years ago
Hi,

for each review you have a function like

function setProductReviewHelpfulness@(Model.ProductReviewId)(wasHelpful){
}

I think it's possibile write only one function like:

function setProductReviewHelpfulness(reviewId,wasHelpful){
}

with Model.ProductReviewId like a parameter
4 years ago
Hi,

I do something like this: in _ProductReviewHelpfulness.cshtml

<span onclick="setProductReviewHelpfulness(@Model.ProductReviewId, true);">


in ProductReview.cshtml only one definition

function setProductReviewHelpfulness(reviewId,wasHelpful) {
                    $.ajax({
                        cache: false,
                        type: "POST",

.....
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.