The following slots and APIs are available when building a site plugin for the Product page.
Important: The slots and APIs are different depending on which version of Wix Stores a user has on their site. Your app should include placements for both versions.
The following images show the slots available in the Product page, into which users can add plugins. The locations of slots differ slightly depending on which version of Wix Stores and which page layout a site is using.
Note:
If using the product-page-media-1
slot, it may overlap with the thumbnail images on the left hand side in a desktop view. In this case, we recommend offering settings in your app to control the left padding.
The slots are represented by the following placement
objects:
Provide the following values for each property:
New product page
Key | Value |
---|---|
appDefinitionId | "a0c68605-c2e7-4c8d-9ea1-767f9770e087" |
widgetId | "6a25b678-53ec-4b37-a190-65fcd1ca1a63" |
slotId | ID of the slot you want as displayed in the image above. |
Old product page
Key | Value |
---|---|
appDefinitionId | "1380b703-ce81-ff05-f115-39571d94dfcd" |
widgetId | "13a94f09-2766-3c40-4a32-8edb5acdd8bc" |
slotId | ID of the slot you want as displayed in the image above. |
For example:
Use the Product Plugin API to integrate with the plugin's host, which in this case is the product page.
The API provides data about the current event.
Property | Type | Description |
---|---|---|
productId | string | The ID of the product on the product page. |
selectedVariantId | string | The ID of the selected product variant. This ID is only available after the site visitor picks all required product choices. For example selecting the color and size of the product. Until all required choices are selected, this ID is undefined . |
selectedChoices | object | An object containing all the choices the site visitor picks from the options on the product page. Each key is an option name and each value is the selected option. For example, { color: "green", size: "large" } . |
quantity | number | The number of product items the site visitor wants to buy. The site visitor can increase or decrease this value on the product page. |
customText | string[] | An array of text values entered by the site visitor in custom text fields on the product page. For example, this can be used for personalization, such as adding names to a shirt. Multiple text fields are supported, so each entry in the array corresponds to a different custom text field on the product page. |
In your site plugin or in your app's server code, you may want to perform actions or implement logic that is dependent on the current product or related data.
You can do this using the Wix Stores APIs (Velo, REST, JavaScript SDK).