product details
This commit is contained in:
@@ -7,6 +7,7 @@ import {updateQuantity, removeCartItem} from '../../../actions/cart/cartActions'
|
||||
import {setDialogContent, setDialogOpenFlag} from '../../../actions/dialog/dialogActions';
|
||||
import {cartMessages, cartTexts} from '../../../constants/cartConstants';
|
||||
import PackageBids from './PackageBids.jsx';
|
||||
import {coMarketTexts} from "../../../constants/coMarketConstants";
|
||||
|
||||
class CartItem extends Component {
|
||||
constructor(props) {
|
||||
@@ -88,17 +89,17 @@ class CartItem extends Component {
|
||||
totalRecurrent += selectedBid.servicesPrice + selectedBid.recurrentPrice;
|
||||
|
||||
oldTotal = cartItem.fixedPrice;
|
||||
oldTotalRecurrent = cartItem.servicesPrice + cartItem.recurentPrice;
|
||||
oldTotalRecurrent = cartItem.servicesPrice + cartItem.recurrentPrice;
|
||||
}else{
|
||||
total += cartItem.fixedPrice;
|
||||
totalRecurrent += cartItem.servicesPrice + cartItem.recurentPrice;
|
||||
totalRecurrent += cartItem.servicesPrice + cartItem.recurrentPrice;
|
||||
}
|
||||
|
||||
if(cartItem.options.length) {
|
||||
cartItem.options.forEach((packageOption) => {
|
||||
if(Object.keys(packageOption.prices).length) {
|
||||
total += parseFloat(packageOption.prices.fixedExtra);
|
||||
totalRecurrent += parseFloat(packageOption.prices.recurentExtra) + parseFloat(packageOption.prices.servicesExtra);
|
||||
totalRecurrent += parseFloat(packageOption.prices.recurrentExtra) + parseFloat(packageOption.prices.servicesExtra);
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -106,7 +107,7 @@ class CartItem extends Component {
|
||||
cartItem.additionalPackages.forEach((additionalPackage) => {
|
||||
if(Object.keys(additionalPackage).length) {
|
||||
total += parseFloat(additionalPackage.prices.fixedExtra);
|
||||
totalRecurrent += parseFloat(additionalPackage.prices.recurentExtra) + parseFloat(additionalPackage.prices.servicesExtra);
|
||||
totalRecurrent += parseFloat(additionalPackage.prices.recurrentExtra) + parseFloat(additionalPackage.prices.servicesExtra);
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -201,43 +202,52 @@ class CartItem extends Component {
|
||||
}
|
||||
{cartItem.options.length > 0 &&
|
||||
cartItem.options.map((packageOption) =>
|
||||
<Row className="cart-item-small-details" key={"package-option-" + cartItem.key + "-" + packageOption.idOptionPackage}>
|
||||
<Col lg={{offset: 1, size: 4}} xs={{offset: 1, size: 4}}>
|
||||
<Row
|
||||
className="cart-item-small-details flex-column"
|
||||
key={"package-option-" + cartItem.key + "-" + packageOption.idOptionPackage}
|
||||
>
|
||||
<span className="cart-item-additional-title">
|
||||
{packageOption.groupName}:
|
||||
</Col>
|
||||
<Col lg="7" xs="7" id={"item-option-" + cartItem.key + "-" + packageOption.idOptionPackage}>
|
||||
</span>
|
||||
<span id={"item-option-" + cartItem.key + "-" + packageOption.idOptionPackage}>
|
||||
{packageOption.packageName}
|
||||
</Col>
|
||||
</span>
|
||||
</Row>
|
||||
)
|
||||
}
|
||||
{cartItem.additionalPackages.length > 0 &&
|
||||
cartItem.additionalPackages.map((additionalPackage) =>
|
||||
<Row className="cart-item-small-details" key={"additional-package-" + cartItem.key + "-" + additionalPackage.idAdditionalPackage}>
|
||||
<Col lg={{offset: 1, size: 4}} xs={{offset:1, size: 4}}>
|
||||
{
|
||||
cartItem.additionalPackages.length > 0 && <Row className="cart-item-small-details flex-column">
|
||||
<span className="cart-item-additional-title">
|
||||
{cartTexts.labels.ADDITIOONAL_PACKAGE}:
|
||||
</Col>
|
||||
<Col lg="7" xs="7" id={"item-additional-" + cartItem.key + "-" + additionalPackage.idAdditionalPackage}>
|
||||
{additionalPackage.packageName}
|
||||
</Col>
|
||||
</span>
|
||||
{
|
||||
cartItem.additionalPackages.map((additionalPackage) =>
|
||||
<span
|
||||
key={"item-additional-" + cartItem.key + "-" + additionalPackage.idAdditionalPackage}
|
||||
id={"item-additional-" + cartItem.key + "-" + additionalPackage.idAdditionalPackage}
|
||||
>
|
||||
{additionalPackage.packageName}
|
||||
</span>
|
||||
)
|
||||
}
|
||||
</Row>
|
||||
)
|
||||
}
|
||||
<Row className="cart-item-small-details justify-content-between item-price">
|
||||
<Col className="d-flex align-items-center">
|
||||
<span className="item-payment-type">{cartItem.payType}:</span>
|
||||
<Row className="cart-item-small-details item-price">
|
||||
<Col className="d-flex align-items-center col-3 item-price-type">
|
||||
<span className="item-price-type">{cartItem.payType}:</span>
|
||||
</Col>
|
||||
<Col className="d-flex col-auto">
|
||||
<table className="price-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>{cartTexts.labels.ON_DELIVERY}</th>
|
||||
<th>{cartTexts.labels.MONTHLY}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>
|
||||
<Col className="d-flex">
|
||||
<div className="d-flex flex-column flex-grow-1">
|
||||
<div className="d-flex flex-grow-1 no-wrap item-price-header">
|
||||
<Col>
|
||||
<span>{cartTexts.labels.ON_DELIVERY}:</span>
|
||||
</Col>
|
||||
<Col>
|
||||
<span>{cartTexts.labels.MONTHLY}:</span>
|
||||
</Col>
|
||||
</div>
|
||||
<div className="d-flex flex-grow-1 no-wrap item-price-value">
|
||||
<Col>
|
||||
{
|
||||
this.state.fixedPrice &&
|
||||
<div>
|
||||
@@ -251,8 +261,8 @@ class CartItem extends Component {
|
||||
</div>
|
||||
|
||||
}
|
||||
</td>
|
||||
<td>
|
||||
</Col>
|
||||
<Col>
|
||||
{
|
||||
this.state.recurrentPrice &&
|
||||
<div>
|
||||
@@ -265,10 +275,9 @@ class CartItem extends Component {
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</Col>
|
||||
</div>
|
||||
</div>
|
||||
</Col>
|
||||
</Row>
|
||||
</Col>
|
||||
|
||||
Reference in New Issue
Block a user