I am looking to add a coverage service to my products on my Suite Commerce Advanced Store.
Scenario: A customer visits the product page, they like the item they want, but they also want to add additional coverage.
My idea is that if the customer checks the box, then I can somehow edit the the add-to-cart function to include the service item's Internal ID.
HTML
<div class="form-check form-switch">
<input class="form-check-input" type="checkbox" id="addwarranty" name="darkmode" value="yes">
<label class="form-check-label" for="addwarranty"><strong>Add Warranty!</strong> <a href="#" target="_blank">Learn more</a></label>
</div>
JS
var wntid = "123456";
$('#addwarranty').change(function(){
if (this.checked) {
//alert('warranty checked');
// Update add-to-cart event to include wntid
}
});
I looked in the shopping.js file, but it only has the event and not the function.
Is there another JS file I should be looking at? Is there a way I can get this from the web developer console?