Reviews

{%- assign yotpo_offload_content = shop.metafields.yotpo.yotpo_offload_content %} {%- assign time_now = ‘now’ | date: ‘%s’ %} {%- assign yotpo_live_time = shop.metafields.yotpo.yotpo_live | date: ‘%s’ %} {%- assign diff_seconds_from_live = time_now | minus: yotpo_live_time %} {%- assign yotpo_main_widget_last_updated = product.metafields.yotpo.main_widget_update_time | date: ‘%s’ %} {%- assign diff_seconds_from_last_main_widget_update = time_now | minus: yotpo_main_widget_last_updated %} {%- if yotpo_live_time and diff_seconds_from_live < 86400 or yotpo_main_widget_last_updated and diff_seconds_from_last_main_widget_update < 86400 -%} {%- assign yotpo_main_widget_obsolete = false %} {%- else %} {%- assign yotpo_main_widget_obsolete = true %} {%- endif %} {%- if yotpo_offload_content == ‘yes’ and yotpo_main_widget_obsolete != true -%} {%- for field in product.metafields.yotpo_reviews -%} {{ field | last }} {%- endfor -%} {%- endif %}