From a2e9b12bff79191929c81bc50b9baf7f8ee822ed Mon Sep 17 00:00:00 2001 From: Cristy Carpenter Date: Tue, 3 Oct 2017 16:17:36 -0500 Subject: [PATCH] STENCIL-3527: Adding toggle for weight and dimensions on product pages. --- CHANGELOG.md | 1 + config.json | 2 ++ lang/en.json | 7 ++++ schema.json | 12 +++++++ .../components/products/product-view.html | 33 +++++++++++++++++-- 5 files changed, 53 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 41fd66c111..aca5960479 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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) diff --git a/config.json b/config.json index ab0f8c6b8f..dd0eae8fa3 100644 --- a/config.json +++ b/config.json @@ -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", diff --git a/lang/en.json b/lang/en.json index 365c3d9312..8bca5ec8fe 100644 --- a/lang/en.json +++ b/lang/en.json @@ -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", diff --git a/schema.json b/schema.json index aa506b97d9..d9399124ca 100644 --- a/schema.json +++ b/schema.json @@ -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", diff --git a/templates/components/products/product-view.html b/templates/components/products/product-view.html index 1ea1c816bb..0d44b863d5 100644 --- a/templates/components/products/product-view.html +++ b/templates/components/products/product-view.html @@ -76,10 +76,39 @@

{{lang 'products.availability'}}
{{product.availability}}
{{/if}} - {{#if product.weight}} + {{#all product.weight theme_settings.show_product_weight}}
{{lang 'products.weight'}}
{{product.weight}}
- {{/if}} + {{/all}} + {{#all product.width product.height product.depth theme_settings.show_product_dimensions}} +
{{lang 'products.width'}}
+
+ {{product.width}} + {{#if settings.measurements.length '==' 'Centimeters'}} + ({{lang 'products.measurement.metric'}}) + {{else}} + ({{lang 'products.measurement.imperial'}}) + {{/if}} +
+
{{lang 'products.height'}}
+
+ {{product.height}} + {{#if settings.measurements.length '==' 'Centimeters'}} + ({{lang 'products.measurement.metric'}}) + {{else}} + ({{lang 'products.measurement.imperial'}}) + {{/if}} +
+
{{lang 'products.depth'}}
+
+ {{product.depth}} + {{#if settings.measurements.length '==' 'Centimeters'}} + ({{lang 'products.measurement.metric'}}) + {{else}} + ({{lang 'products.measurement.imperial'}}) + {{/if}} +
+ {{/all}} {{#if product.min_purchase_quantity}}
{{lang 'products.min_purchase_quantity'}}
{{lang 'products.purchase_units' quantity=product.min_purchase_quantity}}