Dawn Theme: variant.next_incoming_date issue

Hi All,

I am using the below custom liquid in the Dawn theme to show customers when sold out items are due to arrive if there is a transfer in place for that item. It works fine on items that don’t have variants (colours etc) but when there are variants it displays all incoming dates rather them just the variant selected.

thanks

In case any one else is trying to add this in this is the code below. I added this in the main-product.liquid and had to put it in between the code where I wanted it to dispay.

{% if variant.incoming -%} {% unless variant.title contains “Default” -%}

  • {{ variant.title }} Due to Arrive: {{ variant.next_incoming_date | date: '%B, %Y' }}
  • {% endunless %} {%- endif -%} {%- endfor -%} {%- for variant in product.variants -%} {% if variant.incoming and variant.title contains 'Default' -%}
  • Due to Arrive: {{ variant.next_incoming_date | date: '%B, %Y' }}
  • {%- endif -%} {%- endfor -%}