Skip to content

Commit

Permalink
refactor(sd): SD-10955 remove cart inline event handler
Browse files Browse the repository at this point in the history
  • Loading branch information
rtalvarez committed Feb 3, 2025
1 parent 4ac6945 commit 16aed48
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions assets/js/theme/cart.js
Original file line number Diff line number Diff line change
Expand Up @@ -402,6 +402,10 @@ export default class Cart extends PageManager {
this.bindGiftWrappingForm();
});
});

$('.cart-item-option-remove').on('click', () => {
window.confirm(this.context.giftWrappingRemoveMessage);
});
}

bindGiftWrappingForm() {
Expand Down
2 changes: 1 addition & 1 deletion templates/components/cart/item-giftwrap.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<dd class="cart-item-option-description">
{{gift_wrapping.name}}: {{gift_wrapping.price.formatted}}
<span class="cart-item-option-actions">
(<a href="" data-item-giftwrap="{{id}}">{{lang 'cart.gift_wrapping.change'}}</a> or <a href="{{gift_wrapping.remove_url}}" onclick="return confirm('{{lang 'cart.gift_wrapping.remove_confirm'}}')">{{lang 'cart.gift_wrapping.remove'}}</a>)
(<a href="" data-item-giftwrap="{{id}}">{{lang 'cart.gift_wrapping.change'}}</a> or <a class="cart-item-option-remove" href="{{gift_wrapping.remove_url}}">{{lang 'cart.gift_wrapping.remove'}}</a>)
</span>
</dd>
{{#if gift_wrapping.message}}
Expand Down

0 comments on commit 16aed48

Please sign in to comment.