You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -12,7 +12,126 @@ In order to simplify the flow of adding different type of products to wishlist a
12
12
- Options are sets of predefined values that a buyer can add to cart/wishlist in addition to a product.
13
13
- The difference between wish list and cart payloads is that all fields in wishlist are optional.
14
14
15
-
### Examples
15
+
### Options
16
+
17
+
Each product may have options. Option can be of 2 types (see example below):
18
+
-`selected_options` - predefined and selected by customer option. E.g. it can be customizable option: `color: green` or bundle option: `Memory: 24M, Warranty: 1y`:
19
+
```
20
+
"selected_options" : [
21
+
"Y3VzdG9tLW9wdGlvbi8yNC80Mg=="
22
+
],
23
+
```
24
+
-`entered_options` - option entered by customer like: text field, image, etc.
25
+
```
26
+
"entered_options": [
27
+
{
28
+
id: "Y3VzdG9tLW9wdGlvbi8zMQ==",
29
+
value: "Vasia's awesome cup"
30
+
}
31
+
]
32
+
```
33
+
34
+
We can consider "Selected Option" and "ID for Entered Option" as UUID. They meet the criteria:
35
+
36
+
- "Selected Option" represents option value, while "ID for Entered Option" represents option
37
+
- Must be unique across different options
38
+
- Returned from server
39
+
- Used by client as is
40
+
41
+
Selected options can be used for:
42
+
- Customizable options such as dropdwon, radiobutton, checkbox, etc
43
+
- Configugrable product
44
+
- Bundle Product
45
+
- Downloadable product
46
+
- Groupped product
47
+
48
+
Entered options:
49
+
- Customizable options such as text field, file, etc
50
+
- Gift Card (amount)
51
+
52
+
#### Option implementation
53
+
54
+
Product schema should be extended in order to provide option identifier (aka first iteration of "UUID").
55
+
Until introducing UUID lets name this identifier as *"id_v2"
56
+
57
+
Option *id_v2* is `base64` encoded string, that encodes details for each option and in most cases can be presented as
For example, for customizable drop-down option "Color(id = 1), with values Red(id = 1), Green(id = 2)" id_v2 for Color:Red will looks like `"Y3VzdG9tLW9wdGlvbi8xLzE=" => base64("custom-option/1/1")`
60
+
61
+
Here is a GQL query that shows how to add a new field "id_v2: String!" to cover existing cases:
0 commit comments