Skip to content

Commit

Permalink
fix(storefront): STRF-2456 Removing unnecessary Schema Org meta tags …
Browse files Browse the repository at this point in the history
…and moving some tags to the appropriate div
  • Loading branch information
David Payne committed May 16, 2018
1 parent 48c7a28 commit 148ec34
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 30 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
- Fix for excess whitespace in multiline text field product option [#1222](https://github.com/bigcommerce/cornerstone/pull/1222)
- Fix for faceted search display. [#1225](https://github.com/bigcommerce/cornerstone/pull/1225)
- Fix for calls with empty files in Safari. [#1210](https://github.com/bigcommerce/cornerstone/pull/1210)
- Fix product pricing schema.org microdata. [#1233](https://github.com/bigcommerce/cornerstone/pull/1233)

## 1.17.0 (2018-04-26)
- Fix empty object issue in app.js [#1204](https://github.com/bigcommerce/cornerstone/pull/1204)
Expand Down
22 changes: 12 additions & 10 deletions templates/components/products/price-range.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{{#and price_range.min.with_tax price_range.max.with_tax}}
<div class="price-section price-section--withTax" {{#if schema_org}}itemprop="offers" itemscope itemtype="http://schema.org/Offer"{{/if}}>
<div class="price-section price-section--withTax" >
<span data-product-price-with-tax class="price">{{price_range.min.with_tax.formatted}} - {{price_range.max.with_tax.formatted}}</span>
{{#and price_range.min.without_tax price_range.max.without_tax}}
<abbr title="{{lang 'products.excluding_tax'}}">{{lang 'products.price_with_tax' tax_label=price_range.min.tax_label}}</abbr>
Expand All @@ -17,20 +17,22 @@
</div>
{{/and}}
{{#and price_range.min.without_tax price_range.max.without_tax}}
<div class="price-section price-section--withoutTax {{#and price_range.min.with_tax price_range.max.with_tax}}price-section--minor{{/and}}" {{#if schema_org}}itemprop="offers" itemscope itemtype="http://schema.org/Offer"{{/if}}>
<div class="price-section price-section--withoutTax {{#and price_range.min.with_tax price_range.max.with_tax}}price-section--minor{{/and}}" >
<span data-product-price-without-tax class="price price--withoutTax">{{price_range.min.without_tax.formatted}} - {{price_range.max.without_tax.formatted}}</span>
{{#and price_range.min.with_tax price_range.max.with_tax}}
<abbr title="{{lang 'products.excluding_tax'}}">{{lang 'products.price_without_tax' tax_label=price_range.min.tax_label}}</abbr>
{{/and}}
{{#if schema_org}}
<meta itemprop="availability" content="{{product.availability}}">
<meta itemprop="itemCondition" itemtype="http://schema.org/OfferItemCondition" content="http://schema.org/{{product.condition}}Condition">
<div itemprop="priceSpecification" itemscope itemtype="http://schema.org/PriceSpecification">
<meta itemprop="minPrice" content="{{price_range.min.without_tax.value}}" />
<meta itemprop="price" content="{{price_range.min.without_tax.value}}">
<meta itemprop="maxPrice" content="{{price_range.max.without_tax.value}}" />
<meta itemprop="priceCurrency" content="{{currency_selector.active_currency_code}}">
<meta itemprop="valueAddedTaxIncluded" content="false">
<div itemprop="offers" itemscope itemtype="http://schema.org/Offer">
<meta itemprop="availability" content="{{product.availability}}">
<meta itemprop="itemCondition" itemtype="http://schema.org/OfferItemCondition" content="http://schema.org/{{product.condition}}Condition">
<div itemprop="priceSpecification" itemscope itemtype="http://schema.org/PriceSpecification">
<meta itemprop="minPrice" content="{{price_range.min.without_tax.value}}" />
<meta itemprop="price" content="{{price_range.min.without_tax.value}}">
<meta itemprop="maxPrice" content="{{price_range.max.without_tax.value}}" />
<meta itemprop="priceCurrency" content="{{currency_selector.active_currency_code}}">
<meta itemprop="valueAddedTaxIncluded" content="false">
</div>
</div>
{{/if}}
</div>
Expand Down
38 changes: 22 additions & 16 deletions templates/components/products/price.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
{{> components/products/price-range price_range=price.price_range schema_org=schema_org}}
{{else}}
{{#if price.with_tax}}
<div class="price-section price-section--withTax rrp-price--withTax" {{#if schema_org}}itemprop="offers" itemscope itemtype="http://schema.org/Offer"{{/if}}>
<div class="price-section price-section--withTax rrp-price--withTax" >
{{#if price.rrp_with_tax}}
{{lang 'products.retail_price'}}
<span data-product-rrp-with-tax class="price price--rrp"> {{price.rrp_with_tax.formatted}}</span>
{{/if}}
</div>
<div class="price-section price-section--withTax non-sale-price---withTax" {{#if schema_org}}itemprop="offers" itemscope itemtype="http://schema.org/Offer"{{/if}}>
<div class="price-section price-section--withTax non-sale-price---withTax" >
{{#if price.non_sale_price_with_tax}}
{{lang 'products.price_was'}}
<span data-product-non-sale-price-with-tax class="price price--rrp"> {{price.non_sale_price_with_tax.formatted}}</span>
Expand Down Expand Up @@ -36,18 +36,22 @@
</div>
{{/if}}
{{#if price.without_tax}}
<div class="price-section rrp-price--withoutTax price-section--withoutTax {{#if price.with_tax}}price-section--minor{{/if}}" {{#if schema_org}}itemprop="offers" itemscope itemtype="http://schema.org/Offer"{{/if}}>
{{#if price.rrp_without_tax}}
{{lang 'products.retail_price'}}
<span data-product-rrp-price-without-tax class="price price--rrp"> {{price.rrp_without_tax.formatted}}</span>
{{/if}}
</div>
<div class="price-section non-sale-price---withoutTax price-section--withoutTax {{#if price.with_tax}}price-section--minor{{/if}}" {{#if schema_org}}itemprop="offers" itemscope itemtype="http://schema.org/Offer"{{/if}}>
{{#if price.rrp_without_tax.formatted}}
<div class="price-section rrp-price--withoutTax price-section--withoutTax {{#if price.with_tax}}price-section--minor{{/if}}" >
{{#if price.rrp_without_tax}}
{{lang 'products.retail_price'}}
<span data-product-rrp-price-without-tax class="price price--rrp"> {{price.rrp_without_tax.formatted}}</span>
{{/if}}
</div>
{{/if}}
{{#if price.non_sale_price_without_tax.formatted}}
<div class="price-section non-sale-price---withoutTax price-section--withoutTax {{#if price.with_tax}}price-section--minor{{/if}}" >
{{#if price.non_sale_price_without_tax}}
{{lang 'products.price_was'}}
<span data-product-non-sale-price-without-tax class="price price--rrp"> {{price.non_sale_price_without_tax.formatted}}</span>
{{/if}}
</div>
{{/if}}
<div>
<span class="price-now-label">
{{#if price.non_sale_price_without_tax}}
Expand All @@ -56,13 +60,15 @@
</span>
<span data-product-price-without-tax class="price price--withoutTax"> {{price.without_tax.formatted}}</span>
{{#if schema_org}}
<meta itemprop="availability" itemtype="http://schema.org/ItemAvailability"
content="http://schema.org/{{#if product.pre_order}}PreOrder{{else if product.out_of_stock}}OutOfStock{{else if product.can_purchase '===' false}}OutOfStock{{else}}InStock{{/if}}">
<meta itemprop="itemCondition" itemtype="http://schema.org/OfferItemCondition" content="http://schema.org/{{product.condition}}Condition">
<div itemprop="priceSpecification" itemscope itemtype="http://schema.org/PriceSpecification">
<meta itemprop="price" content="{{price.without_tax.value}}">
<meta itemprop="priceCurrency" content="{{currency_selector.active_currency_code}}">
<meta itemprop="valueAddedTaxIncluded" content="false">
<div itemprop="offers" itemscope itemtype="http://schema.org/Offer">
<meta itemprop="availability" itemtype="http://schema.org/ItemAvailability"
content="http://schema.org/{{#if product.pre_order}}PreOrder{{else if product.out_of_stock}}OutOfStock{{else if product.can_purchase '===' false}}OutOfStock{{else}}InStock{{/if}}">
<meta itemprop="itemCondition" itemtype="http://schema.org/OfferItemCondition" content="http://schema.org/{{product.condition}}Condition">
<div itemprop="priceSpecification" itemscope itemtype="http://schema.org/PriceSpecification">
<meta itemprop="price" content="{{price.without_tax.value}}">
<meta itemprop="priceCurrency" content="{{currency_selector.active_currency_code}}">
<meta itemprop="valueAddedTaxIncluded" content="false">
</div>
</div>
{{/if}}
{{#if price.with_tax}}
Expand Down
11 changes: 7 additions & 4 deletions templates/components/products/product-view.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,11 @@
<section class="productView-details">
<div class="productView-product">
<h1 class="productView-title" {{#if schema}}itemprop="name"{{/if}}>{{product.title}}</h1>

<h2 class="productView-brand"{{#if schema}} itemprop="brand" itemscope itemtype="http://schema.org/Brand"{{/if}}>
<a href="{{product.brand.url}}"{{#if schema}} itemprop="url"{{/if}}><span{{#if schema}} itemprop="name"{{/if}}>{{product.brand.name}}</span></a>
</h2>
<!-- {{#if product.brand}} -->
<h2 class="productView-brand"{{#if schema}} itemprop="brand" itemscope itemtype="http://schema.org/Brand"{{/if}}>
<a href="{{product.brand.url}}"{{#if schema}} itemprop="url"{{/if}}><span{{#if schema}} itemprop="name"{{/if}}>{{product.brand.name}}</span></a>
</h2>
<!-- {{/if}} -->
{{#if product.call_for_price}}
<p class="productView-price">
<span>{{product.call_for_price}}</span>
Expand All @@ -28,6 +29,7 @@ <h2 class="productView-brand"{{#if schema}} itemprop="brand" itemscope itemtype=
{{/or}}
</div>
{{{region name="product_below_price"}}}
{{#if product.rating}}
<div class="productView-rating"{{#if schema}} itemprop="aggregateRating" itemscope itemtype="http://schema.org/AggregateRating"{{/if}}>
{{#if settings.show_product_rating}}
{{#if product.num_reviews '>' 0}}
Expand Down Expand Up @@ -58,6 +60,7 @@ <h2 class="productView-brand"{{#if schema}} itemprop="brand" itemscope itemtype=
{{> components/products/modals/writeReview}}
{{/if}}
</div>
{{/if}}
{{product.detail_messages}}
<dl class="productView-info">
{{#if product.sku}}
Expand Down

0 comments on commit 148ec34

Please sign in to comment.