price on item page is now with two decimals

This commit is contained in:
Senad Uka
2015-06-13 03:28:16 +02:00
parent 771a71b42f
commit c27e08a682
5 changed files with 12 additions and 6 deletions

View File

@@ -7,6 +7,7 @@ var React = require('react'),
AddToCart = require('../cart/addToCart');
var Router = require('react-router');
var Globals = require('../../globals');
var ItemWithDetailsPage = React.createClass({
@@ -24,7 +25,7 @@ var ItemWithDetailsPage = React.createClass({
<div className='item_brand_name'> {this.state.item.get('brand').name}</div>
<div className='item_name'> {this.state.item.get('name')}</div>
<div>
<div className='item_price'> {this.state.item.get('list_price')} KM</div>
<div className='item_price'> {Globals.FormatCurrency(this.state.item.get('list_price'))}</div>
<div>Količina</div>

View File

@@ -33,8 +33,8 @@ var SingleItem = React.createClass({
<div className="col-lg-3 col-md-3 col-sm-4 col-xs-6" onClick={itemClick}>
<div className="productbox">
<img className="img-responsive" src={firstImage.resized_url} alt="product image" />
<div style={{height: "110px"}}>
<p> <span className="text-uppercase">{ this.props.item.get('brand') ? this.props.item.get('brand').name : '' }</span>
<div style={{height: "110px"}} className="item_name_and_price">
<p><span className="text-uppercase">{ this.props.item.get('brand') ? this.props.item.get('brand').name : '' }</span>
<br /><span className="text-capitalize">{ this.props.item.get('name') }</span></p>
<h4>{ Globals.FormatCurrency(this.props.item.get('list_price')) }</h4>
</div>
@@ -42,7 +42,7 @@ var SingleItem = React.createClass({
</div>
);
}
},
},
itemClick: function(e) {
NavigationActions.goToItemDetails(this.props.item);

View File

@@ -58,6 +58,11 @@
}
.item_name_and_price {
text-align: center;
vertical-align: center;
}
/*

View File

@@ -164,7 +164,7 @@ text-decoration: underline;
}
.productbox div span{
color: black;
margin-left: 8px;
}

View File

@@ -13,7 +13,7 @@ var ItemWithDetails = Backbone.Model.extend({
var price = parseFloat(this.get('list_price')).toFixed(2)
var pricePerUnit = (price / unitsInPack).toFixed(2);
var descriptionSuffix = this.get('unit').description_suffix;
return (+pricePerUnit).toString() + " KM " + descriptionSuffix;
return Globals.FormatCurrency(pricePerUnit);
}
},
defaults : {