Event Listeners
There are the events that are activated during the lifecycle of the Smart Cart. As the Smart Cart is an extension of the cart object, several of the Cart events can be employed to assist in extra functionalities, such as the 'rebuy:cart.change' event. This event becomes useful when conditional updates are required for items that are either present or absent in the cart.
Furthermore, these events can be accessed as anonymous functions within the Smart Cart settings, located in the 'Advanced' section at the bottom of the settings page. This approach eliminates the necessity for modifications to the theme code, allowing these functions to be enabled or disabled with a simple button click.
Many developers have utilized these events to offer additional manipulation or creation of the Document Object Model (DOM) without resorting to a custom template for the Smart Cart. If necessary, adjustments to the data within the Smart Cart function can also be made to manipulate the Smart Cart settings."
Smart Cart Event Callbacks
Instance-based event callbacks are automatically activated when specific events occur, enabling you to associate these events with your theme. In other words, when certain actions take place, these callbacks are automatically set into motion without you having to manually initiate them. This capability allows you to establish a connection between events and the visual presentation or behavior of your theme.
Enabling Smart Cart Advanced Settings
Access the settings option:
In the left navigation bar in the Smart Cart settings, scroll down and click on the "Settings" option at the bottom.
Locate the advanced settings:
Within the settings, you will find an "Advanced Settings" section.
Enable or disable advanced settings:
Adjust the advanced settings according to your preferences which include:
Theme selectors
Cart attribution tracking
Custom CSS
Event listeners
Custom templates
Event Listeners & Callback Capabilities
For more information on our current event listeners and callbacks, you can review our developer documentation which will outline what each of the available options does.