Previewing Giftship on your website before publishing live

Follow

If you want to preview on a test theme before making the changes live - you can add this snippet of code to your live theme, right before the closing </head> tag in your theme.liquid file. Once you wish to set it live, make sure to remove the code from your live theme:

<style>
#gsAppContainer {
display: none !important;
}
/* This hides all of Giftships options on the product page, but you can refine this to hide only certain parts */
</style>


<script type="text/javascript">
var GsLoaded = function(){
var _removeBox = function(){
setTimeout(function(){
var giftship_box = document.getElementById('gsAppContainer');
if(typeof(giftship_box) != 'undefined' && giftship_box != null){
giftship_box.parentNode.removeChild(giftship_box);
} else {
_removeBox();
}
}, 100);
}
_removeBox();
}
// IMPORTANT : This is necessary if you have any options set to required in Giftship, otherwise, customers will not be able to add products to the cart!
// This removes all of Giftships options, but you can refine this to remove only certain options
</script>

To summarize...

- Create a duplicate theme of your site by going to Online Store --> Themes --> Your theme --> Duplicate.

- Go to your live theme, and enter in the code as instructed above in your theme.liquid file.

- Go into the Giftship dashboard and enable the app. 

- Go back to your duplicated them, and press 'Preview'.

You can now view Giftship on your duplicated theme, while it is hidden on your live site. Please remember to remove the code above from your live site, if you want to make Giftship live.

0 out of 0 found this helpful

Comments

0 comments

Please sign in to leave a comment.