- API reference
- UI components
Apr 01, 2023
PreviewModal component
On this page
The component class that uses the usf.templates.previewPluginModal template to render the product preview modal.
Properties
| Name | Data type | Description |
|---|---|---|
| args | Object | The preview plugin input arguments. |
| imageUrl | String | The URL of the selected image. |
| imageIndex | Number | The zero-based index of the selected image in the product images list. |
| image | Object | The selected image object. |
| images | Array | The list of product images. |
| quantity | Number | The product quantity. |
| selectedOptions | Object | The selected options. |
| selectedVariant | Object | The selected variant. |
| selectedVariantForPrice read-only |
Object | The selected variant. |
| product read-only |
Object | The previewing product. |
| loc read-only |
Object | {...}The localization object storing localized strings. |
| available read-only |
Number | The quantity of the selected variant. |
| showBigImageNav read-only |
Boolean | Indicates whether to show the big image navigation buttons. |
| showThumbNav read-only |
Boolean | Indicates whether to show the thumb image navigation buttons. |
| productUrl read-only |
String | The URL of the previewing product. |
| hasDiscount read-only |
Boolean | Indicates whether the selectedVariant has a discount. true if it has a discount; otherwise false. |
| isSoldOut read-only |
Boolean | Indicates whether the selectedVariant is sold-out. true if it is sold-out; otherwise false. |
| availableOptions read-only |
Array | The list of product options that are available for purchase. |
| hasAvailableVariant read-only |
Boolean | Indicates whether at least one variant is available for the selected options. |
Methods
| Name | Description |
|---|---|
| onClose | onClose()Invoked when user clicks on X icon to close the popup or hits ESC. |
| onThumbClick | onThumbClick(imageIndex)Invoked when user clicks on a thumb image. imageIndex is the zero-based image index in the images list. |
| onPrevImage | onPrevImage(scroll)Invoked when user clicks on a Prev navigation button. |
| onNextImage | onNextImage(scroll)Invoked when user clicks on a Next navigation button. |
| selectImage | selectImage(imageOrIndex)Selects the specified image object or image index. |
| selectVariant | selectVariant(variant)Selects the specified variant object. |
| selectOptionValue | selectVariant(optionName, optionValue)Selects a product option by name and value. |
14 Days Risk Free Trial. No credit card required. Cancel anytime.
© Sobooster - Privacy Policy