Shopify themes, liquid, logos, and UX
Hello,
I have a problem on some product pages, it looks like this:
So it was supposed to be like this:
How can I resolve this?
Solved! Go to the solution
This is an accepted solution.
Hi @Dawenn ,
Please add this code on theme.liquid
{% if product %}
<script>
document.addEventListener("DOMContentLoaded", function() {
const element = document.querySelector('.product-block-list__item.product-block-list__item--info');
const height = element.offsetHeight;
const element2 = document.querySelector('.page__sub-header');
const height2 = element2.offsetHeight;
const h = height + height2 + 200;
document.querySelector('.product-block-list.product-block-list--small').style.minHeight = h + 'px';
});
</script>
{% endif %}
Hi Daniel,
can you provide an example on which products that problem appears?
The ones I've checked are working well!
Seems to be because the buy box element is positioned as absolute. This causes it to overlap the section that sits right below whenever the buttons for choosing your variants switch to a second row when using smaller device widths.
A better way would be to use a grid for positioning that upper section. I got it to work here with a few changes:
But that would require you to change the theme code and also make it responsive for the different Screen sizes.
If you don't feel comfortable with that I think you should seek some help from a theme dev as this is not an easy quick fix.
Hope that helps you a bit!
This is an accepted solution.
Hi @Dawenn ,
Please add this code on theme.liquid
{% if product %}
<script>
document.addEventListener("DOMContentLoaded", function() {
const element = document.querySelector('.product-block-list__item.product-block-list__item--info');
const height = element.offsetHeight;
const element2 = document.querySelector('.page__sub-header');
const height2 = element2.offsetHeight;
const h = height + height2 + 200;
document.querySelector('.product-block-list.product-block-list--small').style.minHeight = h + 'px';
});
</script>
{% endif %}
In today’s interview, we sat down with @BSS-TekLabs to discuss practical strategies for...
By JasonH Nov 13, 2024The year-end shopping spree is around the corner! Is your online store ready for the ...
By JasonH Nov 10, 2024We recently spoke with Zopi developers @Zopi about how dropshipping businesses can enha...
By JasonH Oct 23, 2024