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

STENCIL-3527: Adding toggle for weight and dimensions on product pages. #1092

Merged
merged 1 commit into from
Oct 12, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
- Lazy load carousel images [#1090](https://github.com/bigcommerce/cornerstone/pull/1090)
- Theme Editor menu item updates for ease of use [#1091](https://github.com/bigcommerce/cornerstone/pull/1091)
- Upgrades all dependencies except for Foundation and jQuery [#1069](https://github.com/bigcommerce/cornerstone/pull/1069)
- Adds a theme editor display toggle for weight and dimensions on product pages [#1092](https://github.com/bigcommerce/cornerstone/pull/1092)

## 1.9.3 (2017-09-19)
- Fixes image overlapping details on product page and Quick View on small viewports [#1067](https://github.com/bigcommerce/cornerstone/pull/1067)
Expand Down
2 changes: 2 additions & 0 deletions config.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@
"show_accept_paypal": false,
"show_accept_visa": false,
"show_product_details_tabs": true,
"show_product_weight": true,
"show_product_dimensions": false,
"product_list_display_mode": "grid",
"logo-position": "center",
"logo_size": "250x100",
Expand Down
7 changes: 7 additions & 0 deletions lang/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -678,6 +678,13 @@
"including_tax": "Including Tax",
"excluding_tax": "Excluding Tax",
"weight": "Weight:",
"width": "Width:",
"height": "Height:",
"depth": "Depth:",
"measurement": {
"metric": "cm",
"imperial": "in"
},
"you_save": "(You save {amount})",
"gift_wrapping": "Gift wrapping:",
"gift_wrapping_available": "Options available",
Expand Down
12 changes: 12 additions & 0 deletions schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -1143,6 +1143,18 @@
"force_reload": true,
"id": "show_product_details_tabs"
},
{
"type": "checkbox",
"label": "Show product weight",
"force_reload": true,
"id": "show_product_weight"
},
{
"type": "checkbox",
"label": "Show product dimensions",
"force_reload": true,
"id": "show_product_dimensions"
},
{
"type": "select",
"label": "Number of Related Products",
Expand Down
33 changes: 31 additions & 2 deletions templates/components/products/product-view.html
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,39 @@ <h2 class="productView-brand"{{#if schema}} itemprop="brand" itemscope itemtype=
<dt class="productView-info-name">{{lang 'products.availability'}}</dt>
<dd class="productView-info-value">{{product.availability}}</dd>
{{/if}}
{{#if product.weight}}
{{#all product.weight theme_settings.show_product_weight}}
<dt class="productView-info-name">{{lang 'products.weight'}}</dt>
<dd class="productView-info-value" data-product-weight>{{product.weight}}</dd>
{{/if}}
{{/all}}
{{#all product.width product.height product.depth theme_settings.show_product_dimensions}}
<dt class="productView-info-name">{{lang 'products.width'}}</dt>
<dd class="productView-info-value" data-product-width>
{{product.width}}
{{#if settings.measurements.length '==' 'Centimeters'}}
({{lang 'products.measurement.metric'}})
{{else}}
({{lang 'products.measurement.imperial'}})
{{/if}}
</dd>
<dt class="productView-info-name">{{lang 'products.height'}}</dt>
<dd class="productView-info-value" data-product-height>
{{product.height}}
{{#if settings.measurements.length '==' 'Centimeters'}}
({{lang 'products.measurement.metric'}})
{{else}}
({{lang 'products.measurement.imperial'}})
{{/if}}
</dd>
<dt class="productView-info-name">{{lang 'products.depth'}}</dt>
<dd class="productView-info-value" data-product-depth>
{{product.depth}}
{{#if settings.measurements.length '==' 'Centimeters'}}
({{lang 'products.measurement.metric'}})
{{else}}
({{lang 'products.measurement.imperial'}})
{{/if}}
</dd>
{{/all}}
{{#if product.min_purchase_quantity}}
<dt class="productView-info-name">{{lang 'products.min_purchase_quantity'}}</dt>
<dd class="productView-info-value">{{lang 'products.purchase_units' quantity=product.min_purchase_quantity}}</dd>
Expand Down