Commit 2b974709 authored by Trisno's avatar Trisno

fix recalculating Delivery + Reward

parent 6e79594b
......@@ -362,12 +362,14 @@ class ShoppingCart extends React.Component {
})
}
} else {
if (this.state.kasproPoint - (Math.max(0,(parseInt(this.props.order_total) - parseInt(this.props.voucher.reward.value))) + this.props.grabamount) >= -1) {
if (this.state.kasproPoint - (Math.max(0,(parseInt(this.props.order_total) - parseInt(this.props.voucher.reward.value) + this.props.grabamount))) >= -1) {
console.log(this.state.kasproPoint - (Math.max(0,(parseInt(this.props.order_total) - parseInt(this.props.voucher.reward.value) + this.props.grabamount))))
this.setState({
pointsused: (Math.max(0,parseInt(this.props.order_total) - parseInt(this.props.voucher.reward.value) + this.props.grabamount)),
balanceused: 0
})
} else {
console.log('masuk di sini 2')
this.setState({
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