Adding a Cancel Button to Modals
Add a dedicated Cancel button to Subscription Manager pop-up modals for improved user experience
Learn how to add a dedicated Cancel button to pop-up modals in the Subscription Manager to maintain website continuity and improve user experience.
Out of the box, pop-up modals in the Subscription Manager contain a confirm action button and a standard X close button. Sometimes, to keep website continuity, an additional Cancel button is needed. This article walks through adding one.
This article applies to themes using version 0.X of the Subscription Manager. If your theme uses a different version, some features described here may not be available or may differ in behavior. You can find your theme version on the Subscription Manager landing page or in the top right corner of the Theme Editor view.
Applicable Files
The following files contain pop-up modals you can add a Cancel button to:
change-date.liquidchange-shipment-address.liquiddelete-item.liquidpause-subscription.liquidreactivate-subscription.liquidsend-order-now.liquidskip.liquid
Accessing the Advanced Editor
You can access the advanced editor through your Ordergroove Admin:
- Log in to Ordergroove.
- Go to Subscriptions on the top toolbar, and select Subscription Manager.
- Toggle Advanced on the top left.
Support
Some aspects of this article require technical expertise with coding languages. This is self-serve and outside of the normal support policy.
Adding the Cancel Button
Open one of the files listed above. Locate the following <div>:
Inside this <div>, above or below the existing <button> element, add the following:
The end result should look similar to this:
In en-US.json, after "modal_close": "x",, add:
This key also needs to be added to all other language files. In fr-CA.json add:
In es-ES.json add:
In buttons.less, add the following styling:
Default styling is shown in the code example above.