@whatmore-repo/whatmore-reactnative-sdk 1.0.11 → 1.0.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (36) hide show
  1. package/commands.txt +45 -38
  2. package/index.js +31 -31
  3. package/package.json +29 -29
  4. package/pre-integration-steps.txt +2 -2
  5. package/src/api/cart-commands/CartCommands.js +26 -26
  6. package/src/api/navigation-commands/NavigationCommands.js +16 -16
  7. package/src/api/partners/PartnerUtils.js +10 -10
  8. package/src/api/partners/appbrew/AppbrewCommands.js +26 -26
  9. package/src/api/product-details-commands/ProductDetailsCommands.js +389 -389
  10. package/src/api/shopify-commands/ShopifyCommands.js +28 -28
  11. package/src/api/whatmore-backend/WhatmoreMetricCommands.js +159 -159
  12. package/src/components/EventClickComponent.js +30 -30
  13. package/src/components/EventShoppingOverlay.js +75 -74
  14. package/src/components/EventShoppingView.js +31 -31
  15. package/src/components/EventsVerticalSwipeView.js +59 -59
  16. package/src/components/EventsVerticalSwipeViewNoModal.js +51 -51
  17. package/src/components/WhatmoreRootComponent.js +88 -88
  18. package/src/components/commons/AppMuteUnmuteIcon.js +35 -35
  19. package/src/components/cta-buttons/AddToCartButton.jsx +345 -345
  20. package/src/components/product-tiles/ProductPriceBadge.js +51 -51
  21. package/src/components/product-tiles/ProductTileV1.js +204 -204
  22. package/src/components/product-tiles/SelectVariantComponent.js +116 -116
  23. package/src/components/video-player/AppVideoPlayer.js +25 -25
  24. package/src/constants/AppGlobalVars.js +12 -12
  25. package/src/globals/useAppState_APP.js +17 -17
  26. package/src/hooks/useAddToCartStates.js +194 -194
  27. package/src/{components/icons → icons}/icon-components/CartIcon.jsx +26 -26
  28. package/src/{components/icons → icons}/icon-components/LoadingIcon.jsx +17 -17
  29. package/src/{components/icons → icons}/icon-components/MuteIcon.jsx +22 -22
  30. package/src/{components/icons → icons}/icon-components/PlusIcon.jsx +26 -26
  31. package/src/{components/icons → icons}/icon-components/UnmuteIcon.jsx +22 -22
  32. package/src/{components/icons → icons}/svg-utils.txt +6 -6
  33. package/src/utils/ColorUtils.js +39 -39
  34. package/src/utils/EventSanityUtils.js +21 -21
  35. package/src/utils/PriceUtils.js +27 -27
  36. package/src/utils/ProductUtils.js +5 -5
