lib/constants.js
Constants are prefixed with the product category + name + field in all caps snakecase format.
ie: WHITENING
+ _PEN
+ _NAME
Field | Constant | Description | Example |
---|---|---|---|
name |
NAME | Human readable name | Whitening Pen |
label |
LABEL | Snakecase of the display name used for events and keys to objects | whitening_pen |
price |
PRICE | Dollar amount of the product | 30 |
sku |
SKU | product unique identifier | WHITEPEN01 |
product_id |
PRODUCT_ID | product id is only used for the impression kit | 11436401551 |
Possible future fields: category
, variant
, etc.
The above individual constants are used for the PRODUCT_DATA
constants which reads as the following:
const PRODUCT_DATA = {
impression_kit: {
name: 'Modeling Kit',
event: 'modeling_kit`,
price: 95,
product_id: '11436401551',
sku: 'IKFINISHED00002'
},
whitening_pen: {
name: 'Whitening Pen',
event: 'whitening_pen',
price: 30,
product_id: null,
sku: 'WHITEPEN01'
},
straightening_retainers: {
name: 'Straightening Retainers',
event: 'straightening_retainers',
price: 999,
product_id: null,
sku: 'RETAINERS01'
}
};
lib/build-constants.js
PRODUCT_URLS: {
whitening_pen: {
category: 'whitening',
item: 'pen',
},
straightening_retainers: {
category: 'straightening',
item: 'retainers`
}
}
used in lib/routes.js
:
- Whitening Pen:
/teeth/whitening/pen
- Straightening Retainers:
/teeth/straightening/retainers
*Note: The Starter Kit (aka Modeling Kit aka Impression Kit) uses a separate path: /checkout