Skip to content

Instantly share code, notes, and snippets.

@zakhardage
Last active August 29, 2015 14:04
Show Gist options
  • Select an option

  • Save zakhardage/d24bcf888011b173d89b to your computer and use it in GitHub Desktop.

Select an option

Save zakhardage/d24bcf888011b173d89b to your computer and use it in GitHub Desktop.
opengraph wholesale price
// Replace this
<meta property="og:price:amount" content="15.00" />
<meta property="og:price:currency" content="USD" />
// With this
{% assign price = product.price_max %}
{% for v in product.variants %}
{% unless v.title contains 'wholesale' or v.title contains 'Wholesale' or v.price > price %}
{% assign price = v.price %}
{% endunless %}
{% endfor %}
<meta property="product:price:currency" content="{{ shop.currency }}" />
<meta property="og:price:amount" content="{{ price | money_without_currency }}">
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment