CaProductQuantity
Used to modify quantity of products
SASS-path: ./styles/components/molecules/ca-product-quantity.scss
Props
Name | Description | Type | Required | Default |
---|
quantity | The quantity to be modified | Number | true | - |
inputDisabled | Used to disable user input in the input field | Boolean | false | false |
maxQuantity | What is the maximum quantity? Stock status | Number | true | - |
minQuantity | What is the minimum quantity? Default 1 | Number | false | 1 |
threshold | Threshold to stop at and emit event. Used for cart vs product page stock handling | Number | false | -1 |
type | Different style types for the counter | default , round , stacked | false | default |
Events
Event Name | Description | Parameters |
---|
changed | Count has been changed | new count (Number) |
thresholdReached | Threshold count reached | - |
maxReached | Max count reached | - |
minReached | Min count reached | - |
Methods
Method | Description | Parameters |
---|
update | Update count | - |
increase | Increase count by one | - |
decrease | Decrease count by one | - |
validateEmpty | If field is empty on blur, set to minimum count | - |
validateInput | Validate count input field. Can only contain number and not be above or below max count | - |