Using Empire theme -- Need to remove first featured photo on product page.

Solved
Highlighted
Shopify Partner
5 1 1

Using Empire theme -- Need to remove first featured photo on product page. But want to keep first image on collections page.

URL - https://pdwnb9m1criullf5-21787377764.shopifypreview.com

0 Likes
Highlighted
Shopify Partner
5 1 1

https://community.shopify.com/c/Shopify-Design/Want-a-different-Featured-photo-on-product-page-than-... --- used this link to do it.

In the product.liquid template,

replace this line:

{% assign featured_image = product.selected_or_first_available_variant.featured_image | default: product.featured_image %}

with this:

{% assign featured_image = product.images[1] | default: product.featured_image %}

This will grab the second uploaded image (the one right after the featured image) to show as the main image on the product page.

 

but need to remove first picture completely from the product pages, provided that if only 1 image, it should show up as fine.

 

 

My code -- 

 

{%- assign featured_image = product.images[1]| default: product.featured_image -%}

{%- unless product.empty? -%}
  <div
    data-product-images
    data-zoom="{{ settings.product_zoom_enable }}"
    data-has-slideshow="true">
    <div class="product__photos product__photos-{{ section_id }} product__photos--{{ thumbnail_position }}">

      <div class="product__main-photos" data-aos>
        <div id="ProductPhotos-{{ section_id }}">
          {%- for image in product.images -%}
            {%- assign is_featured = false -%}
            {%- if featured_image == image -%}
              {%- assign is_featured = true -%}
            {%- endif -%}
            {%- assign image_alt = image.alt -%}
            {%- assign has_product_video = false -%}
            {%- assign video_type = '' -%}
            {%- if image.alt contains 'youtube.com/watch' -%}

 

0 Likes
Highlighted
Shopify Partner
5 1 1

This is an accepted solution.

{%- if product.images.size > 1 -%}
{%- for image in product.images offset:1 -%}

-- picked from here

https://community.shopify.com/c/Shopify-Design/Hide-Featured-image-from-product-page/td-p/80963#:~:t....

 

used offset and working now.

0 Likes