Callbacks
The widgets support callbacks during the booking lifecycle to allow you to customize or respond to changes.
To register a callback function, initialize a Bta.callbacks
object under the appropriate key. This should be done before the {% render 'bookthatapp-widgets.liquid'
%}
line in theme.liquid:
Variant Changed
Invoked when the selected variant has changed. If your product page does things dynamically like update the price shown when a variant changes, this is the place to hook into.
Bta = {
callbacks: {
variantChanged: function(variant) {
console.log(variant);
}
}
}
Applies to any product widget.
Comments
0 comments
Article is closed for comments.