cart total is now shown without handling and shipping
This commit is contained in:
37
front-ui/app/components/cart/cartTotal.js
Normal file
37
front-ui/app/components/cart/cartTotal.js
Normal file
@@ -0,0 +1,37 @@
|
||||
var React = require('react'),
|
||||
Globals = require('../../globals');
|
||||
;
|
||||
|
||||
var Router = require('react-router');
|
||||
|
||||
|
||||
var CartTotal = React.createClass({
|
||||
|
||||
render: function() {
|
||||
|
||||
var counts = this.props.itemCounts;
|
||||
var total = 0;
|
||||
this.props.items.map(function (i) {
|
||||
|
||||
var count = counts[i.get('id')].get('count');
|
||||
var price = i.get('list_price');
|
||||
total += (price * count)
|
||||
return total;
|
||||
|
||||
});
|
||||
|
||||
return (
|
||||
|
||||
<div className="row-fluid cart-total">
|
||||
<div className="col-md-offset-9 col-md-3">
|
||||
Ukupno: {Globals.FormatCurrency(total)} + Dostava
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
|
||||
module.exports = CartTotal;
|
||||
Reference in New Issue
Block a user