Skip to content

Instantly share code, notes, and snippets.

@unlocomqx
Created January 14, 2026 13:10
Show Gist options
  • Select an option

  • Save unlocomqx/af2ad687f0264d0f64653fbd823f64f4 to your computer and use it in GitHub Desktop.

Select an option

Save unlocomqx/af2ad687f0264d0f64653fbd823f64f4 to your computer and use it in GitHub Desktop.
Document 1:
{
"pageContent": "You can use the getField function to get the properties of a field.\n\njs\n\nwindow.dp.methods.getField(field_name);\nvar props = window.dp.methods.getField(\"width\");\n\nThe value of props will have this shape\n\njs\n\n{\n active: 1\n common: 0\n description: \"\"\n dir: \"/dynamicproduct/images/field\"\n ext: \".jpg\"\n favorite: 0\n force_id: false\n id: 66\n id_group: \"0\"\n id_product: 11\n id_unit: 0\n image_url: null\n init: 0\n label: \"Width\"\n linked: \"0\"\n name: \"width\"\n options: []\n position: \"2\"\n settings: {\n color: null\n dir: null\n display_in_popup: null\n display_secondary_value_price: null\n display_value_price: null\n ext: \".jpg\"\n extensions: null\n extra: null\n force_id: false\n hide_when_empty: 1\n id: null\n id_field: 66\n id_unit: null\n init: null\n max: null\n max_date: null\n max_size: null\n min: null\n min_date: null\n min_height: null\n min_width: null\n multiselect: null\n position: null\n price_unit: null\n required: null\n show_in_summary: 0\n step: 1\n thumb_suffix: \"-thumb.jpg\"\n }\n thumb_suffix: \"-thumb.jpg\"\n thumb_url: null\n type: 1\n unit: {\n dir: null\n displayed: 1\n ext: \".jpg\"\n force_id: false\n id: null\n name: null\n position: null\n symbol: null\n thumb_suffix: \"-thumb.jpg\"\n }\n value: \"\"\n}\n\n\nDETECTING A CALCULATION RESULT",
"metadata": {
"source": "blob",
"blobType": "text/plain",
"loc": {
"lines": {
"from": 83,
"to": 161
}
}
},
"id": "d81b1a77-36fc-40ae-89ff-032b6d553dd2"
}
Document 2:
{
"pageContent": "You can use the getField function to get the properties of a field.\n\njs\n\nwindow.dp.methods.getField(field_name);\nvar props = window.dp.methods.getField(\"width\");\n\nThe value of props will have this shape\n\njs\n\n{\n active: 1\n common: 0\n description: \"\"\n dir: \"/dynamicproduct/images/field\"\n ext: \".jpg\"\n favorite: 0\n force_id: false\n id: 66\n id_group: \"0\"\n id_product: 11\n id_unit: 0\n image_url: null\n init: 0\n label: \"Width\"\n linked: \"0\"\n name: \"width\"\n options: []\n position: \"2\"\n settings: {\n color: null\n dir: null\n display_in_popup: null\n display_secondary_value_price: null\n display_value_price: null\n ext: \".jpg\"\n extensions: null\n extra: null\n force_id: false\n hide_when_empty: 1\n id: null\n id_field: 66\n id_unit: null\n init: null\n max: null\n max_date: null\n max_size: null\n min: null\n min_date: null\n min_height: null\n min_width: null\n multiselect: null\n position: null\n price_unit: null\n required: null\n show_in_summary: 0\n step: 1\n thumb_suffix: \"-thumb.jpg\"\n }\n thumb_suffix: \"-thumb.jpg\"\n thumb_url: null\n type: 1\n unit: {\n dir: null\n displayed: 1\n ext: \".jpg\"\n force_id: false\n id: null\n name: null\n position: null\n symbol: null\n thumb_suffix: \"-thumb.jpg\"\n }\n value: \"\"\n}\n\n\nDETECTING A CALCULATION RESULT",
"metadata": {
"source": "blob",
"blobType": "text/plain",
"loc": {
"lines": {
"from": 83,
"to": 161
}
}
},
"id": "0d93edf7-994e-4b23-81ad-ec0667fcb1c6"
}
Document 3:
{
"pageContent": "You can use the getField function to get the properties of a field.\n\njs\n\nwindow.dp.methods.getField(field_name);\nvar props = window.dp.methods.getField(\"width\");\n\nThe value of props will have this shape\n\njs\n\n{\n\tactive: 1\n\tcommon: 0\n\tdescription: \"\"\n\tdir: \"/dynamicproduct/images/field\"\n\text: \".jpg\"\n\tfavorite: 0\n\tforce_id: false\n\tid: 66\n\tid_group: \"0\"\n\tid_product: 11\n\tid_unit: 0\n\timage_url: null\n\tinit: 0\n\tlabel: \"Width\"\n\tlinked: \"0\"\n\tname: \"width\"\n\toptions: []\n\tposition: \"2\"\n\tsettings: {\n\t\tcolor: null\n\t\tdir: null\n\t\tdisplay_in_popup: null\n\t\tdisplay_secondary_value_price: null\n\t\tdisplay_value_price: null\n\t\text: \".jpg\"\n\t\textensions: null\n\t\textra: null\n\t\tforce_id: false\n\t\thide_when_empty: 1\n\t\tid: null\n\t\tid_field: 66\n\t\tid_unit: null\n\t\tinit: null\n\t\tmax: null\n\t\tmax_date: null\n\t\tmax_size: null\n\t\tmin: null\n\t\tmin_date: null\n\t\tmin_height: null\n\t\tmin_width: null\n\t\tmultiselect: null\n\t\tposition: null\n\t\tprice_unit: null\n\t\trequired: null\n\t\tshow_in_summary: 0\n\t\tstep: 1\n\t\tthumb_suffix: \"-thumb.jpg\"\n\t}\n\tthumb_suffix: \"-thumb.jpg\"\n\tthumb_url: null\n\ttype: 1\n\tunit: {\n\t\tdir: null\n\t\tdisplayed: 1\n\t\text: \".jpg\"\n\t\tforce_id: false\n\t\tid: null\n\t\tname: null\n\t\tposition: null\n\t\tsymbol: null\n\t\tthumb_suffix: \"-thumb.jpg\"\n\t}\n\tvalue: \"\"\n}\n\n\nDETECTING A CALCULATION RESULT\n\nYou can subscribe to the module stores in order to detect the calculation\nresults.\nThe module uses Vegemite stores [https://github.com/lukeed/vegemite] under the\nhood.\n\nCode example:\n\njs",
"metadata": {
"source": "blob",
"blobType": "text/plain",
"loc": {
"lines": {
"from": 83,
"to": 170
}
}
},
"id": "abfc152a-5e48-4e57-b23a-ce03e49bffcb"
}
Document 4:
{
"pageContent": "You can use the getField function to get the properties of a field.\n\njs\n\nwindow.dp.methods.getField(field_name);\nvar props = window.dp.methods.getField(\"width\");\n\nThe value of props will have this shape\n\njs\n\n{\n\tactive: 1\n\tcommon: 0\n\tdescription: \"\"\n\tdir: \"/dynamicproduct/images/field\"\n\text: \".jpg\"\n\tfavorite: 0\n\tforce_id: false\n\tid: 66\n\tid_group: \"0\"\n\tid_product: 11\n\tid_unit: 0\n\timage_url: null\n\tinit: 0\n\tlabel: \"Width\"\n\tlinked: \"0\"\n\tname: \"width\"\n\toptions: []\n\tposition: \"2\"\n\tsettings: {\n\t\tcolor: null\n\t\tdir: null\n\t\tdisplay_in_popup: null\n\t\tdisplay_secondary_value_price: null\n\t\tdisplay_value_price: null\n\t\text: \".jpg\"\n\t\textensions: null\n\t\textra: null\n\t\tforce_id: false\n\t\thide_when_empty: 1\n\t\tid: null\n\t\tid_field: 66\n\t\tid_unit: null\n\t\tinit: null\n\t\tmax: null\n\t\tmax_date: null\n\t\tmax_size: null\n\t\tmin: null\n\t\tmin_date: null\n\t\tmin_height: null\n\t\tmin_width: null\n\t\tmultiselect: null\n\t\tposition: null\n\t\tprice_unit: null\n\t\trequired: null\n\t\tshow_in_summary: 0\n\t\tstep: 1\n\t\tthumb_suffix: \"-thumb.jpg\"\n\t}\n\tthumb_suffix: \"-thumb.jpg\"\n\tthumb_url: null\n\ttype: 1\n\tunit: {\n\t\tdir: null\n\t\tdisplayed: 1\n\t\text: \".jpg\"\n\t\tforce_id: false\n\t\tid: null\n\t\tname: null\n\t\tposition: null\n\t\tsymbol: null\n\t\tthumb_suffix: \"-thumb.jpg\"\n\t}\n\tvalue: \"\"\n}\n\n\nDETECTING A CALCULATION RESULT\n\nYou can subscribe to the module stores in order to detect the calculation\nresults.\nThe module uses Vegemite stores [https://github.com/lukeed/vegemite] under the\nhood.\n\nCode example:\n\njs",
"metadata": {
"source": "blob",
"blobType": "text/plain",
"loc": {
"lines": {
"from": 83,
"to": 170
}
}
},
"id": "c8445b90-f706-48e3-b5e3-cc907da8ce14"
}
Product Configuration:
active: true
required: false
exclude: false
displayed_price: 0
displayed_price_label:
display_starting_from: true
display_dynamic_price: false
display_customization_cost: false
recalc: false
always_recalc: false
display_weight: false
hide_qty: false
multiply_price: false
allow_save: false
split_summary: false
custom_calculation: false
enable_steps: true
all_steps_required: true
ungrouped_fields_on_top: false
Existing Fields:
11:
id: 11
type: Numeric Input
label: Width
options: []
12:
id: 12
type: Slider
label: Slider
options: []
13:
id: 13
type: Dropdown
label: Dropdown
options:
[2]{id,label,value,secondary_value}:
4,Option 1,"1",
5,Option 2,"2",
14:
id: 14
type: Radio buttons
label: Radios
options:
[2]{id,label,value,secondary_value}:
1,Option 1,"1",
2,Option 2,"2",
15:
id: 15
type: Image list
label: Images
options:
[2]{id,label,value,secondary_value}:
2,Option 1,"1",
3,Option 2,"2",
16:
id: 16
type: Checkbox
label: Checkbox
options: []
17:
id: 17
type: Switch
label: Switch input
options: []
18:
id: 18
type: Text
label: Text field
options: []
19:
id: 19
type: Text Area
label: Textarea
options: []
20:
id: 20
type: Date
label: Date field
options: []
21:
id: 21
type: Image
label: Image
options: []
22:
id: 22
type: File
label: File
options: []
23:
id: 23
type: Fixed Value
label: Fixed field
options: []
24:
id: 24
type: Price
label: Price field
options: []
25:
id: 25
type: Dynamic Variable
label: Dynamic
options: []
26:
id: 26
type: Feature
label: Feature
options: []
27:
id: 27
type: Divider
label:
options: []
28:
id: 28
type: Color picker
label: Color
options: []
29:
id: 29
type: Html
label: Html
options: []
30:
id: 30
type: Error message
label: Error
options: []
31:
id: 31
type: Custom field
label: Custom
options: []
32:
id: 32
type: Preview field
label: Preview
options:
[2]{id,label,value,secondary_value}:
1,null,nature-0043,null
2,null,nature-0033,null
33:
id: 33
type: Country
label: Country
options: []
34:
id: 34
type: Font list
label: Fonts
options:
[3]{id,label,value,secondary_value}:
1,Arial,"0",
2,Milkshake,"0",
3,Arruski,"0",
When updating or deleting a field, use the field ID.
When updating or deleting a field option, use the option ID and field ID.
Supported field types:
[24]: Numeric Input,Slider,Dropdown,Radio buttons,Image list,Checkbox,Switch,Text,Text Area,Date,Image,File,Fixed Value,Price,Dynamic Variable,Feature,Divider,Color picker,Html,Error message,Custom field,Preview field,Country,Font list
The Image list type also supports a color list.
Existing Equations:
[]
When creating or updating or deleting an equation, use one of these names: Price, Weight, Quantity, Cost
Use field formulas to assign a formula to a field.
Existing Field Formulas:
[]
When updating or deleting a field formula, use the field formula ID.
Use conditions to show or hide fields, options, groups, or steps based on a formula.
Existing Conditions:
[]
Create a new condition if existing conditions don't meet your needs.
When updating or deleting a condition, use the condition ID.
Use intervals to vary field values based on conditions (ranges or discrete values).
Existing Intervals:
[]
Formulas are keyed by {id_interval_field}-{id_condition_group}.
Use grids to vary field values based on two other fields (2D lookup table).
Existing Grids:
[]
Grid values are keyed by {id_row}-{id_column}.
Available Field Groups:
[]
Product Field Groups (already added):
[]
Use add_field_group with id_group, delete_field_group with id.
Available Steps:
[]
Product Steps (already added):
[]
Use add_step with id_step, delete_step with id.
You may need to enable custom calculation order if needed and add calculation items in the logical order.
Custom calculation order is DISABLED. Default order: intervals, field_formulas, grids, conditions.
IMPORTANT: Do not use == for logical conditions. You must use = only.
Question: does the width field exist?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment