Skip to content

Commit

Permalink
adjust price display
Browse files Browse the repository at this point in the history
  • Loading branch information
alexvuong committed May 10, 2024
1 parent 165c2db commit cf51887
Show file tree
Hide file tree
Showing 6 changed files with 330 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@ import {FormattedMessage, FormattedNumber} from 'react-intl'
/**
* @param priceData - price info extracted from a product
* // If a product is a set,
* on PLP, don't show price at all
* on PDP, the set children will have it own price as From X (cross) Y
* on PLP, Show From X where X is the lowest of its children
* on PDP, Show From X where X is the lowest of its children and
* the set children will have it own price as From X (cross) Y
* // if a product is a master
* on PLP and PDP, show From X (cross) Y , the X and Y are
* sale and list price of variant that has the lowest price (including promotionalPrice)
Expand Down Expand Up @@ -42,7 +43,21 @@ const DisplayPrice = ({priceData, currency}) => {
{
{
isRange, select,
true {From}
true {
{
isOnSale, select,
true {<b>From</b>}
fales {
{
hasRepresentedProduct, select,
true {<b>From</b>}
false {<span>From</span>}
other {}
}
}
other {<span>From</span>}
}
}
false {}
other {}
}
Expand All @@ -51,7 +66,7 @@ const DisplayPrice = ({priceData, currency}) => {
other {}
}
{isASet, select,
true {}
true {From <span>{salePrice}</span>}
false
{
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2526,7 +2526,95 @@
"value": [
{
"type": 0,
"value": "From"
"value": " "
},
{
"options": {
"fales": {
"value": [
{
"type": 0,
"value": " "
},
{
"options": {
"false": {
"value": [
{
"children": [
{
"type": 0,
"value": "From"
}
],
"type": 8,
"value": "span"
}
]
},
"other": {
"value": [
]
},
"true": {
"value": [
{
"children": [
{
"type": 0,
"value": "From"
}
],
"type": 8,
"value": "b"
}
]
}
},
"type": 5,
"value": "hasRepresentedProduct"
},
{
"type": 0,
"value": " "
}
]
},
"other": {
"value": [
{
"children": [
{
"type": 0,
"value": "From"
}
],
"type": 8,
"value": "span"
}
]
},
"true": {
"value": [
{
"children": [
{
"type": 0,
"value": "From"
}
],
"type": 8,
"value": "b"
}
]
}
},
"type": 5,
"value": "isOnSale"
},
{
"type": 0,
"value": " "
}
]
}
Expand Down Expand Up @@ -2720,6 +2808,20 @@
},
"true": {
"value": [
{
"type": 0,
"value": "From "
},
{
"children": [
{
"type": 1,
"value": "salePrice"
}
],
"type": 8,
"value": "span"
}
]
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2526,7 +2526,95 @@
"value": [
{
"type": 0,
"value": "From"
"value": " "
},
{
"options": {
"fales": {
"value": [
{
"type": 0,
"value": " "
},
{
"options": {
"false": {
"value": [
{
"children": [
{
"type": 0,
"value": "From"
}
],
"type": 8,
"value": "span"
}
]
},
"other": {
"value": [
]
},
"true": {
"value": [
{
"children": [
{
"type": 0,
"value": "From"
}
],
"type": 8,
"value": "b"
}
]
}
},
"type": 5,
"value": "hasRepresentedProduct"
},
{
"type": 0,
"value": " "
}
]
},
"other": {
"value": [
{
"children": [
{
"type": 0,
"value": "From"
}
],
"type": 8,
"value": "span"
}
]
},
"true": {
"value": [
{
"children": [
{
"type": 0,
"value": "From"
}
],
"type": 8,
"value": "b"
}
]
}
},
"type": 5,
"value": "isOnSale"
},
{
"type": 0,
"value": " "
}
]
}
Expand Down Expand Up @@ -2720,6 +2808,20 @@
},
"true": {
"value": [
{
"type": 0,
"value": "From "
},
{
"children": [
{
"type": 1,
"value": "salePrice"
}
],
"type": 8,
"value": "span"
}
]
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5338,7 +5338,95 @@
"value": [
{
"type": 0,
"value": "Ƒřǿǿḿ"
"value": " "
},
{
"options": {
"fales": {
"value": [
{
"type": 0,
"value": " "
},
{
"options": {
"false": {
"value": [
{
"children": [
{
"type": 0,
"value": "Ƒřǿǿḿ"
}
],
"type": 8,
"value": "span"
}
]
},
"other": {
"value": [
]
},
"true": {
"value": [
{
"children": [
{
"type": 0,
"value": "Ƒřǿǿḿ"
}
],
"type": 8,
"value": "b"
}
]
}
},
"type": 5,
"value": "hasRepresentedProduct"
},
{
"type": 0,
"value": " "
}
]
},
"other": {
"value": [
{
"children": [
{
"type": 0,
"value": "Ƒřǿǿḿ"
}
],
"type": 8,
"value": "span"
}
]
},
"true": {
"value": [
{
"children": [
{
"type": 0,
"value": "Ƒřǿǿḿ"
}
],
"type": 8,
"value": "b"
}
]
}
},
"type": 5,
"value": "isOnSale"
},
{
"type": 0,
"value": " "
}
]
}
Expand Down Expand Up @@ -5532,6 +5620,20 @@
},
"true": {
"value": [
{
"type": 0,
"value": "Ƒřǿǿḿ "
},
{
"children": [
{
"type": 1,
"value": "salePrice"
}
],
"type": 8,
"value": "span"
}
]
}
},
Expand Down
Loading

0 comments on commit cf51887

Please sign in to comment.