Product form event
Product form Add To Cart before submit.
document.addEventListener('smind:product-form:before-submit', (event) => {
try {
const formData = event.detail.formData;
if (this.sectionId === formData.get('section-id')) {
formData.append('custom_key', custom_value);
}
} catch (error){
console.log('error: ', error)
}
});custom_value: This is the element you want to add to the Smind add-to-cart form.document.addEventListener('smind:product-form:submit-complete', (event) => {
try {
// Handle the action you want to perform after adding to cart here.
} catch (error) {
console.log('error: ', error
}
})Last updated