Commit 25d1ab67 authored by Shaphen's avatar Shaphen

[AFP-47 Shaphen Pangburn]: Do not display null praducts in page finalize...

[AFP-47 Shaphen Pangburn]: Do not display null praducts in page finalize percentage calculation of discount per item
parent ca7b45c1
...@@ -18,7 +18,7 @@ export default class ProductItem extends Component { ...@@ -18,7 +18,7 @@ export default class ProductItem extends Component {
} }
calculateDiscount(price, discount) { calculateDiscount(price, discount) {
return (price * (1.00 - discount / 100)).toFixed(2); return (price * ((100 - discount) / 100)).toFixed(2);
} }
render() { render() {
......
...@@ -33,7 +33,7 @@ export default class ProductMarket extends Component { ...@@ -33,7 +33,7 @@ export default class ProductMarket extends Component {
<div className="products-container"> <div className="products-container">
{this.props.products.map(prod => { {this.props.products.map(prod => {
return ( return (
<div className="product-item-container" key={ prod.sku }> <div className={prod.productName ? "product-item-container" : "no-item"} key={ prod.sku }>
{ prod.productName ? { prod.productName ?
<ProductItem item={ prod }/> <ProductItem item={ prod }/>
: :
......
...@@ -28,6 +28,10 @@ ...@@ -28,6 +28,10 @@
margin: 8px; margin: 8px;
} }
.no-item {
display: none;
}
.product-item { .product-item {
width: 100%; width: 100%;
height: 100%; height: 100%;
...@@ -184,6 +188,7 @@ ...@@ -184,6 +188,7 @@
#product-details-right { #product-details-right {
width: 35%; width: 35%;
border-left: 1px solid black; border-left: 1px solid black;
margin-left: 20px;
} }
#prod-details-box { #prod-details-box {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment