Hide the Price Summary Section on the First Step of the Gift Card Pro Builder Form

On the first step of the Gift Card Pro builder, a price summary section is present. If you feel that this will be confusing for your customers, you can opt to hide this dynamically.

Above the closing </body> tag in your theme.liquid file, add this snippet of code:

<script>
if (window.location.pathname !== "/a/gc/gift-card/") {
document.querySelector('#gcpRoot').classList.add('loaded');
}

document.addEventListener('gcp-page-loaded', function() {
var currentPage = window.GCPSDK.page.get();

if (currentPage.step === "greeting_card") {
document.querySelector('.gc__flex-section').style.visibility='hidden';
document.querySelector('#gcpRoot').classList.add('loaded');
}
});

document.addEventListener('gcp-form-changed', function() {
var currentPage = window.GCPSDK.page.get();

if (currentPage.step === "greeting_card") {
document.querySelector('.gc__flex-section').style.visibility='hidden';
} else {
document.querySelector('.gc__flex-section').style.visibility='visible';
}
});
</script>

With this in place, the price summary on the first step of the builder will not display.

Can't find the answer in our documentation?
Contact Support