Skip to content

Commit

Permalink
Added showDiscountValue
Browse files Browse the repository at this point in the history
  • Loading branch information
iaron committed Oct 24, 2019
1 parent 7a93d5c commit 8fe2ac7
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 13 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Expand Up @@ -6,6 +6,8 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## [Unreleased]
### Added
- `showDiscountValue` to ProductSummaryPrice.

## [2.42.2] - 2019-10-24
### Changed
Expand Down
2 changes: 1 addition & 1 deletion docs/ProductSummaryPrice.md
Expand Up @@ -41,7 +41,7 @@ Through the Storefront, you can change the `ProductSummaryPrice`'s behavior and
| ------------------- | --------- | -------------------------------- | ------------- |
| `showListPrice` | `Boolean` | Shows the product list price | `true` |
| `showInstallments` | `Boolean` | Set installments' visibility | `true` |
| `showSavings` | `Boolean` | Set savings' visibility | `false` |
| `showDiscountValue` | `Boolean` | Set discount value's visibility | `false` |
| `showLabels` | `Boolean` | Set pricing labels' visibility | `true` |
| `labelSellingPrice` | `String` | Text of selling price's label | |
| `labelListPrice` | `String` | Text of list price's label | |
Expand Down
2 changes: 1 addition & 1 deletion messages/context.json
Expand Up @@ -24,7 +24,7 @@
"admin/editor.productSummaryPrice.showSellingPriceRange.title": "Title of showSellingPriceRange prop",
"admin/editor.productSummaryPrice.showListPriceRange.title": "Title of showListPriceRange prop",
"admin/editor.productSummaryPrice.showInstallments.title": "Title of showInstallments prop",
"admin/editor.productSummaryPrice.showSavings.title": "Title of showSavings prop",
"admin/editor.productSummaryPrice.showDiscountValue.title": "Title of showDiscountValue prop",
"admin/editor.productSummaryPrice.showLabels.title": "Title of showLabels prop",
"admin/editor.productSummaryPrice.labelSellingPrice.title": "Title of labelSellingPrice prop",
"admin/editor.productSummaryPrice.labelListPrice.title": "Title of labelListPrice prop",
Expand Down
2 changes: 1 addition & 1 deletion messages/en.json
Expand Up @@ -24,7 +24,7 @@
"admin/editor.productSummaryPrice.showSellingPriceRange.title": "Show selling price range",
"admin/editor.productSummaryPrice.showListPriceRange.title": "Show list price range",
"admin/editor.productSummaryPrice.showInstallments.title": "Show installments",
"admin/editor.productSummaryPrice.showSavings.title": "Show savings",
"admin/editor.productSummaryPrice.showDiscountValue.title": "Show discount value",
"admin/editor.productSummaryPrice.showLabels.title": "Show labels",
"admin/editor.productSummaryPrice.labelSellingPrice.title": "Label for selling price",
"admin/editor.productSummaryPrice.labelListPrice.title": "Label for list price",
Expand Down
2 changes: 1 addition & 1 deletion messages/es.json
Expand Up @@ -24,7 +24,7 @@
"admin/editor.productSummaryPrice.showSellingPriceRange.title": "Mostrar rango de precios de venta",
"admin/editor.productSummaryPrice.showListPriceRange.title": "Mostrar rango de precios de tabla",
"admin/editor.productSummaryPrice.showInstallments.title": "Mostrar parcelas",
"admin/editor.productSummaryPrice.showSavings.title": "Mostrar descuento",
"admin/editor.productSummaryPrice.showDiscountValue.title": "Mostrar descuento",
"admin/editor.productSummaryPrice.showLabels.title": "Mostrar las etiquetas",
"admin/editor.productSummaryPrice.labelSellingPrice.title": "Etiqueta para el precio de venta",
"admin/editor.productSummaryPrice.labelListPrice.title": "Etiqueta para el precio indicado",
Expand Down
2 changes: 1 addition & 1 deletion messages/pt.json
Expand Up @@ -24,7 +24,7 @@
"admin/editor.productSummaryPrice.showSellingPriceRange.title": "Mostrar faixa de preços de venda",
"admin/editor.productSummaryPrice.showListPriceRange.title": "Mostrar faixa de preços de tabela",
"admin/editor.productSummaryPrice.showInstallments.title": "Mostrar parcelas",
"admin/editor.productSummaryPrice.showSavings.title": "Mostrar desconto",
"admin/editor.productSummaryPrice.showDiscountValue.title": "Mostrar desconto",
"admin/editor.productSummaryPrice.showLabels.title": "Mostrar rótulos",
"admin/editor.productSummaryPrice.labelSellingPrice.title": "Rótulo para preço de venda",
"admin/editor.productSummaryPrice.labelListPrice.title": "Rótulo para preço listado",
Expand Down
15 changes: 7 additions & 8 deletions react/components/ProductSummaryPrice/ProductSummaryPrice.js
Expand Up @@ -27,8 +27,7 @@ const ProductSummaryPrice = ({
showSellingPriceRange,
showLabels,
showInstallments,
// This prop has been disabled temporarily, because it was causing undesired behavior
//showSavings,
showDiscountValue,
labelSellingPrice,
labelListPrice,
showBorders,
Expand Down Expand Up @@ -86,7 +85,7 @@ const ProductSummaryPrice = ({
labelListPrice={labelListPrice}
listPriceList={listPriceList}
showListPriceRange={showListPriceRange}
showSavings={false}
showSavings={showDiscountValue}
/>
)}
</div>
Expand All @@ -105,7 +104,7 @@ ProductSummaryPrice.propTypes = {
/** Set installments' visibility */
showInstallments: PropTypes.bool,
/** Set savings' visibility*/
showSavings: PropTypes.bool,
showDiscountValue: PropTypes.bool,
/** Text of selling Price's label */
labelSellingPrice: PropTypes.string,
/** Text of list Price's label */
Expand All @@ -116,7 +115,7 @@ ProductSummaryPrice.propTypes = {

ProductSummaryPrice.defaultProps = {
showSellingPriceRange: false,
showSavings: false,
showDiscountValue: false,
showListPriceRange: false,
showListPrice: true,
showInstallments: true,
Expand Down Expand Up @@ -155,10 +154,10 @@ ProductSummaryPrice.schema = {
default: ProductSummaryPrice.defaultProps.showInstallments,
isLayout: true,
},
showSavings: {
showDiscountValue: {
type: 'boolean',
title: 'admin/editor.productSummaryPrice.showSavings.title',
default: ProductSummaryPrice.defaultProps.showSavings,
title: 'admin/editor.productSummaryPrice.showDiscountValue.title',
default: ProductSummaryPrice.defaultProps.showDiscountValue,
},
showLabels: {
type: 'boolean',
Expand Down

0 comments on commit 8fe2ac7

Please sign in to comment.