File tree 3 files changed +7
-5
lines changed
3 files changed +7
-5
lines changed Original file line number Diff line number Diff line change 35
35
"typescript" : " ^4.2.4"
36
36
},
37
37
"dependencies" : {
38
- "@foxy.io/node-api" : " ^1.0.0-beta.8" ,
39
38
"@foxy.io/sdk" : " ^1.2.0" ,
40
39
"body-parser" : " ^1.19.0" ,
41
40
"express" : " ^4.17.1" ,
Original file line number Diff line number Diff line change @@ -123,12 +123,14 @@ class DataStore extends DataStoreBase {
123
123
// TODO: account for possible multiple shippings in a single transaction
124
124
// grab data from each shipment and create a list of shipments to be sent to Shiptheory
125
125
// for now it is simply assuming all items in embedded are part of the shipment
126
- const products = items . map ( p => ( {
126
+ const products = items . map ( ( p , i ) => ( {
127
+ height : p . height ,
127
128
name : p . name ,
128
- qtd : p . quantity ,
129
- sku : p . code ,
129
+ qty : p . quantity ,
130
+ sku : p . code || ` ${ transaction . id } - ${ i } ` ,
130
131
value : p . price ,
131
- weight : p . weight
132
+ weight : p . weight ,
133
+ width : p . width
132
134
} ) ) ;
133
135
const weight = items . reduce ( ( accum , curr ) => curr . weight + accum ) ;
134
136
return {
@@ -137,6 +139,7 @@ class DataStore extends DataStoreBase {
137
139
address_line_1 : shipments [ 0 ] . address1 ,
138
140
city : shipments [ 0 ] . city ,
139
141
country : shipments [ 0 ] . country ,
142
+ email : transaction . customer_email ,
140
143
firstname : shipments [ 0 ] . first_name ,
141
144
lastname : shipments [ 0 ] . last_name ,
142
145
postcode : shipments [ 0 ] . postal_code ,
You can’t perform that action at this time.
0 commit comments