Skip to content

Instantly share code, notes, and snippets.

@Osotoro
Last active March 6, 2018 09:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Osotoro/f4db43a4f6636d159f3b079006922c86 to your computer and use it in GitHub Desktop.
Save Osotoro/f4db43a4f6636d159f3b079006922c86 to your computer and use it in GitHub Desktop.
Shopify XML for marketplace
{% layout none %}
<?xml version="1.0" encoding="UTF-8"?>
<products>
{% paginate collections.all.products by 2000 %}{% for product in collections.marketplacename.products %}
<product>
<product_id>{{ product.id }}</product_id>
<brand>{{ product.vendor }}</brand>
<name>{{ product.title | strip_html | strip_newlines | escape | replace: 'amp;', 'and' | replace: '&#38;', 'and' | replace: "é", "e" | replace: "à ", "a" }}</name>
<reference>{{ product.handle }}</reference>
<color></color>
<gender>mujer</gender>
<taxable>{{ product.price_max | divided_by: 121.00 | round: 2 }}</taxable>
<pvp>{{ product.price_max | divided_by: 100.00 | round: 2 }}</pvp>
<suggestedPrice></suggestedPrice>
<description>{{ product.description }}</description>
<materials></materials>
<dimension></dimension>
<variations>
{% for variant in product.variants %}
{% unless variant.barcode == nil %}
<variation>
<size>{{ variant.title }}</size>
<qty>{{ variant.inventory_quantity }}</qty>
<ean>{{ variant.barcode }}</ean>
</variation>
{% endunless %}
{% endfor %}
</variations>
<pictures>
{% for image in product.images %}
<pictureURL>{{ image.src }}</pictureURL>
{% endfor %}
</pictures>
</product>
{% endfor %}
{% endpaginate %}
</products>
{% comment %}Soluciones de Comercio{% endcomment %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment