Search.../

onChoiceSelected( )

Adds an event handler that runs when a product option choice is selected.

Description

This function is currently only available for Wix Studio sites.

The onChoiceSelected() function adds an event handler that runs when a site visitor selects a product option choice such as {color: "white", size: "m"}.

The received selectedChoices object contains information about the product option choice that was selected.

Authorization

Request

This endpoint does not take any parameters

Response Object

Returns an empty object.

Status/Error Codes

Was this helpful?

Get the product option choice that was selected

Copy Code
1$w('#myProductPage').onChoiceSelected( (selectedChoices) => {
2 let mySelectedChoices = selectedChoices; // {color: "blue", size: "m"}
3} );