File tree Expand file tree Collapse file tree 3 files changed +9
-8
lines changed Expand file tree Collapse file tree 3 files changed +9
-8
lines changed Original file line number Diff line number Diff line change @@ -36,10 +36,11 @@ ShareASale.prototype.orderCompleted = function(track) {
36
36
var orderId = track . orderId ( ) ;
37
37
var isRepeat = track . proxy ( 'properties.repeat' ) ;
38
38
var subtotal = ( track . subtotal ( ) || 0 ) . toFixed ( 2 ) ;
39
+ var total = ( track . total ( ) || 0 ) . toFixed ( 2 )
39
40
var orderTotal =
40
41
this . options . useTotalAsAmount && track . total ( )
41
- ? track . total ( ) . toFixed ( 2 )
42
- : subtotal . toFixed ( 2 ) ;
42
+ ? total
43
+ : subtotal ;
43
44
var products = track . products ( ) ;
44
45
var currency = track . currency ( ) || this . options . currency ;
45
46
var coupon = track . coupon ( ) || '' ;
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " @segment/analytics.js-integration-shareasale" ,
3
3
"description" : " The Shareasale analytics.js integration." ,
4
- "version" : " 2.2.3 " ,
4
+ "version" : " 2.2.4 " ,
5
5
"keywords" : [
6
6
" analytics.js" ,
7
7
" analytics.js-integration" ,
Original file line number Diff line number Diff line change @@ -69,11 +69,11 @@ describe('ShareASale', function() {
69
69
subtotal : 42 ,
70
70
shipping : 10 ,
71
71
tax : 3.5 ,
72
- total : 55.5 ,
72
+ total : 55 ,
73
73
revenue : 15
74
74
} ) ;
75
75
analytics . loaded (
76
- '<img src="https://shareasale.com/sale.cfm?amount=55.50 &tracking=123&transtype=sale&merchantID=bonobos&skulist=&quantitylist=&pricelist=¤cy=USD&couponcode=">'
76
+ '<img src="https://shareasale.com/sale.cfm?amount=55.00 &tracking=123&transtype=sale&merchantID=bonobos&skulist=&quantitylist=&pricelist=¤cy=USD&couponcode=">'
77
77
) ;
78
78
} ) ;
79
79
@@ -93,10 +93,10 @@ describe('ShareASale', function() {
93
93
orderId : 123 ,
94
94
shipping : 10 ,
95
95
tax : 3.5 ,
96
- total : 55.5
96
+ total : 55
97
97
} ) ;
98
98
analytics . loaded (
99
- '<img src="https://shareasale.com/sale.cfm?amount=42.00 &tracking=123&transtype=sale&merchantID=bonobos&skulist=&quantitylist=&pricelist=¤cy=USD&couponcode=">'
99
+ '<img src="https://shareasale.com/sale.cfm?amount=41.50 &tracking=123&transtype=sale&merchantID=bonobos&skulist=&quantitylist=&pricelist=¤cy=USD&couponcode=">'
100
100
) ;
101
101
} ) ;
102
102
@@ -148,7 +148,7 @@ describe('ShareASale', function() {
148
148
total : 55.5
149
149
} ) ;
150
150
analytics . loaded (
151
- '<img src="https://shareasale.com/sale.cfm?amount=42 .00&tracking=123&transtype=sale&merchantID=bonobos&skulist=&quantitylist=&pricelist=¤cy=USD&couponcode=">'
151
+ '<img src="https://shareasale.com/sale.cfm?amount=47 .00&tracking=123&transtype=sale&merchantID=bonobos&skulist=&quantitylist=&pricelist=¤cy=USD&couponcode=">'
152
152
) ;
153
153
} ) ;
154
154
You can’t perform that action at this time.
0 commit comments