All Collections
App: Gift Box
How To's
How to disable Gift Box on specific pages or themes?
How to disable Gift Box on specific pages or themes?

Disable the app on specific themes or pages while keeping it active in others.

Ralph Trinidad avatar
Written by Ralph Trinidad
Updated over a week ago

Sometimes you might want to test the app on an unpublished theme while having it disabled on your current theme, or the other way around. To do so, please insert the following script:

<script>
var DISABLE_GIFT_BOX = "true";
</script>

to part of your template based on whether you need to disable Gift Box on certain pages or theme as a whole.

Disable Gift Box on Specific Pages

Insert the script above to the index.liquid, collection.liquid, product.liquid, cart.liquid, page.liquid, and main-page.liquid files in your theme code. Based on which page type you would like to disable it.

Disable Gift Box Theme-wide

To disable the app on all pages in your theme, simply add the script above to the theme.liquid file.

After doing that, the app shouldn't be visible on the theme where you inserted the script, but it should work on the other themes you have in your store.

Did this answer your question?