Better display of cart amount breakdown
parent
706bce7b20
commit
f96d8335d6
12
app.js
12
app.js
|
@ -290,6 +290,18 @@ handlebars = handlebars.create({
|
||||||
return value.replace(/^\w/, (chr) => {
|
return value.replace(/^\w/, (chr) => {
|
||||||
return chr.toUpperCase();
|
return chr.toUpperCase();
|
||||||
});
|
});
|
||||||
|
},
|
||||||
|
math: (lvalue, operator, rvalue, options) => {
|
||||||
|
lvalue = parseFloat(lvalue);
|
||||||
|
rvalue = parseFloat(rvalue);
|
||||||
|
|
||||||
|
return{
|
||||||
|
'+': lvalue + rvalue,
|
||||||
|
'-': lvalue - rvalue,
|
||||||
|
'*': lvalue * rvalue,
|
||||||
|
'/': lvalue / rvalue,
|
||||||
|
'%': lvalue % rvalue
|
||||||
|
}[operator];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -170,5 +170,7 @@
|
||||||
"Return to information": "Return to information",
|
"Return to information": "Return to information",
|
||||||
"Search shop": "Search shop",
|
"Search shop": "Search shop",
|
||||||
"Dashboard": "Dashboard",
|
"Dashboard": "Dashboard",
|
||||||
"Create order": "Create order"
|
"Create order": "Create order",
|
||||||
|
"Order shipping amount": "Order shipping amount",
|
||||||
|
"Order net amount": "Order net amount"
|
||||||
}
|
}
|
|
@ -31,6 +31,8 @@
|
||||||
{{#if result.orderPaymentMessage}}
|
{{#if result.orderPaymentMessage}}
|
||||||
<li class="list-group-item"><strong> {{ @root.__ "Payment Message" }}: </strong><span class="float-right">{{result.orderPaymentMessage}}</span></li>
|
<li class="list-group-item"><strong> {{ @root.__ "Payment Message" }}: </strong><span class="float-right">{{result.orderPaymentMessage}}</span></li>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
<li class="list-group-item"><strong> {{ @root.__ "Order net amount" }}: </strong><span class="float-right">{{currencySymbol config.currencySymbol}}{{formatAmount (math result.orderTotal '-' result.orderShipping)}}</span></li>
|
||||||
|
<li class="list-group-item"><strong> {{ @root.__ "Order shipping amount" }}: </strong><span class="float-right">{{currencySymbol config.currencySymbol}}{{formatAmount result.orderShipping}}</span></li>
|
||||||
<li class="list-group-item"><strong> {{ @root.__ "Order total amount" }}: </strong><span class="float-right">{{currencySymbol config.currencySymbol}}{{formatAmount result.orderTotal}}</span></li>
|
<li class="list-group-item"><strong> {{ @root.__ "Order total amount" }}: </strong><span class="float-right">{{currencySymbol config.currencySymbol}}{{formatAmount result.orderTotal}}</span></li>
|
||||||
<li class="list-group-item"><strong> {{ @root.__ "Email address" }}: </strong><span class="float-right">{{result.orderEmail}}</span></li>
|
<li class="list-group-item"><strong> {{ @root.__ "Email address" }}: </strong><span class="float-right">{{result.orderEmail}}</span></li>
|
||||||
<li class="list-group-item"><strong> {{ @root.__ "First name" }}: </strong><span class="float-right">{{result.orderFirstname}}</span></li>
|
<li class="list-group-item"><strong> {{ @root.__ "First name" }}: </strong><span class="float-right">{{result.orderFirstname}}</span></li>
|
||||||
|
|
Loading…
Reference in New Issue