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 "http://schema.org/Review" for comment product #1582

Closed
pineportal opened this issue Feb 27, 2019 · 1 comment
Closed

Add "http://schema.org/Review" for comment product #1582

pineportal opened this issue Feb 27, 2019 · 1 comment
Assignees
Milestone

Comments

@pineportal
Copy link

@pineportal pineportal commented Feb 27, 2019

<div itemprop=”review” itemscope itemtype=”http://schema.org/Review”> Review:
<span itemprop=”reviewRating” itemscope itemtype=”http://schema.org/Rating”>

<span itemprop=”ratingValue”>5</span></span>

<b><span itemprop=”name”>Rating Title</span></b> by
<span itemprop=”author” itemscope itemtype=”http://schema.org/Person”>

<span itemprop=”name”>Person Name who is giving review</span></span>, written on

<meta itemprop=”datePublished” content=”2006-05-04″>Date

<div itemprop=”reviewBody”>Person review</div>

<span itemprop=”publisher” itemscope itemtype=”http://schema.org/Organization”>

<meta itemprop=”name” content=”Organization Name”>

</span>

</div>
@pineportal
Copy link
Author

@pineportal pineportal commented Feb 27, 2019

Product.Reviews.cshtml

<div class="review-list text-body" id="review-list">
		@for (var i = 0; i < Model.Items.Count; i++)
		{
			var review = Model.Items[i];
			int ratingPercent = review.Rating * 20;
			var helpfulness = review.Helpfulness;
			<div class="review-item" id="review-item-@(i + 1)" itemprop="review" itemscope itemtype="http://schema.org/Review">
				<div class="review-title">
					<div class="rating" itemprop="reviewRating" itemscope itemtype="http://schema.org/Rating">
						@* Hidden microdata info *@
						@{decimal ratingValue = ratingPercent / (decimal)20;}
						<div itemprop="ratingValue" content='@ratingValue.ToString("0.0", new CultureInfo("en-US"))' style="width: @(ratingPercent)%"></div>
					</div>
					<h4 itemprop="name">@review.Title</h4>
				</div>

				<div class="review-meta">
					<span itemprop="author" itemscope itemtype="http://schema.org/Person" class="review-meta-label pr-1">@T("Reviews.From"):</span>
					@if (review.AllowViewingProfiles)
					{
						<a class="review-meta-value" itemprop="name" href="@Url.RouteUrl("CustomerProfile", new { id = review.CustomerId })" rel="nofollow" dir="auto">@(review.CustomerName)</a>
					}
					else
					{
						<span class="review-meta-value" itemprop="name">@review.CustomerName</span>
					}

					<span class="review-meta-label pr-1">@T("Common.Date"):</span>
					<span class="review-meta-value" itemprop="datePublished" content="@review.WrittenOnStr">@review.WrittenOnStr</span>
				</div>

				<p class="review-text" dir="auto" itemprop="reviewBody">
					@Html.Raw(SmartStore.Core.Html.HtmlUtils.FormatText(review.ReviewText, false, true, false, false, false, false))
				</p>

				<div class="review-vote d-flex" data-review-id="@(helpfulness.ProductReviewId)" data-href='@(Url.Action("SetReviewHelpfulness"))'>
					<span class="review-vote-label pr-2">@T("Reviews.Helpfulness.WasHelpful?")</span>
					<a class="review-vote-link review-vote-link-yes mr-1" href="#" title="@T("Common.Yes")" data-toggle="tooltip" rel="nofollow">
						<i class="fa fa-thumbs-up"></i>
						<span class="review-vote-count" data-bind-to="TotalYes"><strong style="font-size:12px">@(helpfulness.HelpfulYesTotal)</strong></span>
					</a>
					<a class="review-vote-link review-vote-link-no mr-1" href="#" title="@T("Common.No")" data-toggle="tooltip" rel="nofollow">
						<i class="fa fa-thumbs-down"></i>
						<span class="review-vote-count" data-bind-to="TotalNo"><strong style="font-size:12px">@(helpfulness.HelpfulNoTotal)</strong></span>
					</a>
				</div>

				@{ Html.RenderWidget("productreviews_page_inside_review"); }
			</div>
		}
	</div>

@Michael-Herzog Michael-Herzog self-assigned this Feb 28, 2019
@Michael-Herzog Michael-Herzog added this to the 3.2 milestone Feb 28, 2019
@muratcakir muratcakir changed the title add http://schema.org/Review for comment product Add "http://schema.org/Review" for comment product Feb 28, 2019
@Michael-Herzog Michael-Herzog removed this from the 3.2 milestone May 8, 2019
@Michael-Herzog Michael-Herzog added this to the 3.2.1 milestone May 8, 2019
@Michael-Herzog Michael-Herzog removed this from the 3.2.1 milestone May 27, 2019
@Michael-Herzog Michael-Herzog added this to the 3.2.2 milestone May 27, 2019
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

No branches or pull requests

2 participants