Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Show "Free" instead of $0.00 in ticket price #5369

Merged
merged 8 commits into from
Nov 1, 2020
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions app/templates/components/orders/order-summary.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,13 @@
{{ticket.name}}
</div>
</td>
<td>{{currency-symbol this.eventCurrency}} {{format-money ticket.price}}</td>
<td>
{{#if (eq ticket.type 'free')}}
{{t "Free"}}
{{else}}
{{currency-symbol this.eventCurrency}} {{format-money ticket.price}}
{{/if}}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make this an HTML only component to avoid repetition. Just move it into its own HTML file and replace ticket.type and ticket.price to @ticket.type and vice versa. Then use that component and pass ticket like @ticket={{ticket}}

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Name the component ticket-price.hbs

</td>
{{#if this.data.discountCode}}
<td>{{currency-symbol this.eventCurrency}} {{format-money ticket.discount}}</td>
{{/if}}
Expand All @@ -107,7 +113,11 @@
</td>
{{/if}}
<td>
{{currency-symbol this.eventCurrency}} {{format-money (mult (sub ticket.price ticket.discount) (ticket-attendees this.data.attendees ticket.attendees))}}
{{#if (eq ticket.type 'free')}}
{{t "Free"}}
{{else}}
{{currency-symbol this.eventCurrency}} {{format-money (mult (sub ticket.price ticket.discount) (ticket-attendees this.data.attendees ticket.attendees))}}
{{/if}}
</td>
{{/if}}

Expand Down
12 changes: 10 additions & 2 deletions app/templates/components/public/ticket-list.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,11 @@
</div>
{{else}}
<div class="{{if ticket.discount 'strike text'}}">
{{currency-symbol this.eventCurrency}} {{format-money ticket.price}}
{{#if (eq ticket.type 'free')}}
{{t "Free"}}
{{else}}
{{currency-symbol this.eventCurrency}} {{format-money ticket.price}}
{{/if}}
</div>
{{#if ticket.discount}}
<div>
Expand Down Expand Up @@ -96,7 +100,11 @@
</div>
</td>
<td id='{{ticket.id}}_subtotal' class="ui right aligned">
{{currency-symbol this.eventCurrency}} {{format-money ticket.subTotal}}
{{#if (eq ticket.type 'free')}}
{{t "Free"}}
{{else}}
{{currency-symbol this.eventCurrency}} {{format-money ticket.subTotal}}
{{/if}}
</td>
</tr>
{{/unless}}
Expand Down