We're moving the community! Starting July 7, the current community will be read-only for approx. 2 weeks. You can browse content, but posting will be temporarily unavailable. Learn more

Re: Title + description above main product image on mobile

Solved

Title + description above main product image on mobile

Ryan1998
Pathfinder
101 2 32

Could someone help with me please. How do I get it so Title + description above main product image on mobile. Will tip. Url: https://errival.com/products/errival%E2%84%A2-instant-period-cramp-relief-heated-belt

Screenshot 2024-06-28 at 18.43.02.png

Accepted Solutions (3)
BSSCommerce-HDL
Shopify Partner
2305 835 907

This is an accepted solution.

@Ryan1998

Can you kindly share your collaborator request code from the Users and permissions page?

That's really essential before we can send you a request to check the settings at your store in order to support you in adding the code.

Sale banner, pop ups: Customize your sale banner, pop-ups and create countdown bar to boost conversion rate.
Simicart: Transform your Shopify store into a stunning and fully functional mobile app with just a few simple steps.
Product Labels & Badges:
Get more sales with striking labels, badges, and banners from our 10,000+ available templates.

BSS Commerce - Full-service eCommerce Agency | Use Shopify for 1$ in the first month now

View solution in original post

BSSCommerce-HDL
Shopify Partner
2305 835 907

This is an accepted solution.

Hi @Ryan1998, Pls try again with this code: 

 <script>
 let prd_title = document.querySelector('.product__title');
 let prd_description = document.querySelector('.product__description');
 let section_prd =  document.querySelector('.product');
 if(prd_title && prd_description && section_prd) {
   
 let initialTitleParent = prd_title.parentNode;
 let initialTitleNextSibling = prd_title.nextSibling;
 let initialDescriptionParent = prd_description.parentNode;
 let initialDescriptionNextSibling = prd_description.nextSibling;
 if(window.innerWidth < 749) {
   section_prd.insertAdjacentElement("afterbegin", prd_description);
   section_prd.insertAdjacentElement("afterbegin", prd_title);
 }
 window.addEventListener('resize', () => {
    if (window.innerWidth < 749) {
        section_prd.insertAdjacentElement("afterbegin", prd_description);
        section_prd.insertAdjacentElement("afterbegin", prd_title);
    } else {
      if (initialTitleParent && initialTitleNextSibling) {
        initialTitleParent.insertBefore(prd_title, initialTitleNextSibling);
      } else if (initialTitleParent) {
        initialTitleParent.appendChild(prd_title);
      }

      if (initialDescriptionParent && initialDescriptionNextSibling) {
        initialDescriptionParent.insertBefore(prd_description, initialDescriptionNextSibling);
      } else if (initialDescriptionParent) {
        initialDescriptionParent.appendChild(prd_description);
      }
    }
 });
}
</script>

Hope this can help you 😍

Sale banner, pop ups: Customize your sale banner, pop-ups and create countdown bar to boost conversion rate.
Simicart: Transform your Shopify store into a stunning and fully functional mobile app with just a few simple steps.
Product Labels & Badges:
Get more sales with striking labels, badges, and banners from our 10,000+ available templates.

BSS Commerce - Full-service eCommerce Agency | Use Shopify for 1$ in the first month now

View solution in original post

BSSCommerce-HDL
Shopify Partner
2305 835 907

This is an accepted solution.

Hi @Ryan1998, i edited my code a bit and this new code: 

@media screen and (min-width: 740px) {
  .product-media-container.media-type-image {
    margin: 0 !important;
    width: 100%;
}


.shopify-section.section:has(.product) > section {
    padding: 0 !important;
}

.product__info-wrapper.grid__item {
    padding: 20px 170px 20px 240px;
}


.page-width:has(.product) {
  padding: 0 5rem 0 0 !important;
}
}

@media only screen and (max-width: 739px) {
  .product__description p {
     text-align: center !important; 
  }
}

Hope this can help you 😍

Sale banner, pop ups: Customize your sale banner, pop-ups and create countdown bar to boost conversion rate.
Simicart: Transform your Shopify store into a stunning and fully functional mobile app with just a few simple steps.
Product Labels & Badges:
Get more sales with striking labels, badges, and banners from our 10,000+ available templates.

