diff --git a/assets/js/theme/common/product-details.js b/assets/js/theme/common/product-details.js index 9fe7c13f73..1ef372c920 100644 --- a/assets/js/theme/common/product-details.js +++ b/assets/js/theme/common/product-details.js @@ -94,11 +94,11 @@ export default class ProductDetails { $div: $('.rrp-price--withoutTax', $scope), $span: $('[data-product-rrp-price-without-tax]', $scope), }, - nonSaleWithPrice: { + nonSaleWithTax: { $div: $('.non-sale-price--withTax', $scope), $span: $('[data-product-non-sale-price-with-tax]', $scope), }, - nonSaleWithoutPrice: { + nonSaleWithoutTax: { $div: $('.non-sale-price--withoutTax', $scope), $span: $('[data-product-non-sale-price-without-tax]', $scope), }, @@ -109,6 +109,9 @@ export default class ProductDetails { priceNowLabel: { $span: $('.price-now-label', $scope), }, + priceLabel: { + $span: $('.price-label', $scope), + }, $weight: $('.productView-info [data-product-weight]', $scope), $increments: $('.form-field--increments :input', $scope), $addToCart: $('#form-action-addToCart', $scope), @@ -378,10 +381,11 @@ export default class ProductDetails { clearPricingNotFound(viewModel) { viewModel.rrpWithTax.$div.hide(); viewModel.rrpWithoutTax.$div.hide(); - viewModel.nonSaleWithPrice.$div.hide(); - viewModel.nonSaleWithoutPrice.$div.hide(); + viewModel.nonSaleWithTax.$div.hide(); + viewModel.nonSaleWithoutTax.$div.hide(); viewModel.priceSaved.$div.hide(); viewModel.priceNowLabel.$span.hide(); + viewModel.priceLabel.$span.hide(); } /** @@ -392,10 +396,12 @@ export default class ProductDetails { this.clearPricingNotFound(viewModel); if (price.with_tax) { + viewModel.priceLabel.$span.show(); viewModel.$priceWithTax.html(price.with_tax.formatted); } if (price.without_tax) { + viewModel.priceLabel.$span.show(); viewModel.$priceWithoutTax.html(price.without_tax.formatted); } @@ -415,15 +421,17 @@ export default class ProductDetails { } if (price.non_sale_price_with_tax) { - viewModel.nonSaleWithPrice.$div.show(); + viewModel.priceLabel.$span.hide(); + viewModel.nonSaleWithTax.$div.show(); viewModel.priceNowLabel.$span.show(); - viewModel.nonSaleWithPrice.$span.html(price.non_sale_price_with_tax.formatted); + viewModel.nonSaleWithTax.$span.html(price.non_sale_price_with_tax.formatted); } if (price.non_sale_price_without_tax) { - viewModel.nonSaleWithoutPrice.$div.show(); + viewModel.priceLabel.$span.hide(); + viewModel.nonSaleWithoutTax.$div.show(); viewModel.priceNowLabel.$span.show(); - viewModel.nonSaleWithoutPrice.$span.html(price.non_sale_price_without_tax.formatted); + viewModel.nonSaleWithoutTax.$span.html(price.non_sale_price_without_tax.formatted); } } diff --git a/config.json b/config.json index f752c12202..647b25b771 100644 --- a/config.json +++ b/config.json @@ -288,7 +288,11 @@ "geotrust_ssl_common_name": "", "geotrust_ssl_seal_size": "M", "navigation_design": "simple", - "price_ranges": true + "price_ranges": true, + "pdp-price-label": "", + "pdp-sale-price-label": "Now:", + "pdp-non-sale-price-label": "Was:", + "pdp-retail-price-label": "MSRP:" }, "read_only_files": [ "/assets/scss/components/citadel", diff --git a/schema.json b/schema.json index acb862deec..1313c8ee9e 100644 --- a/schema.json +++ b/schema.json @@ -1117,6 +1117,30 @@ "type": "heading", "content": "Product pages" }, + { + "type": "text", + "label": "Product sale price label", + "id": "pdp-sale-price-label" + }, + { + "type": "text", + "label": "Product before sale price label", + "id": "pdp-non-sale-price-label" + }, + { + "type": "text", + "label": "Product retail price label", + "id": "pdp-retail-price-label" + }, + { + "type": "text", + "label": "Product price label", + "id": "pdp-price-label" + }, + { + "type": "paragraph", + "content": "* the 'Product price label' is displayed when there is not a sale price." + }, { "label": "Product swatch image sizes", "type": "imageDimension", diff --git a/templates/components/products/price-range.html b/templates/components/products/price-range.html index 8a8a4a9308..f6b05cd8cb 100644 --- a/templates/components/products/price-range.html +++ b/templates/components/products/price-range.html @@ -1,6 +1,6 @@ {{#and price.retail_price_range.min.with_tax price.retail_price_range.max.with_tax}}
- {{lang 'products.retail_price'}} + {{theme_settings.pdp-retail-price-label}} {{price.retail_price_range.min.with_tax.formatted}} - {{price.retail_price_range.max.with_tax.formatted}} {{#if schema_org}} @@ -17,28 +17,23 @@ {{else}} {{#if price.with_tax}} {{/if}} {{/and}} {{#and price.price_range.min.with_tax price.price_range.max.with_tax}}
- + {{theme_settings.pdp-price-label}} + {{price.price_range.min.with_tax.formatted}} - {{price.price_range.max.with_tax.formatted}} {{#and price.price_range.min.without_tax price.price_range.max.without_tax}} {{lang 'products.price_with_tax' tax_label=price.price_range.min.tax_label}} @@ -58,7 +53,7 @@ {{/and}} {{#and price.retail_price_range.min.without_tax price.retail_price_range.max.without_tax}}
- {{lang 'products.retail_price'}} + {{theme_settings.pdp-retail-price-label}} {{price.retail_price_range.min.without_tax.formatted}} - {{price.retail_price_range.max.without_tax.formatted}} {{#if schema_org}} @@ -75,28 +70,23 @@ {{else}} {{#if price.without_tax}} {{/if}} {{/and}} {{#and price.price_range.min.without_tax price.price_range.max.without_tax}}
- + {{theme_settings.pdp-price-label}} + {{price.price_range.min.without_tax.formatted}} - {{price.price_range.max.without_tax.formatted}} {{#and price.price_range.min.with_tax price.price_range.max.with_tax}} {{lang 'products.price_without_tax' tax_label=price.price_range.min.tax_label}} diff --git a/templates/components/products/price.html b/templates/components/products/price.html index ab2e328a0c..bcf0e68962 100644 --- a/templates/components/products/price.html +++ b/templates/components/products/price.html @@ -3,26 +3,23 @@ {{else}} {{#if price.with_tax}}
- {{lang 'products.retail_price'}} + {{theme_settings.pdp-retail-price-label}} - {{#if price.rrp_with_tax}} - {{price.rrp_with_tax.formatted}} - {{/if}} + {{price.rrp_with_tax.formatted}}
- {{lang 'products.price_was'}} + {{theme_settings.pdp-non-sale-price-label}} - {{#if price.non_sale_price_with_tax}} - {{price.non_sale_price_with_tax.formatted}} - {{/if}} + {{price.non_sale_price_with_tax.formatted}}
- - {{#if price.non_sale_price_with_tax}} - {{lang 'products.price_now'}} - {{/if}} + + {{theme_settings.pdp-price-label}} + + + {{theme_settings.pdp-sale-price-label}} {{price.with_tax.formatted}} {{#if schema_org}} @@ -41,24 +38,23 @@ {{/if}} {{#if price.without_tax}}
- {{lang 'products.retail_price'}} - - {{#if price.rrp_without_tax}} - {{price.rrp_without_tax.formatted}} - {{/if}} + {{theme_settings.pdp-retail-price-label}} + + {{price.rrp_without_tax.formatted}}
- {{lang 'products.price_was'}} + {{theme_settings.pdp-non-sale-price-label}} - {{#if price.non_sale_price_without_tax}} - {{price.non_sale_price_without_tax.formatted}} - {{/if}} + {{price.non_sale_price_without_tax.formatted}}
+ + {{theme_settings.pdp-price-label}} + - {{lang 'products.price_now'}} + {{theme_settings.pdp-sale-price-label}} {{price.without_tax.formatted}} {{#if schema_org}}