Home

UpCart-Cart Drawer: Implementation

Shopify App Store

Settings

UpCart-Cart Drawer

Code

Show Code

_38
<style>
_38
.memberr-sc-toggle-wrapper {
_38
display: flex;
_38
align-items: center;
_38
justify-content: space-between;
_38
margin-bottom: 11px;
_38
}
_38
</style>
_38
_38
<memberr-if-has-store-credit style="width: 100%;">
_38
<div class="memberr-sc-toggle-wrapper">
_38
<span>
_38
<memberr-current-store-credit-balance></memberr-current-store-credit-balance>
_38
<memberr-store-credit-name></memberr-store-credit-name> anwenden
_38
</span>
_38
<memberr-store-credit-toggle
_38
active-color="#000000"
_38
height="24"
_38
width="48"
_38
initial-state="{% if cart.attributes.memberr_apply_store_credit == 'Yes' %}true{% else %}false{% endif %}"
_38
style="height: 24px;"
_38
></memberr-store-credit-toggle>
_38
</div>
_38
</memberr-if-has-store-credit>
_38
_38
<script>
_38
document.addEventListener('memberr-toggle:change', () => {
_38
// Try the original method
_38
if (typeof window.upcartRefreshCart === 'function') {
_38
console.log('found calling upcartRefreshCart()');
_38
window.upcartRefreshCart();
_38
} else {
_38
console.log('upcartRefreshCart is not a function');
_38
}
_38
}, {
_38
bubbles: true
_38
});
_38
</script>