BSS Commerce - Full-service eCommerce Agency | Use Shopify for 1$ in the first month now

View solution in original post

Replies 11 (11)

BSSCommerce-HDL
Shopify Partner
2305 835 907

Hi @Ryan1998, Can you describe it to us in more detail? Please take a photo for me

Sale banner, pop ups: Customize your sale banner, pop-ups and create countdown bar to boost conversion rate.
Simicart: Transform your Shopify store into a stunning and fully functional mobile app with just a few simple steps.
Product Labels & Badges:
Get more sales with striking labels, badges, and banners from our 10,000+ available templates.

BSS Commerce - Full-service eCommerce Agency | Use Shopify for 1$ in the first month now

Ryan1998
Pathfinder
101 2 32

See the image I have sent. Im want to put the product title + description above the product image in which you see in that picture. Like this:

PHOTO-2024-06-28-19-14-40.jpg

 

BSSCommerce-HDL
Shopify Partner
2305 835 907

Hi @Ryan1998

Step 1: Go to Shopify Admin -> Online Store ->Theme -> Edit code

BSSCommerceHDL_0-1719600117693.png

 

Step 2: Search file theme.liquid

Step 3: Insert this code above </body> tag: 

BSSCommerceHDL_1-1719600176371.png

 

<script>
 let prd_title = document.querySelector('.product__title');
 let prd_description = document.querySelector('.product__description');
 let section_prd =  document.querySelector('.product');

 let initialTitleParent = prd_title.parentNode;
 let initialTitleNextSibling = prd_title.nextSibling;
 let initialDescriptionParent = prd_description.parentNode;
 let initialDescriptionNextSibling = prd_description.nextSibling;
 
 window.addEventListener('resize', () => {
    if (window.innerWidth < 470) {
      if (section_prd && prd_title && prd_description) {
        section_prd.insertAdjacentElement("afterbegin", prd_description);
        section_prd.insertAdjacentElement("afterbegin", prd_title);
      }
    } else {
      if (initialTitleParent && initialTitleNextSibling) {
        initialTitleParent.insertBefore(prd_title, initialTitleNextSibling);
      } else if (initialTitleParent) {
        initialTitleParent.appendChild(prd_title);
      }

      if (initialDescriptionParent && initialDescriptionNextSibling) {
        initialDescriptionParent.insertBefore(prd_description, initialDescriptionNextSibling);
      } else if (initialDescriptionParent) {
        initialDescriptionParent.appendChild(prd_description);
      }
    }

 });
});
  
</script>

 

Here is result: 

BSSCommerceHDL_2-1719600237550.png

 

Hope this can help you,

If our suggestions are useful, please let us know by giving it a like or marking it as a solution. Thank you 😍

 

Sale banner, pop ups: Customize your sale banner, pop-ups and create countdown bar to boost conversion rate.
Simicart: Transform your Shopify store into a stunning and fully functional mobile app with just a few simple steps.
Product Labels & Badges:
Get more sales with striking labels, badges, and banners from our 10,000+ available templates.

BSS Commerce - Full-service eCommerce Agency | Use Shopify for 1$ in the first month now

Ryan1998
Pathfinder
101 2 32

Thanks for the quick response!

Ive done that but doesnt seem to be working what could it be that I have done wrong

Screenshot 2024-06-28 at 19.55.10.png

Screenshot 2024-06-28 at 19.55.47.png

  

BSSCommerce-HDL
Shopify Partner
2305 835 907

This is an accepted solution.

@Ryan1998

Can you kindly share your collaborator request code from the Users and permissions page?

That's really essential before we can send you a request to check the settings at your store in order to support you in adding the code.

Sale banner, pop ups: Customize your sale banner, pop-ups and create countdown bar to boost conversion rate.
Simicart: Transform your Shopify store into a stunning and fully functional mobile app with just a few simple steps.
Product Labels & Badges:
Get more sales with striking labels, badges, and banners from our 10,000+ available templates.

BSS Commerce - Full-service eCommerce Agency | Use Shopify for 1$ in the first month now

BSSCommerce-HDL
Shopify Partner
2305 835 907

This is an accepted solution.

