Commit afc1a42b authored by Trisno's avatar Trisno

fix recalculating voucher

parent edd31c01
......@@ -364,12 +364,12 @@ class ShoppingCart extends React.Component {
} else {
if (this.state.kasproPoint - ((parseInt(this.props.order_total) - parseInt(this.props.voucher.reward.value)) + this.props.grabamount) >= -1) {
this.setState({
pointsused: this.props.order_total + this.props.grabamount,
pointsused: (parseInt(this.props.order_total) - parseInt(this.props.voucher.reward.value)) + this.props.grabamount,
balanceused: 0
})
} else {
this.setState({
balanceused: (this.props.order_total + this.props.grabamount) - this.state.kasproPoint,
balanceused: ((parseInt(this.props.order_total) - parseInt(this.props.voucher.reward.value)) + this.props.grabamount) - this.state.kasproPoint,
pointsused: this.state.kasproPoint
})
}
......
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