Wix Blocks is open to all Wix Studio users. To get access to Blocks, join Wix Studio.
Add an event when you want to provide information about actions that happen in the widget to the site owner. For example, when a customer adds a product to the cart.
To add a new event:
3. Name your event and provide a description.
4. Fire the event from your widget code.
Use this syntax:
$widget.fireEvent('eventName', {eventObject})
.
Define the condition for firing the evnet and, optionally, send event data. For example:
5. You can catch your event from two places
Note: Don't Forget to Document
Make sure to document your widget API by describing any property, event or function you add to it. These descriptions are available to site creators who install your widget.