@@ -62,7 +62,7 @@ export default Component.extend(FormMixin, {
62
62
63
63
if ( this . taxInfo !== null ) {
64
64
return sumBy ( this . tickets . toArray ( ) ,
65
- ticket => ( ticket . ticketPriceWithTax || 0 ) * ( ticket . orderQuantity || 0 )
65
+ ticket => ( ( ticket . ticketPriceWithTax || 0 ) - ( ticket . discount || 0 ) ) * ( ticket . orderQuantity || 0 )
66
66
) ;
67
67
}
68
68
return sumBy ( this . tickets . toArray ( ) ,
@@ -123,9 +123,7 @@ export default Component.extend(FormMixin, {
123
123
this . set ( 'invalidPromotionalCode' , true ) ;
124
124
}
125
125
try {
126
- let discountCode = await this . store . findRecord ( 'discount-code' , this . promotionalCode , {
127
- include : 'tickets'
128
- } ) ;
126
+ let discountCode = await this . store . queryRecord ( 'discount-code' , { eventIdentifier : this . event . id , code : this . promotionalCode } ) ;
129
127
let discountCodeEvent = await discountCode . get ( 'event' ) ;
130
128
if ( this . currentEventIdentifier === discountCodeEvent . identifier ) {
131
129
let discountType = discountCode . get ( 'type' ) ;
@@ -151,6 +149,7 @@ export default Component.extend(FormMixin, {
151
149
this . set ( 'invalidPromotionalCode' , true ) ;
152
150
}
153
151
} catch ( e ) {
152
+ console . warn ( e ) ;
154
153
if ( this . invalidPromotionalCode ) {
155
154
this . set ( 'invalidPromotionalCode' , true ) ;
156
155
}
0 commit comments