merchandising/refundable-mow-upsell





How to reset a refundable component ...


Reset last component

# 🏠 Properties

Name Type

# 🎰 Slots

Name Default value
            
Show Code
<script src="/components/shared/component-base.js"></script> <script src="/components/refundable-mow-upsell/main.js"></script> <link rel="stylesheet" href="/components/shared/component-base.css" /> <refundable-mow-upsell priceDifference="261"></refundable-mow-upsell> <br/> <refundable-mow-upsell priceDifference="50" maxBonusMiles="75"></refundable-mow-upsell> <br/> <refundable-mow-upsell priceDifference="200" maxBonusMiles="50"></refundable-mow-upsell> <br /> <h1 style="font-size: 200%">How to reset a refundable component ...</h1> <refundable-mow-upsell id="resettableComponent" priceDifference="1111" maxBonusMiles="22"></refundable-mow-upsell> <br/> <auro-button onClick="resetComponent('resettableComponent')">Reset last component</auro-button> <script> const upsell = document.getElementById(`resettableComponent`); resetComponent = (id) => { let currentlyReset = upsell.getAttribute('reset'); currentlyReset = currentlyReset === 'true' ? 'false' : 'true'; upsell.setAttribute("reset", currentlyReset); } </script>