Customize Wix Stores Using Embedded Scripts
Wix Stores provides placeholders in their default product page where you can extend the functionality by injecting embedded scripts:
Step 1 | Locate the placeholders
Below the product SKU you should find:
1
And at the bottom of the product page you should find:
1
The placeholders are empty divs with data-hooks that allow you to add content to these specific page locations.
Step 2 | Inject data into a placeholder
To inject data into a placeholder, follow these steps:
-
Develop the HTML content or elements you want to insert into the placeholder.
-
Write a JavaScript script to append your content to the relevant placeholder. Ensure your script waits until the page is fully loaded by using the
DOMContentLoaded
event or a similar method. The following example appends a new paragraph to thedetails-placeholder
:Copy1 -
Add the script to your app using an embedded script extension. You can do this with through the Wix Dev Center or via the CLI. For detailed instructions, refer to the following resources:
- Add an Embedded Script Extension to a Self-Hosted App
- Add an Embedded Script Extension Using the Wix CLI
Important: Make sure you append your DOM elements to the placeholder's existing content. Don't replace the content as other apps may be using the same placeholder.