{% layout none %} {% paginate collection.products by 1000 %} {%- assign useSEOtitle = false -%} {%- assign useSEOdescription = true -%} {%- comment -%} TODO: Move this into a snippet and use capture to assign the variable {%- endcomment -%} {%- case shop.currency -%} {%- when 'USD' -%}{%- assign CountryCode = 'US' -%} {%- when 'CAD' -%}{%- assign CountryCode = 'CA' -%} {%- when 'GBP' -%}{%- assign CountryCode = 'GB' -%} {%- when 'AUD' -%}{%- assign CountryCode = 'AU' -%} {%- else -%}{%- assign CountryCode = 'US' -%} {%- endcase -%} {%- assign Color = "" -%} {%- assign Size = "" -%} {{ shop.name }} {{ collection.title | strip_html | strip_newlines | replace: '&', '&' }} {{ shop.url }} {{ collection.description | strip_html | strip_newlines | replace: '&', '&' }} {% for product in collection.products %} {%- assign GoogleProductCategory = product.metafields.mm-google-shopping.google_product_category -%} {%- assign Gender = product.metafields.mm-google-shopping.gender -%} {%- assign AgeGroup = product.metafields.mm-google-shopping.age_group -%} {% for variant in product.variants %} {%- assign Color = "" -%} {%- assign Size = "" -%} {%- for option in product.options -%} {%- if option == 'Color' -%}{%- capture Color -%}{{ variant.options[forloop.index0] }}{%- endcapture -%} {%- elsif option == 'Size' -%}{%- capture Size -%}{{ variant.options[forloop.index0] }}{%- endcapture -%} {%- endif -%} {%- endfor -%} {%- capture productTitle -%}{{ product.title }}{%- endcapture -%} {%- unless productTitle contains Color -%}{%- capture productTitle -%}{{ productTitle }} {{ Color }}{%- endcapture -%}{%- endunless -%} {%- if useSEOtitle and product.metafields.global.title_tag.size > 0 -%}{%- assign productTitle = product.metafields.global.title_tag -%}{%- endif -%} {%- assign productDescription = product.description -%} {%- if useSEOdescription and product.metafields.global.description_tag.size > 0 -%}{%- assign productDescription = product.metafields.global.description_tag -%}{%- endif -%} {%- assign OnSale = false -%} {%- assign Price = variant.price -%} {%- if variant.compare_at_price > variant.price -%} {%- assign OnSale = true -%} {%- assign Price = variant.compare_at_price -%} {%- assign SalePrice = variant.price -%} {%- endif -%} {{ productTitle | strip_html | replace: '&', '&' }} {{ shop.url }}{{ variant.url }}&currency={{ cart.currency.iso_code }} {{ productDescription | strip_html | strip_newlines | replace: '&', '&' }} {{ GoogleProductCategory | replace: '&', '&' }} shopify_{{ CountryCode }}_{{ product.id }} shopify_{{ CountryCode }}_{{ product.id }}_{{ variant.id }} new {{ Price | money_without_currency }} {{ cart.currency.iso_code }} {%- if OnSale -%} {{ SalePrice | money_without_currency }} {{ cart.currency.iso_code }} {%- endif -%} {% if variant.available %}in stock{% else %}out of stock{% endif %} http:{% if variant.image.src %}{{ variant.image.src | product_img_url: 'master' }}{% else %}{{ product.featured_image.src | product_img_url: 'master' }}{% endif %} {{ variant.barcode }} {{ product.vendor }} {{ variant.sku }} {{ product.type }} {{ AgeGroup }} {% unless Color == "" %}{{ Color | strip_html | strip_newlines | replace: '&', '&' }}{% endunless %} {%- unless Size == "" -%} {{ Size | strip_html | strip_newlines | replace: '&', '&' }} US {%- endunless -%} {{ Gender }} {{ product.metafields.mm-google-shopping.custom_label_0 }} {{ product.metafields.mm-google-shopping.custom_label_1 }} {{ product.metafields.mm-google-shopping.custom_label_2 }} {{ product.metafields.mm-google-shopping.custom_label_3 }} {{ product.metafields.mm-google-shopping.custom_label_4 }} {{ variant.weight | weight_with_unit }} {% endfor %} {% endfor %} {% endpaginate %}