merchandising/refundable-matrix-upsell
How to reset a refundable component ...
Reset last component
#
🏠 Properties
#
🎰 Slots
Show Code
<script src="/components/shared/component-base.js"></script>
<script src="/components/refundable-matrix-upsell/main.js"></script>
<link rel="stylesheet" href="/components/shared/component-base.css" />
<refundable-matrix-upsell priceDifference="261"></refundable-matrix-upsell>
<br/>
<refundable-matrix-upsell priceDifference="50" maxBonusMiles="75"></refundable-matrix-upsell>
<br/>
<refundable-matrix-upsell priceDifference="200" maxBonusMiles="50"></refundable-matrix-upsell>
<br />
<h1 style="font-size: 200%">How to reset a refundable component ...</h1>
<refundable-matrix-upsell id="resettableComponent" priceDifference="1111" maxBonusMiles="22"></refundable-matrix-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>