Shopify themes, liquid, logos, and UX
The banner is currently displaying above the 'Your Cart' title, and I want it to sit beneath it. The code to customise the banner placement is:
<div class='buckscc-cart-banner'></div>
Can you share a preview Link?
There are many ways to do it and most them require custom coding and editing theme files, I'll share a code that would do the job for you if you want do it your self.
Goto Online Store -> edit code -> search cart.liquid file or main-cart.liquid -> then paste this code below and test it.
<script>
document.addEventListener('DOMContentLoaded', function () {
const cartHeader = document.querySelector('div.cart-header');
const cartBanner = document.querySelector('div.buckscc-cart-banner');
if (cartHeader && cartBanner && cartBanner.parentNode) {
cartBanner.parentNode.insertBefore(cartHeader, cartBanner);
}
});
</script>
Thanks for that, but the code doesn't seem to be working. The banner is still sitting in its original position when I preview it.
It might be because the code is placed in the wrong file. I think cart file must have another other than the ones I gave you. try add this code in theme.liquid file and reload the cart page
No luck with that one either, unfortunately.
Should it look something like this ?
Yes, that's exactly how I would like it to look.
Hey Community 👋 Did you know that March 15th is National Everything You Think Is W...
By JasonH Apr 1, 2025Discover how to increase the efficiency of commerce operations with Shopify Academy's l...
By Jacqui Mar 26, 2025Shopify and our financial partners regularly review and update verification requiremen...
By Jacqui Mar 14, 2025