Widgets
Widgets are dynamic UI components based on schemas, encompassing elements like sliders and banners that are deployable within the storefront. These elements can also store information regarding product collections and can be used for displaying products on the storefront. Widgets are formally defined within Omnitron and can be retrieved by querying them using their unique widget slug identifier.
Model
Widget
name
CharField
The name of the widget.
slug
SlugField
A unique slug for identifying the widget.
template
SlugField
The template used for rendering the widget.
widget_type
WidgetType
The widget type that holds the widget's schema.
created_date
DateTimeField
The date when the widget was created.
modified_date
DateTimeField
The date when the widget was last modified.
attributes
JSONField
Attributes of the widget.
attributes_kwargs
JSONField
Information about the widget's attributes.
content_type
ContentType
The content type of the widget.
localized_attributes
JSONField
Localized attributes specific to the widget.
localized_attributes_kwargs
JSONField
Information about localized attributes.
ProductCollectionWidget
name
CharField
The name of the widget.
slug
SlugField
A unique slug for identifying the widget.
template
SlugField
The template used for rendering the widget.
product_collection
ProductCollection
The product collection linked to the widget.
product_limit
PositiveIntegerField
The maximum number of products to display in the widget.
widget_type
WidgetType
The widget type that holds the widget's schema.
created_date
DateTimeField
The date when the widget was created.
modified_date
DateTimeField
The date when the widget was last modified.
attributes
JSONField
Attributes of the widget.
attributes_kwargs
JSONField
Information about the widget's attributes.
content_type
ContentType
The content type of the widget.
localized_attributes
JSONField
Localized attributes specific to the widget.
localized_attributes_kwargs
JSONField
Information about localized attributes.
Endpoints
GET
Retrieve a Widget Info
GET
Retrieve a Widget InfoThis method is used to get widget information that have been defined in Omnitron.
Path: https://{commerce_url}/widgets/<widget-slug>/
Example Response
Here's an example response of a product collection widget:
Here's an example response of a simple widget:
Was this helpful?