What's your biggest current challenge? Have your say in Community Polls along the right column.

Re: Problem on the product page

Solved

Problem on the product page

Dawenn
Excursionist
38 0 13

Hello,

 

I have a problem on some product pages, it looks like this:Opera Instantâneo_2024-04-12_114656_tudoconexao.com.png

So it was supposed to be like this:

Opera Instantâneo_2024-04-12_114747_tudoconexao.com.png

How can I resolve this?

tudoconexao.com

Accepted Solution (1)

theycallmemakka
Shopify Partner
1747 425 443

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 %}

 

Support Me: Buy me a Coffee


For quick response - Message Me


Ping me at: theycallmemakka@gmail.com

View solution in original post

Replies 4 (4)

Lucalotz
Shopify Partner
3 0 1

Hi Daniel,

 

can you provide an example on which products that problem appears?
The ones I've checked are working well!

Lucalotz
Shopify Partner
3 0 1

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:

Lucalotz_1-1713001348511.png

 

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!

theycallmemakka
Shopify Partner
1747 425 443

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 %}

 

Support Me: Buy me a Coffee


For quick response - Message Me


Ping me at: theycallmemakka@gmail.com