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 {
}
calculateDiscount(price, discount) {
return (price * (1.00 - discount / 100)).toFixed(2);
return (price * ((100 - discount) / 100)).toFixed(2);
}
render() {
......
......@@ -33,7 +33,7 @@ export default class ProductMarket extends Component {
<div className="products-container">
{this.props.products.map(prod => {
return (
<div className="product-item-container" key={ prod.sku }>
<div className={prod.productName ? "product-item-container" : "no-item"} key={ prod.sku }>
{ prod.productName ?
<ProductItem item={ prod }/>
:
......
......@@ -28,6 +28,10 @@
margin: 8px;
}
.no-item {
display: none;
}
.product-item {
width: 100%;
height: 100%;
......@@ -184,6 +188,7 @@
#product-details-right {
width: 35%;
border-left: 1px solid black;
margin-left: 20px;
}
#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