@@ -1,390 +1,390 @@
1
- import { productDetailsShopify, productDetailsShopifyJS } from "../shopify-commands/ShopifyCommands.js";
2
-
3
-
4
- function _isAppBrew(brandDomainContext){
5
- return brandDomainContext == "appbrew";
6
- }
7
-
8
- function _isAppMaker(brandDomainContext){
9
- return brandDomainContext == "appmaker";
10
- }
11
-
12
- function _isPlobalApps(brandDomainContext){
13
- return brandDomainContext == "plobalapps";
14
- }
15
-
16
- /**
17
- *
18
- * @returns
19
- *
20
- * {
21
- "product":{
22
- "id":6780184559682,
23
- "title":"Surkh Shibori Cotton Dress",
24
- "body_html":"\u003cp\u003eBold, beautiful and glamorous, our Surkh Shibori Cotton Dress is perfect for those who like to make a statement wiith their every day style. \u003cbr\u003eColor: Red\/Blue\u003cbr\u003eDress Fabric: Cotton\u003c\/p\u003e\n\u003cp\u003eNeckline: Shirt Collar\u003cbr\u003eSleeve: Balloon\u003cbr\u003eCARE: Dry Clean Only \u003cbr\u003eModel Size: Model is wearing S Size \u003cbr\u003eModel Height: 5'4\"\u003cbr\u003e \u003cbr\u003eDISCLAIMER: Slight Color variations may occur due to different screen resolutions.\u003c\/p\u003e",
25
- "vendor":"Aachho",
26
- "product_type":"Dress",
27
- "created_at":"2022-07-30T14:57:03+05:30",
28
- "handle":"surkh-shibori-cotton-dress",
29
- "updated_at":"2023-03-09T18:22:56+05:30",
30
- "published_at":"2022-08-04T19:05:13+05:30",
31
- "template_suffix":"",
32
- "published_scope":"global",
33
- "tags":"__label:NEW, category_express shipping, category_high, Category_Womenswear, Collection_Dress, Collection_Phulwari, Color_Blue, Color_Red, dress_collection, Fabric_Cotton, High, Neckline_Shirt Collar, OCCASSION_CASUAL, Pattern_Kalidaar, Phulwari, print_tie-\u0026-dye, Sleeves_Balloon, subcategory_dress, Technique_Tie \u0026 Dye",
34
- "variants":[
35
- {
36
- "id":39873050804290,
37
- "product_id":6780184559682,
38
- "title":"XS",
39
- "price":"3250.00",
40
- "sku":"ACHSSJUL18-XS",
41
- "position":1,
42
- "compare_at_price":"3250.00",
43
- "fulfillment_service":"manual",
44
- "inventory_management":"shopify",
45
- "option1":"XS",
46
- "option2":null,
47
- "option3":null,
48
- "created_at":"2022-07-30T14:57:04+05:30",
49
- "updated_at":"2023-02-22T18:02:08+05:30",
50
- "taxable":true,
51
- "barcode":"6814335325661",
52
- "grams":800,
53
- "image_id":null,
54
- "weight":0.8,
55
- "weight_unit":"kg",
56
- "requires_shipping":true
57
- },
58
- {
59
- "id":39873050837058,
60
- "product_id":6780184559682,
61
- "title":"S",
62
- "price":"3250.00",
63
- "sku":"ACHSSJUL18-S",
64
- "position":2,
65
- "compare_at_price":"3250.00",
66
- "fulfillment_service":"manual",
67
- "inventory_management":"shopify",
68
- "option1":"S",
69
- "option2":null,
70
- "option3":null,
71
- "created_at":"2022-07-30T14:57:04+05:30",
72
- "updated_at":"2023-03-09T18:22:56+05:30",
73
- "taxable":true,
74
- "barcode":"3565335325661",
75
- "grams":800,
76
- "image_id":null,
77
- "weight":0.8,
78
- "weight_unit":"kg",
79
- "requires_shipping":true
80
- },
81
- {
82
- "id":39873050869826,
83
- "product_id":6780184559682,
84
- "title":"M",
85
- "price":"3250.00",
86
- "sku":"ACHSSJUL18-M",
87
- "position":3,
88
- "compare_at_price":"3250.00",
89
- "fulfillment_service":"manual",
90
- "inventory_management":"shopify",
91
- "option1":"M",
92
- "option2":null,
93
- "option3":null,
94
- "created_at":"2022-07-30T14:57:04+05:30",
95
- "updated_at":"2023-03-04T13:05:45+05:30",
96
- "taxable":true,
97
- "barcode":"1707335325661",
98
- "grams":800,
99
- "image_id":null,
100
- "weight":0.8,
101
- "weight_unit":"kg",
102
- "requires_shipping":true
103
- }
104
- ],
105
- "options":[
106
- {
107
- "id":8825212633154,
108
- "product_id":6780184559682,
109
- "name":"Size",
110
- "position":1,
111
- "values":[
112
- "XS",
113
- "S",
114
- "M",
115
- "L",
116
- "XL",
117
- "XXL",
118
- "XXXL",
119
- "4XL",
120
- "5XL"
121
- ]
122
- }
123
- ],
124
- "images":[
125
- {
126
- "id":29273280905282,
127
- "product_id":6780184559682,
128
- "position":1,
129
- "created_at":"2022-08-04T18:51:06+05:30",
130
- "updated_at":"2022-08-04T22:11:03+05:30",
131
- "alt":"Surkh Shibori Cotton Dress",
132
- "width":2702,
133
- "height":3377,
134
- "src":"https:\/\/cdn.shopify.com\/s\/files\/1\/2542\/7564\/products\/40_8146ee2f-7a8a-43b3-9b1d-d170823cf30b.png?v=1659631263",
135
- "variant_ids":[
136
-
137
- ]
138
- },
139
- {
140
- "id":29273280839746,
141
- "product_id":6780184559682,
142
- "position":2,
143
- "created_at":"2022-08-04T18:51:06+05:30",
144
- "updated_at":"2022-08-04T22:11:03+05:30",
145
- "alt":"Surkh Shibori Cotton Dress",
146
- "width":2702,
147
- "height":3377,
148
- "src":"https:\/\/cdn.shopify.com\/s\/files\/1\/2542\/7564\/products\/38_673c4d81-d87f-4260-a819-2c3b93d7b9fa.png?v=1659631263",
149
- "variant_ids":[
150
-
151
- ]
152
- },
153
- {
154
- "id":29273280872514,
155
- "product_id":6780184559682,
156
- "position":3,
157
- "created_at":"2022-08-04T18:51:06+05:30",
158
- "updated_at":"2022-08-04T22:11:03+05:30",
159
- "alt":"Surkh Shibori Cotton Dress",
160
- "width":2702,
161
- "height":3377,
162
- "src":"https:\/\/cdn.shopify.com\/s\/files\/1\/2542\/7564\/products\/39_2e96c511-8984-4576-b6b6-530374b63d47.png?v=1659631263",
163
- "variant_ids":[
164
-
165
- ]
166
- }
167
- ],
168
- "image":{
169
- "id":29273280905282,
170
- "product_id":6780184559682,
171
- "position":1,
172
- "created_at":"2022-08-04T18:51:06+05:30",
173
- "updated_at":"2022-08-04T22:11:03+05:30",
174
- "alt":"Surkh Shibori Cotton Dress",
175
- "width":2702,
176
- "height":3377,
177
- "src":"https:\/\/cdn.shopify.com\/s\/files\/1\/2542\/7564\/products\/40_8146ee2f-7a8a-43b3-9b1d-d170823cf30b.png?v=1659631263",
178
- "variant_ids":[
179
-
180
- ]
181
- }
182
- }
183
- }
184
- *
185
- */
186
-
187
- export async function productDetails(product, brandDomainContext, whatmoreShopId){
188
-
189
- if(_isAppBrew(brandDomainContext) || _isAppMaker(brandDomainContext) || _isPlobalApps(brandDomainContext)){
190
- return productDetailsShopify(product);
191
- }
192
-
193
- // brandDomainContext == "whatmore"
194
- return {};
195
- }
196
-
197
-
198
-
199
- /**
200
- *
201
- * @returns
202
- *
203
- * {
204
- "id":6780184559682,
205
- "title":"Surkh Shibori Cotton Dress",
206
- "handle":"surkh-shibori-cotton-dress",
207
- "description":"\u003cp\u003eBold, beautiful and glamorous, our Surkh Shibori Cotton Dress is perfect for those who like to make a statement wiith their every day style. \u003cbr\u003eColor: Red\/Blue\u003cbr\u003eDress Fabric: Cotton\u003c\/p\u003e\n\u003cp\u003eNeckline: Shirt Collar\u003cbr\u003eSleeve: Balloon\u003cbr\u003eCARE: Dry Clean Only \u003cbr\u003eModel Size: Model is wearing S Size \u003cbr\u003eModel Height: 5'4\"\u003cbr\u003e \u003cbr\u003eDISCLAIMER: Slight Color variations may occur due to different screen resolutions.\u003c\/p\u003e",
208
- "published_at":"2022-08-04T19:05:13+05:30",
209
- "created_at":"2022-07-30T14:57:03+05:30",
210
- "vendor":"Aachho",
211
- "type":"Dress",
212
- "tags":[
213
- "__label:NEW",
214
- "category_express shipping",
215
- "category_high",
216
- "Category_Womenswear",
217
- "Collection_Dress",
218
- "Collection_Phulwari",
219
- "Color_Blue",
220
- "Color_Red",
221
- "dress_collection",
222
- "Fabric_Cotton",
223
- "High",
224
- "Neckline_Shirt Collar",
225
- "OCCASSION_CASUAL",
226
- "Pattern_Kalidaar",
227
- "Phulwari",
228
- "print_tie-\u0026-dye",
229
- "Sleeves_Balloon",
230
- "subcategory_dress",
231
- "Technique_Tie \u0026 Dye"
232
- ],
233
- "price":325000,
234
- "price_min":325000,
235
- "price_max":325000,
236
- "available":true,
237
- "price_varies":false,
238
- "compare_at_price":325000,
239
- "compare_at_price_min":325000,
240
- "compare_at_price_max":325000,
241
- "compare_at_price_varies":false,
242
- "variants":[
243
- {
244
- "id":39873050804290,
245
- "title":"XS",
246
- "option1":"XS",
247
- "option2":null,
248
- "option3":null,
249
- "sku":"ACHSSJUL18-XS",
250
- "requires_shipping":true,
251
- "taxable":true,
252
- "featured_image":null,
253
- "available":true,
254
- "name":"Surkh Shibori Cotton Dress - XS",
255
- "public_title":"XS",
256
- "options":[
257
- "XS"
258
- ],
259
- "price":325000,
260
- "weight":800,
261
- "compare_at_price":325000,
262
- "inventory_management":"shopify",
263
- "barcode":"6814335325661",
264
- "requires_selling_plan":false,
265
- "selling_plan_allocations":[
266
-
267
- ]
268
- },
269
- {
270
- "id":39873050837058,
271
- "title":"S",
272
- "option1":"S",
273
- "option2":null,
274
- "option3":null,
275
- "sku":"ACHSSJUL18-S",
276
- "requires_shipping":true,
277
- "taxable":true,
278
- "featured_image":null,
279
- "available":true,
280
- "name":"Surkh Shibori Cotton Dress - S",
281
- "public_title":"S",
282
- "options":[
283
- "S"
284
- ],
285
- "price":325000,
286
- "weight":800,
287
- "compare_at_price":325000,
288
- "inventory_management":"shopify",
289
- "barcode":"3565335325661",
290
- "requires_selling_plan":false,
291
- "selling_plan_allocations":[
292
-
293
- ]
294
- }
295
- ],
296
- "images":[
297
- "\/\/cdn.shopify.com\/s\/files\/1\/2542\/7564\/products\/40_8146ee2f-7a8a-43b3-9b1d-d170823cf30b.png?v=1659631263",
298
- "\/\/cdn.shopify.com\/s\/files\/1\/2542\/7564\/products\/38_673c4d81-d87f-4260-a819-2c3b93d7b9fa.png?v=1659631263",
299
- "\/\/cdn.shopify.com\/s\/files\/1\/2542\/7564\/products\/39_2e96c511-8984-4576-b6b6-530374b63d47.png?v=1659631263",
300
- "\/\/cdn.shopify.com\/s\/files\/1\/2542\/7564\/products\/41_0a2700f3-e376-4d09-a646-9f93bfd44653.png?v=1659619266",
301
- "\/\/cdn.shopify.com\/s\/files\/1\/2542\/7564\/products\/42_00bb615d-361a-4964-bae2-ff35e8111c25.png?v=1659619266",
302
- "\/\/cdn.shopify.com\/s\/files\/1\/2542\/7564\/products\/43_26802366-7c42-42db-a467-ba417fde4fe6.png?v=1659619271",
303
- "\/\/cdn.shopify.com\/s\/files\/1\/2542\/7564\/products\/44_8d0268e9-e6c7-4913-81f5-a4ba90435199.png?v=1659619271"
304
- ],
305
- "featured_image":"\/\/cdn.shopify.com\/s\/files\/1\/2542\/7564\/products\/40_8146ee2f-7a8a-43b3-9b1d-d170823cf30b.png?v=1659631263",
306
- "options":[
307
- {
308
- "name":"Size",
309
- "position":1,
310
- "values":[
311
- "XS",
312
- "S",
313
- "M",
314
- "L",
315
- "XL",
316
- "XXL",
317
- "XXXL",
318
- "4XL",
319
- "5XL"
320
- ]
321
- }
322
- ],
323
- "url":"\/products\/surkh-shibori-cotton-dress",
324
- "media":[
325
- {
326
- "alt":"Surkh Shibori Cotton Dress",
327
- "id":21594143588418,
328
- "position":1,
329
- "preview_image":{
330
- "aspect_ratio":0.8,
331
- "height":3377,
332
- "width":2702,
333
- "src":"https:\/\/cdn.shopify.com\/s\/files\/1\/2542\/7564\/products\/40_8146ee2f-7a8a-43b3-9b1d-d170823cf30b.png?v=1659631263"
334
- },
335
- "aspect_ratio":0.8,
336
- "height":3377,
337
- "media_type":"image",
338
- "src":"https:\/\/cdn.shopify.com\/s\/files\/1\/2542\/7564\/products\/40_8146ee2f-7a8a-43b3-9b1d-d170823cf30b.png?v=1659631263",
339
- "width":2702
340
- },
341
- {
342
- "alt":"Surkh Shibori Cotton Dress",
343
- "id":21594143522882,
344
- "position":2,
345
- "preview_image":{
346
- "aspect_ratio":0.8,
347
- "height":3377,
348
- "width":2702,
349
- "src":"https:\/\/cdn.shopify.com\/s\/files\/1\/2542\/7564\/products\/38_673c4d81-d87f-4260-a819-2c3b93d7b9fa.png?v=1659631263"
350
- },
351
- "aspect_ratio":0.8,
352
- "height":3377,
353
- "media_type":"image",
354
- "src":"https:\/\/cdn.shopify.com\/s\/files\/1\/2542\/7564\/products\/38_673c4d81-d87f-4260-a819-2c3b93d7b9fa.png?v=1659631263",
355
- "width":2702
356
- }
357
- ],
358
- "requires_selling_plan":false,
359
- "selling_plan_groups":[]
360
- }
361
- */
362
- export async function productDetailsDetailed(product, brandDomainContext, whatmoreShopId){
363
-
364
- if(_isAppBrew(brandDomainContext) || _isAppMaker(brandDomainContext) || _isPlobalApps(brandDomainContext)){
365
- return productDetailsShopifyJS(product);
366
- }
367
-
368
- // brandDomainContext == "whatmore"
369
- return {};
370
- }
371
-
372
- /**
373
- * Currently used only for external stores
374
- *
375
- * Sample response:
376
- * {
377
- * 'price': 1234,
378
- * 'compare_at_price': 1355,
379
- * 'currency_code': USD
380
- * }
381
- */
382
- export async function getProductPriceAndCurrencyDetails(product, brandDomainContext, whatmoreShopId){
383
-
384
- if(_isAppBrew(brandDomainContext) || _isAppMaker(brandDomainContext) || _isPlobalApps(brandDomainContext)){
385
- return {};
386
- }
387
-
388
- // brandDomainContext == "whatmore"
389
- return {}
1
+ import { productDetailsShopify, productDetailsShopifyJS } from "../shopify-commands/ShopifyCommands.js";
2
+
3
+
4
+ function _isAppBrew(brandDomainContext){
5
+ return brandDomainContext == "appbrew";
6
+ }
7
+
8
+ function _isAppMaker(brandDomainContext){
9
+ return brandDomainContext == "appmaker";
10
+ }
11
+
12
+ function _isPlobalApps(brandDomainContext){
13
+ return brandDomainContext == "plobalapps";
14
+ }
15
+
16
+ /**
17
+ *
18
+ * @returns
19
+ *
20
+ * {
21
+ "product":{
22
+ "id":6780184559682,
23
+ "title":"Surkh Shibori Cotton Dress",
24
+ "body_html":"\u003cp\u003eBold, beautiful and glamorous, our Surkh Shibori Cotton Dress is perfect for those who like to make a statement wiith their every day style. \u003cbr\u003eColor: Red\/Blue\u003cbr\u003eDress Fabric: Cotton\u003c\/p\u003e\n\u003cp\u003eNeckline: Shirt Collar\u003cbr\u003eSleeve: Balloon\u003cbr\u003eCARE: Dry Clean Only \u003cbr\u003eModel Size: Model is wearing S Size \u003cbr\u003eModel Height: 5'4\"\u003cbr\u003e \u003cbr\u003eDISCLAIMER: Slight Color variations may occur due to different screen resolutions.\u003c\/p\u003e",
25
+ "vendor":"Aachho",
26
+ "product_type":"Dress",
27
+ "created_at":"2022-07-30T14:57:03+05:30",
28
+ "handle":"surkh-shibori-cotton-dress",
29
+ "updated_at":"2023-03-09T18:22:56+05:30",
30
+ "published_at":"2022-08-04T19:05:13+05:30",
31
+ "template_suffix":"",
32
+ "published_scope":"global",
33
+ "tags":"__label:NEW, category_express shipping, category_high, Category_Womenswear, Collection_Dress, Collection_Phulwari, Color_Blue, Color_Red, dress_collection, Fabric_Cotton, High, Neckline_Shirt Collar, OCCASSION_CASUAL, Pattern_Kalidaar, Phulwari, print_tie-\u0026-dye, Sleeves_Balloon, subcategory_dress, Technique_Tie \u0026 Dye",
34
+ "variants":[
35
+ {
36
+ "id":39873050804290,
37
+ "product_id":6780184559682,
38
+ "title":"XS",
39
+ "price":"3250.00",
40
+ "sku":"ACHSSJUL18-XS",
41
+ "position":1,
42
+ "compare_at_price":"3250.00",
43
+ "fulfillment_service":"manual",
44
+ "inventory_management":"shopify",
45
+ "option1":"XS",
46
+ "option2":null,
47
+ "option3":null,
48
+ "created_at":"2022-07-30T14:57:04+05:30",
49
+ "updated_at":"2023-02-22T18:02:08+05:30",
50
+ "taxable":true,
51
+ "barcode":"6814335325661",
52
+ "grams":800,
53
+ "image_id":null,
54
+ "weight":0.8,
55
+ "weight_unit":"kg",
56
+ "requires_shipping":true
57
+ },
58
+ {
59
+ "id":39873050837058,
60
+ "product_id":6780184559682,
61
+ "title":"S",
62
+ "price":"3250.00",
63
+ "sku":"ACHSSJUL18-S",
64
+ "position":2,
65
+ "compare_at_price":"3250.00",
66
+ "fulfillment_service":"manual",
67
+ "inventory_management":"shopify",
68
+ "option1":"S",
69
+ "option2":null,
70
+ "option3":null,
71
+ "created_at":"2022-07-30T14:57:04+05:30",
72
+ "updated_at":"2023-03-09T18:22:56+05:30",
73
+ "taxable":true,
74
+ "barcode":"3565335325661",
75
+ "grams":800,
76
+ "image_id":null,
77
+ "weight":0.8,
78
+ "weight_unit":"kg",
79
+ "requires_shipping":true
80
+ },
81
+ {
82
+ "id":39873050869826,
83
+ "product_id":6780184559682,
84
+ "title":"M",
85
+ "price":"3250.00",
86
+ "sku":"ACHSSJUL18-M",
87
+ "position":3,
88
+ "compare_at_price":"3250.00",
89
+ "fulfillment_service":"manual",
90
+ "inventory_management":"shopify",
91
+ "option1":"M",
92
+ "option2":null,
93
+ "option3":null,
94
+ "created_at":"2022-07-30T14:57:04+05:30",
95
+ "updated_at":"2023-03-04T13:05:45+05:30",
96
+ "taxable":true,
97
+ "barcode":"1707335325661",
98
+ "grams":800,
99
+ "image_id":null,
100
+ "weight":0.8,
101
+ "weight_unit":"kg",
102
+ "requires_shipping":true
103
+ }
104
+ ],
105
+ "options":[
106
+ {
107
+ "id":8825212633154,
108
+ "product_id":6780184559682,
109
+ "name":"Size",
110
+ "position":1,
111
+ "values":[
112
+ "XS",
113
+ "S",
114
+ "M",
115
+ "L",
116
+ "XL",
117
+ "XXL",
118
+ "XXXL",
119
+ "4XL",
120
+ "5XL"
121
+ ]
122
+ }
123
+ ],
124
+ "images":[
125
+ {
126
+ "id":29273280905282,
127
+ "product_id":6780184559682,
128
+ "position":1,
129
+ "created_at":"2022-08-04T18:51:06+05:30",
130
+ "updated_at":"2022-08-04T22:11:03+05:30",
131
+ "alt":"Surkh Shibori Cotton Dress",
132
+ "width":2702,
133
+ "height":3377,
134
+ "src":"https:\/\/cdn.shopify.com\/s\/files\/1\/2542\/7564\/products\/40_8146ee2f-7a8a-43b3-9b1d-d170823cf30b.png?v=1659631263",
135
+ "variant_ids":[
136
+
137
+ ]
138
+ },
139
+ {
140
+ "id":29273280839746,
141
+ "product_id":6780184559682,
142
+ "position":2,
143
+ "created_at":"2022-08-04T18:51:06+05:30",
144
+ "updated_at":"2022-08-04T22:11:03+05:30",
145
+ "alt":"Surkh Shibori Cotton Dress",
146
+ "width":2702,
147
+ "height":3377,
148
+ "src":"https:\/\/cdn.shopify.com\/s\/files\/1\/2542\/7564\/products\/38_673c4d81-d87f-4260-a819-2c3b93d7b9fa.png?v=1659631263",
149
+ "variant_ids":[
150
+
151
+ ]
152
+ },
153
+ {
154
+ "id":29273280872514,
155
+ "product_id":6780184559682,
156
+ "position":3,
157
+ "created_at":"2022-08-04T18:51:06+05:30",
158
+ "updated_at":"2022-08-04T22:11:03+05:30",
159
+ "alt":"Surkh Shibori Cotton Dress",
160
+ "width":2702,
161
+ "height":3377,
162
+ "src":"https:\/\/cdn.shopify.com\/s\/files\/1\/2542\/7564\/products\/39_2e96c511-8984-4576-b6b6-530374b63d47.png?v=1659631263",
163
+ "variant_ids":[
164
+
165
+ ]
166
+ }
167
+ ],
168
+ "image":{
169
+ "id":29273280905282,
170
+ "product_id":6780184559682,
171
+ "position":1,
172
+ "created_at":"2022-08-04T18:51:06+05:30",
173
+ "updated_at":"2022-08-04T22:11:03+05:30",
174
+ "alt":"Surkh Shibori Cotton Dress",
175
+ "width":2702,
176
+ "height":3377,
177
+ "src":"https:\/\/cdn.shopify.com\/s\/files\/1\/2542\/7564\/products\/40_8146ee2f-7a8a-43b3-9b1d-d170823cf30b.png?v=1659631263",
178
+ "variant_ids":[
179
+
180
+ ]
181
+ }
182
+ }
183
+ }
184
+ *
185
+ */
186
+
187
+ export async function productDetails(product, brandDomainContext, whatmoreShopId){
188
+
189
+ if(_isAppBrew(brandDomainContext) || _isAppMaker(brandDomainContext) || _isPlobalApps(brandDomainContext)){
190
+ return productDetailsShopify(product);
191
+ }
192
+
193
+ // brandDomainContext == "whatmore"
194
+ return {};
195
+ }
196
+
197
+
198
+
199
+ /**
200
+ *
201
+ * @returns
202
+ *
203
+ * {
204
+ "id":6780184559682,
205
+ "title":"Surkh Shibori Cotton Dress",
206
+ "handle":"surkh-shibori-cotton-dress",
207
+ "description":"\u003cp\u003eBold, beautiful and glamorous, our Surkh Shibori Cotton Dress is perfect for those who like to make a statement wiith their every day style. \u003cbr\u003eColor: Red\/Blue\u003cbr\u003eDress Fabric: Cotton\u003c\/p\u003e\n\u003cp\u003eNeckline: Shirt Collar\u003cbr\u003eSleeve: Balloon\u003cbr\u003eCARE: Dry Clean Only \u003cbr\u003eModel Size: Model is wearing S Size \u003cbr\u003eModel Height: 5'4\"\u003cbr\u003e \u003cbr\u003eDISCLAIMER: Slight Color variations may occur due to different screen resolutions.\u003c\/p\u003e",
208
+ "published_at":"2022-08-04T19:05:13+05:30",
209
+ "created_at":"2022-07-30T14:57:03+05:30",
210
+ "vendor":"Aachho",
211
+ "type":"Dress",
212
+ "tags":[
213
+ "__label:NEW",
214
+ "category_express shipping",
215
+ "category_high",
216
+ "Category_Womenswear",
217
+ "Collection_Dress",
218
+ "Collection_Phulwari",
219
+ "Color_Blue",
220
+ "Color_Red",
221
+ "dress_collection",
222
+ "Fabric_Cotton",
223
+ "High",
224
+ "Neckline_Shirt Collar",
225
+ "OCCASSION_CASUAL",
226
+ "Pattern_Kalidaar",
227
+ "Phulwari",
228
+ "print_tie-\u0026-dye",
229
+ "Sleeves_Balloon",
230
+ "subcategory_dress",
231
+ "Technique_Tie \u0026 Dye"
232
+ ],
233
+ "price":325000,
234
+ "price_min":325000,
235
+ "price_max":325000,
236
+ "available":true,
237
+ "price_varies":false,
238
+ "compare_at_price":325000,
239
+ "compare_at_price_min":325000,
240
+ "compare_at_price_max":325000,
241
+ "compare_at_price_varies":false,
242
+ "variants":[
243
+ {
244
+ "id":39873050804290,
245
+ "title":"XS",
246
+ "option1":"XS",
247
+ "option2":null,
248
+ "option3":null,
249
+ "sku":"ACHSSJUL18-XS",
250
+ "requires_shipping":true,
251
+ "taxable":true,
252
+ "featured_image":null,
253
+ "available":true,
254
+ "name":"Surkh Shibori Cotton Dress - XS",
255
+ "public_title":"XS",
256
+ "options":[
257
+ "XS"
258
+ ],
259
+ "price":325000,
260
+ "weight":800,
261
+ "compare_at_price":325000,
262
+ "inventory_management":"shopify",
263
+ "barcode":"6814335325661",
264
+ "requires_selling_plan":false,
265
+ "selling_plan_allocations":[
266
+
267
+ ]
268
+ },
269
+ {
270
+ "id":39873050837058,
271
+ "title":"S",
272
+ "option1":"S",
273
+ "option2":null,
274
+ "option3":null,
275
+ "sku":"ACHSSJUL18-S",
276
+ "requires_shipping":true,
277
+ "taxable":true,
278
+ "featured_image":null,
279
+ "available":true,
280
+ "name":"Surkh Shibori Cotton Dress - S",
281
+ "public_title":"S",
282
+ "options":[
283
+ "S"
284
+ ],
285
+ "price":325000,
286
+ "weight":800,
287
+ "compare_at_price":325000,
288
+ "inventory_management":"shopify",
289
+ "barcode":"3565335325661",
290
+ "requires_selling_plan":false,
291
+ "selling_plan_allocations":[
292
+
293
+ ]
294
+ }
295
+ ],
296
+ "images":[
297
+ "\/\/cdn.shopify.com\/s\/files\/1\/2542\/7564\/products\/40_8146ee2f-7a8a-43b3-9b1d-d170823cf30b.png?v=1659631263",
298
+ "\/\/cdn.shopify.com\/s\/files\/1\/2542\/7564\/products\/38_673c4d81-d87f-4260-a819-2c3b93d7b9fa.png?v=1659631263",
299
+ "\/\/cdn.shopify.com\/s\/files\/1\/2542\/7564\/products\/39_2e96c511-8984-4576-b6b6-530374b63d47.png?v=1659631263",
300
+ "\/\/cdn.shopify.com\/s\/files\/1\/2542\/7564\/products\/41_0a2700f3-e376-4d09-a646-9f93bfd44653.png?v=1659619266",
301
+ "\/\/cdn.shopify.com\/s\/files\/1\/2542\/7564\/products\/42_00bb615d-361a-4964-bae2-ff35e8111c25.png?v=1659619266",
302
+ "\/\/cdn.shopify.com\/s\/files\/1\/2542\/7564\/products\/43_26802366-7c42-42db-a467-ba417fde4fe6.png?v=1659619271",
303
+ "\/\/cdn.shopify.com\/s\/files\/1\/2542\/7564\/products\/44_8d0268e9-e6c7-4913-81f5-a4ba90435199.png?v=1659619271"
304
+ ],
305
+ "featured_image":"\/\/cdn.shopify.com\/s\/files\/1\/2542\/7564\/products\/40_8146ee2f-7a8a-43b3-9b1d-d170823cf30b.png?v=1659631263",
306
+ "options":[
307
+ {
308
+ "name":"Size",
309
+ "position":1,
310
+ "values":[
311
+ "XS",
312
+ "S",
313
+ "M",
314
+ "L",
315
+ "XL",
316
+ "XXL",
317
+ "XXXL",
318
+ "4XL",
319
+ "5XL"
320
+ ]
321
+ }
322
+ ],
323
+ "url":"\/products\/surkh-shibori-cotton-dress",
324
+ "media":[
325
+ {
326
+ "alt":"Surkh Shibori Cotton Dress",
327
+ "id":21594143588418,
328
+ "position":1,
329
+ "preview_image":{
330
+ "aspect_ratio":0.8,
331
+ "height":3377,
332
+ "width":2702,
333
+ "src":"https:\/\/cdn.shopify.com\/s\/files\/1\/2542\/7564\/products\/40_8146ee2f-7a8a-43b3-9b1d-d170823cf30b.png?v=1659631263"
334
+ },
335
+ "aspect_ratio":0.8,
336
+ "height":3377,
337
+ "media_type":"image",
338
+ "src":"https:\/\/cdn.shopify.com\/s\/files\/1\/2542\/7564\/products\/40_8146ee2f-7a8a-43b3-9b1d-d170823cf30b.png?v=1659631263",
339
+ "width":2702
340
+ },
341
+ {
342
+ "alt":"Surkh Shibori Cotton Dress",
343
+ "id":21594143522882,
344
+ "position":2,
345
+ "preview_image":{
346
+ "aspect_ratio":0.8,
347
+ "height":3377,
348
+ "width":2702,
349
+ "src":"https:\/\/cdn.shopify.com\/s\/files\/1\/2542\/7564\/products\/38_673c4d81-d87f-4260-a819-2c3b93d7b9fa.png?v=1659631263"
350
+ },
351
+ "aspect_ratio":0.8,
352
+ "height":3377,
353
+ "media_type":"image",
354
+ "src":"https:\/\/cdn.shopify.com\/s\/files\/1\/2542\/7564\/products\/38_673c4d81-d87f-4260-a819-2c3b93d7b9fa.png?v=1659631263",
355
+ "width":2702
356
+ }
357
+ ],
358
+ "requires_selling_plan":false,
359
+ "selling_plan_groups":[]
360
+ }
361
+ */
362
+ export async function productDetailsDetailed(product, brandDomainContext, whatmoreShopId){
363
+
364
+ if(_isAppBrew(brandDomainContext) || _isAppMaker(brandDomainContext) || _isPlobalApps(brandDomainContext)){
365
+ return productDetailsShopifyJS(product);
366
+ }
367
+
368
+ // brandDomainContext == "whatmore"
369
+ return {};
370
+ }
371
+
372
+ /**
373
+ * Currently used only for external stores
374
+ *
375
+ * Sample response:
376
+ * {
377
+ * 'price': 1234,
378
+ * 'compare_at_price': 1355,
379
+ * 'currency_code': USD
380
+ * }
381
+ */
382
+ export async function getProductPriceAndCurrencyDetails(product, brandDomainContext, whatmoreShopId){
383
+
384
+ if(_isAppBrew(brandDomainContext) || _isAppMaker(brandDomainContext) || _isPlobalApps(brandDomainContext)){
385
+ return {};
386
+ }
387
+
388
+ // brandDomainContext == "whatmore"
389
+ return {}
390
390
  }