Adding an .XML extension to collection page handle URL - for vivino product feed

mediamole
Shopify Partner
3 0 0

 

I have a client that needs to submit a product feed to wine app VIVINO

I have created a collection with no layout that generates an XML feed based on products selected within the collection in the format VIVINO requires, and have used an app for the creation of extra product info needed.

 

 

{% layout none %}<?xml version="1.0" encoding="UTF-8" ?>

{%- paginate collection.products by 2000 -%}
{%- assign CountryCode = 'GB' -%}
{%- if shop.currency == 'CAD' -%}{%- assign CountryCode = 'CA' -%}{%- endif -%}
{%- assign PriceAdjustment = 1.0 -%}
{%- assign PriceAdjustmentEffectiveDate =  '20181226T080000-0500/20190102T235900-0800' -%}
 <vivino-product-list> 
{% for product in collection.products %} 
   
    {%- if variant.compare_at_price == blank -%}
      {%- assign BasePrice = variant.price -%}
    {%- else -%}
      {%- assign BasePrice = variant.compare_at_price -%}
    {%- endif -%}
    {%- assign SalePrice = variant.price | times: PriceAdjustment -%}
<product>
<product-name>{{ product.title | strip_html | strip_newlines | replace: '&', '&amp;' }}{% unless product.title contains Color %} {{ Color | replace: '&', '&amp;' }}{% endunless %}</product-name>
<price>{{product.price | money_without_currency}}</price>
<bottles volume="{{product.metafields.drinkVol.drink_vol_01}}">{{product.metafields.arena.BottleQty}}</bottles>
<link>{{shop.url}}{{product.url}}</link>
{%- if SalePrice < BasePrice -%}<price-discounted-from>{{ SalePrice  | money_without_currency }} {{ shop.currency }}</price-discounted-from>{%-  endif -%}
{%- if PriceAdjustment < 1 -%}<price-discounted-until>{{ PriceAdjustmentEffectiveDate }}</price-discounted-until>{%- endif -%}
<inventory-count>{{ product.variants.first.inventory_quantity }}</inventory-count>
   <extras>
     <product-id>{{ product.id }}</product-id>
     <producer>{{ product.vendor }}</producer>
     <description>{{ product.description | strip_html | strip_newlines | replace: 'amp;', 'and' | replace: '&#38;', 'and' | replace: "..", ". " | replace: "  ", " " | replace: "‘", "&#39;" | replace: "’", "&#39;" | replace: "&#8216;", "&#39;" | replace: "&#8217;", "&#39;" | replace: "&#8217;", "&#39;" | replace: "’", "&#39;" | replace: "“", "&#39;" | replace: "‘", "&#39;"  | replace: "´", "&#39;" | replace: "“", "&#34;" | replace: "”", "&#34;" | replace: "&#8211;", "-" | replace: "–", "-" | replace: "—", "-" | replace: "–", "&mdash;" | replace: "—", "&mdash;" | replace: "%", "&#37;" | replace: "©", "&copy;" | replace: "®", "&reg;" | replace: "â„¢", "&trade;" | replace: "£", "&pound;" | replace: "ï¿­", "&#42;" | replace: "•", "&#42;" | replace: "”", "&#39;" | replace: "&#233;", "e" | replace: "é", "e" | replace: "à ", "a" | replace: "ó", "o" | replace: "ê", "e" | replace: "Ø", "O" | replace: "&#8482;", "" | replace: "&#174;", "" }}</description>
   </extras>  
</product>
  {% endfor %}  
</vivino-product-list>
{% endpaginate %}

 

 

The only issue I have is I need the collection name to have a .xml extension at end of file so it formats correctly.

Is there a way to achieve this? I had a solution using an app but vivino rejected it. I now have the above solution that provides what required in terms of XML, it just doesn't have the required .xml extension

Can I achieve this some how?

Replies 2 (2)

eddy_vandeputte
Visitor
1 0 0

Hi,

I'm also interested in your solution for the data feed to Vivino. Let me know if you have the solution up and running and what the cost would be to install this on my webshop winesbio.com. 

Best regards,

Eddy Vandeputte

kellysolutions
Visitor
3 0 0

I have found an app that creates a ViVino XML file.

The one problem I have is bottle volume.

Our plan does not support bottle volume as a unique field on the product record, so I can't find a way of exporting it.

 

Paul