price on item page is now with two decimals
This commit is contained in:
@@ -7,6 +7,7 @@ var React = require('react'),
|
|||||||
AddToCart = require('../cart/addToCart');
|
AddToCart = require('../cart/addToCart');
|
||||||
|
|
||||||
var Router = require('react-router');
|
var Router = require('react-router');
|
||||||
|
var Globals = require('../../globals');
|
||||||
|
|
||||||
|
|
||||||
var ItemWithDetailsPage = React.createClass({
|
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_brand_name'> {this.state.item.get('brand').name}</div>
|
||||||
<div className='item_name'> {this.state.item.get('name')}</div>
|
<div className='item_name'> {this.state.item.get('name')}</div>
|
||||||
<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>
|
<div>Količina</div>
|
||||||
|
|
||||||
|
|||||||
@@ -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="col-lg-3 col-md-3 col-sm-4 col-xs-6" onClick={itemClick}>
|
||||||
<div className="productbox">
|
<div className="productbox">
|
||||||
<img className="img-responsive" src={firstImage.resized_url} alt="product image" />
|
<img className="img-responsive" src={firstImage.resized_url} alt="product image" />
|
||||||
<div style={{height: "110px"}}>
|
<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>
|
<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>
|
<br /><span className="text-capitalize">{ this.props.item.get('name') }</span></p>
|
||||||
<h4>{ Globals.FormatCurrency(this.props.item.get('list_price')) }</h4>
|
<h4>{ Globals.FormatCurrency(this.props.item.get('list_price')) }</h4>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -58,6 +58,11 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.item_name_and_price {
|
||||||
|
text-align: center;
|
||||||
|
vertical-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
@@ -164,7 +164,7 @@ text-decoration: underline;
|
|||||||
}
|
}
|
||||||
.productbox div span{
|
.productbox div span{
|
||||||
color: black;
|
color: black;
|
||||||
margin-left: 8px;
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ var ItemWithDetails = Backbone.Model.extend({
|
|||||||
var price = parseFloat(this.get('list_price')).toFixed(2)
|
var price = parseFloat(this.get('list_price')).toFixed(2)
|
||||||
var pricePerUnit = (price / unitsInPack).toFixed(2);
|
var pricePerUnit = (price / unitsInPack).toFixed(2);
|
||||||
var descriptionSuffix = this.get('unit').description_suffix;
|
var descriptionSuffix = this.get('unit').description_suffix;
|
||||||
return (+pricePerUnit).toString() + " KM " + descriptionSuffix;
|
return Globals.FormatCurrency(pricePerUnit);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
defaults : {
|
defaults : {
|
||||||
|
|||||||
Reference in New Issue
Block a user