Skip to content
This repository was archived by the owner on May 16, 2019. It is now read-only.

Commit 554ee85

Browse files
committed
truncate zeros on shipping
- remove trailing zeros on shipping and price in BTC - don't hide shipping info if the shipping is free
1 parent afda261 commit 554ee85

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

js/templates/item.html

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ <h2 class="page-contractTitle noOverflow textOpacity1 marginLeft20 marginBottom8
4141
<ul class="itemMeta">
4242
<li class="alignCenter itemPrice">
4343
<span class="textSize22px textOpacity1 fontWeight500 marginRight2">
44-
<%= ob.vendorBTCPrice.toFixed(4) %> BTC
44+
<%= Number(ob.vendorBTCPrice.toFixed(4)) %> BTC
4545
</span>
4646
<% if(ob.userCurrencyCode != 'BTC'){ %>
4747
<span class="textSize22px textOpacity65">(<%= ob.displayPrice %>)</span>
@@ -188,28 +188,26 @@ <h4><%= polyglot.t('CanBeShippedTo') %></h4>
188188
<% if(ob.vendor_offer.listing.shipping.shipping_regions.length || ob.vendor_offer.listing.policy.returns || ob.vendor_offer.listing.policy.terms_conditions) { %>
189189
<div class="flexCol-6">
190190
<div class="rowItem fontSize16 padding30 lineHeight24 fontWeight400">
191-
<% if(ob.vendor_offer.listing.shipping.free == false) { %>
192191
<h3><%= polyglot.t('Domestic') %> <%= ob.displayShippingOrigin || ob.userCountry %></h3>
193192
<div>
194193
<% if(ob.userCurrencyCode != "BTC"){ %>
195-
<%= polyglot.t('Shipping2') %> <%= ob.displayDomesticShipping %> (<%= ob.domesticShippingBTC.toFixed(8) %> BTC)
194+
<%= polyglot.t('Shipping2') %> <%= ob.displayDomesticShipping %> (<%= Number(ob.domesticShippingBTC.toFixed(8)) %> BTC)
196195
<% } else { %>
197-
<%= polyglot.t('Shipping2') %> <%= ob.domesticShippingBTC.toFixed(8) %> BTC
196+
<%= polyglot.t('Shipping2') %> <%= Number(ob.domesticShippingBTC.toFixed(8)) %> BTC
198197
<% } %>
199198
</div>
200199
<p><%= polyglot.t('transactions.EstimatedDelivery') %> <%= ob.vendor_offer.listing.shipping.est_delivery.domestic %></p>
201200
<hr/>
202201
<h3><%= polyglot.t('International') %></h3>
203202
<div>
204203
<% if(ob.userCurrencyCode != "BTC"){ %>
205-
<%= polyglot.t('Shipping2') %> <%= ob.displayInternationalShipping %> (<%= ob.internationalShippingBTC.toFixed(8) %> BTC)
204+
<%= polyglot.t('Shipping2') %> <%= ob.displayInternationalShipping %> (<%= Number(ob.internationalShippingBTC.toFixed(8)) %> BTC)
206205
<% } else { %>
207-
<%= polyglot.t('Shipping2') %> <%= ob.internationalShippingBTC.toFixed(8) %> BTC
206+
<%= polyglot.t('Shipping2') %> <%= Number(ob.internationalShippingBTC.toFixed(8)) %> BTC
208207
<% } %>
209208
</div>
210209
<p><%= polyglot.t('transactions.EstimatedDelivery') %> <%= ob.vendor_offer.listing.shipping.est_delivery.international %></p>
211210
<hr/>
212-
<% } %>
213211
<% if(ob.vendor_offer.listing.policy.returns) { %>
214212
<h3><%= polyglot.t('ReturnsPolicy') %></h3>
215213
<p><%= ob.vendor_offer.listing.policy.returns %></p>

0 commit comments

Comments
 (0)