From c9506468d0aa3620dcf770372e0a5f2f2323f891 Mon Sep 17 00:00:00 2001 From: Ola Date: Mon, 28 Feb 2022 11:42:32 +0100 Subject: [PATCH] #86672 update addToCardButton selector so that validation works properly when clicking add to cart sticky --- Amasty_GiftCard/requirejs-config.js | 10 ++++++++++ Amasty_GiftCard/web/js/giftcard-mixin.js | 13 +++++++++++++ 2 files changed, 23 insertions(+) create mode 100644 Amasty_GiftCard/requirejs-config.js create mode 100644 Amasty_GiftCard/web/js/giftcard-mixin.js diff --git a/Amasty_GiftCard/requirejs-config.js b/Amasty_GiftCard/requirejs-config.js new file mode 100644 index 000000000..206514d68 --- /dev/null +++ b/Amasty_GiftCard/requirejs-config.js @@ -0,0 +1,10 @@ +/* eslint-disable no-unused-vars */ +var config = { + config: { + mixins: { + 'Amasty_GiftCard/js/giftcard': { + 'Amasty_GiftCard/js/giftcard-mixin': true + } + } + } +}; diff --git a/Amasty_GiftCard/web/js/giftcard-mixin.js b/Amasty_GiftCard/web/js/giftcard-mixin.js new file mode 100644 index 000000000..1d73dac24 --- /dev/null +++ b/Amasty_GiftCard/web/js/giftcard-mixin.js @@ -0,0 +1,13 @@ +define([], function () { + 'use strict'; + + return function (Component) { + return Component.extend({ + defaults: { + element: { + addToCardButton: '.tocart', + } + } + }); + }; +});