Hi @Ryan1998, Pls try again with this code: 

 <script>
 let prd_title = document.querySelector('.product__title');
 let prd_description = document.querySelector('.product__description');
 let section_prd =  document.querySelector('.product');
 if(prd_title && prd_description && section_prd) {
   
 let initialTitleParent = prd_title.parentNode;
 let initialTitleNextSibling = prd_title.nextSibling;
 let initialDescriptionParent = prd_description.parentNode;
 let initialDescriptionNextSibling = prd_description.nextSibling;
 if(window.innerWidth < 749) {
   section_prd.insertAdjacentElement("afterbegin", prd_description);
   section_prd.insertAdjacentElement("afterbegin", prd_title);
 }
 window.addEventListener('resize', () => {
    if (window.innerWidth < 749) {
        section_prd.insertAdjacentElement("afterbegin", prd_description);
        section_prd.insertAdjacentElement("afterbegin", prd_title);
    } else {
      if (initialTitleParent && initialTitleNextSibling) {
        initialTitleParent.insertBefore(prd_title, initialTitleNextSibling);
      } else if (initialTitleParent) {
        initialTitleParent.appendChild(prd_title);
      }

      if (initialDescriptionParent && initialDescriptionNextSibling) {
        initialDescriptionParent.insertBefore(prd_description, initialDescriptionNextSibling);
      } else if (initialDescriptionParent) {
        initialDescriptionParent.appendChild(prd_description);
      }
    }
 });
}
</script>

Hope this can help you 😍

Sale banner, pop ups: Customize your sale banner, pop-ups and create countdown bar to boost conversion rate.
Simicart: Transform your Shopify store into a stunning and fully functional mobile app with just a few simple steps.
Product Labels & Badges:
Get more sales with striking labels, badges, and banners from our 10,000+ available templates.

BSS Commerce - Full-service eCommerce Agency | Use Shopify for 1$ in the first month now

Ryan1998
Pathfinder
101 2 32

Is this something you'd be able to do. See how the product images are in the corner. And then the text is aligned like that on desktop. Ill gladly tip more. 

Screenshot 2024-06-28 at 20.34.17.png

BSSCommerce-HDL
Shopify Partner
2305 835 907

Hi @Ryan1998, Pls insert this code to your file css: 

@media screen and (min-width: 740px) {
  .product-media-container.media-type-image {
    margin: 0 !important;
}


.shopify-section.section:has(.product) > section {
    padding: 0 !important;
}

.product__info-wrapper.grid__item {
    padding: 20px 0 20px 80px;
}


.page-width:has(.product) {
  padding: 0 5rem 0 0 !important;
}
}

Hope this can help you 😍

Sale banner, pop ups: Customize your sale banner, pop-ups and create countdown bar to boost conversion rate.
Simicart: Transform your Shopify store into a stunning and fully functional mobile app with just a few simple steps.
Product Labels & Badges:
Get more sales with striking labels, badges, and banners from our 10,000+ available templates.

BSS Commerce - Full-service eCommerce Agency | Use Shopify for 1$ in the first month now

Ryan1998
Pathfinder
101 2 32

yes 🙌

BSSCommerce-HDL
Shopify Partner
2305 835 907

This is an accepted solution.

Hi @Ryan1998, i edited my code a bit and this new code: 

@media screen and (min-width: 740px) {
  .product-media-container.media-type-image {
    margin: 0 !important;
    width: 100%;
}


.shopify-section.section:has(.product) > section {
    padding: 0 !important;
}

.product__info-wrapper.grid__item {
    padding: 20px 170px 20px 240px;
}


.page-width:has(.product) {
  padding: 0 5rem 0 0 !important;
}
}

@media only screen and (max-width: 739px) {
  .product__description p {
     text-align: center !important; 
  }
}

Hope this can help you 😍

Sale banner, pop ups: Customize your sale banner, pop-ups and create countdown bar to boost conversion rate.
Simicart: Transform your Shopify store into a stunning and fully functional mobile app with just a few simple steps.
Product Labels & Badges:
Get more sales with striking labels, badges, and banners from our 10,000+ available templates.

BSS Commerce - Full-service eCommerce Agency | Use Shopify for 1$ in the first month now

BuriedInWork
Tourist
25 0 2

I'm trying to implement the same solution, but have a fairly large gap at the top above the title. Any ideas how to shrink it? I made sure that padding for the section is set to 0.

 

BuriedInWork_0-1729007272706.png