After applying a discount code, it can't be remove, and the discount code stayed in the cookie(as told by Webflow support) even when customer back out of checkout page and go back in.
I’ve struggled a lot with this issue, but I finally came up with a creative solution! The thing is, Webflow only allows one discount code in the cart at a time. So, if you apply a new discount code, it replaces the old one. That got me thinking—what if the new discount code has a 0% discount? Problem solved! 🎉
Here’s how you can do it:
First, create a discount code in your Webflow Ecommerce settings called "NODISCOUNT" and set it to a 0% discount.
Then, add this script to your site to automatically apply it:
Same issue. Even after I have set the code to expire, deactivated and deleted the discount code it stays applied in checkout until I remove all the products.
I’ve struggled a lot with this issue, but I finally came up with a creative solution! The thing is, Webflow only allows one discount code in the cart at a time. So, if you apply a new discount code, it replaces the old one. That got me thinking—what if the new discount code has a 0% discount? Problem solved! 🎉
Here’s how you can do it:
First, create a discount code in your Webflow Ecommerce settings called "NODISCOUNT" and set it to a 0% discount.
Then, add this script to your site to automatically apply it:
<script>
document.addEventListener("DOMContentLoaded", () => {
// Checkout elements
const discountInput = document.getElementById("wf-ecom-discounts");
const applyButton = document.querySelector("[data-ecom-discount-submit]"); // Adjust selector if necessary
// Set the "NODISCOUNT" code
const noDiscountCode = "NODISCOUNT";
// Automatically apply the "NODISCOUNT" code
if (discountInput && applyButton) {
discountInput.value = noDiscountCode;
applyButton.click();
}
});
</script>
Same issue. Even after I have set the code to expire, deactivated and deleted the discount code it stays applied in checkout until I remove all the products.