All things Shopify and commerce
I am trying to make a message appear when a coupon code is applied at checkout in the spot indicated below.
Support advised me that I need to add Javascript to the checkout.liquid layout file and that the javascript should watch the discount code element on the front end for changes and append the message when needed.
Does anyone have experience with this or any ideas on how to get started with the javascript?
Yes, You can add following JS in checkout page
(function($) {
$(document).on("page:load page:change", function() {
// Add your custom code for discount here
});
})(Checkout.$);
That seems to just show the message on checkout page load instead of when the coupon code is applied.
Starting a B2B store is a big undertaking that requires careful planning and execution. W...
By JasonH Sep 23, 2024By investing 30 minutes of your time, you can unlock the potential for increased sales,...
By Jacqui Sep 11, 2024We appreciate the diverse ways you participate in and engage with the Shopify Communi...
By JasonH Sep 9, 2024