How to display product prices using liquid code on InstaOrders Form ?

We’re excited to announce a brand new feature for InstaOrders – the ability to display product prices from liquid code!

Liquid code is a powerful and versatile coding language that is used by Shopify merchants to create custom themes and designs for their stores.

This new feature allows merchants to easily display prices for products on the InstaOrders order form based on product, variant and their metafields properties. This is useful to show B2B pricing based on logged in customer. We know that merchants are busy people, so this feature is designed to save them time and effort.

The new feature is incredibly easy to use. All merchants have to do is copy and paste their product liquid code into the InstaOrders app by visiting the app > Layout & Language > Use Liquid Code to Determine Product Price section and the prices will automatically be displayed. It’s that simple! We hope that this new feature will help Shopify merchants make the most out of their store and save them time in the process. So head on over to InstaOrders today and start displaying product prices from liquid code!

Sample Liquid Codes:

{{ variant.metafields.b2b.price }}

Expected Output is string with or without decimal

120
120.00

Available Liquid Objects:

Objects: customer, variant, product, shop

Properties:

customer: id, tags

variant: id, title, sku, price, barcode, inventoryPolicy, inventoryItem, image, inventoryQuantity, product, compare_at_price, metafields

product: id, title, body_html, vendor, product_type, created_at, handle, updated_at, published_at, template_suffix, status, published_scope, tags, admin_graphql_api_id, variants, options, images, image, price, compare_at_price, price_max, price_min, compare_at_price_max, compare_at_price_min, metafields

shop: metafields

Code templates for apps:

B2B Wholesale Club (https://apps.shopify.com/wholesale-club)

{% capture new_price %}{% comment %} Wholesale_Club_Item_Prices Start {% endcomment %}
{% assign base_product = product %}
{% assign base_variant = variant %}

{% if shop.metafields.sawholesale['base_price'] == blank %}
  {% assign base_price = 'compare_at_price' %}
{% else %}
  {% assign base_price = shop.metafields.sawholesale['base_price'] %}
{% endif %}

{% assign saw_discount = 0 %}{% assign saw_has_discount = false %}

{% if customer.tags != blank %}
  {% for mf in base_product.metafields.sawholesale %}
    {% capture product_customer_tag %}{{ mf | first | replace: 'discount_', '' }}{% endcapture %}
    {% if customer.tags contains product_customer_tag %}
      {% assign saw_has_discount = true %}
      {% assign discount_key = product_customer_tag | prepend: 'discount_' %}
      {% assign price_key = product_customer_tag | prepend: 'price_' %}
      {% assign saw_discount = base_product.metafields.sawholesale[discount_key] | divided_by: 100.0 %}
    {% endif %}
  {% endfor %}
{% endif %}

{% assign saw_discount = 1 | minus: saw_discount %}

{% if base_price == 'price' or base_variant.compare_at_price == blank  or base_variant.compare_at_price == 0 or base_variant.compare_at_price < base_variant.price %}
  {% assign saw_variant_compare_at_price = base_variant.price %}
{% else %}
  {% assign saw_variant_compare_at_price = base_variant.compare_at_price %}
{% endif %}

{% assign cpe = shop.metafields.sawholesale['cpe'] | default: "true" %}
{% if base_variant.metafields.sawholesale[price_key] != blank and cpe == "true" %}
  {% assign saw_variant_price = base_variant.metafields.sawholesale[price_key] %}
{% else %}
  {% assign saw_variant_price = saw_variant_compare_at_price | times: saw_discount %}
{% endif %}

{% if saw_has_discount == false or saw_variant_price >= saw_variant_compare_at_price %}
  {% assign WCItem_OriginalPrice = product.price %}
  {% assign WCItem_FinalPrice = product.price %}
  {% assign WCItem_Price = product.price %}
  {% assign WCItem_PriceMin = product.price_min %}
  {% assign WCItem_PriceMax = product.price_max %}
  {% assign WCItem_CompareAtPrice = product.compare_at_price %}
  {% assign WCItem_CompareAtPriceMin = product.compare_at_price_min %}
  {% assign WCItem_CompareAtPriceMax = product.compare_at_price_max %}
  {% assign WCItem_OriginalLinePrice = product.price %}
  {% assign WCItem_FinalLinePrice = product.price %}
  {% assign WCItem_LinePrice = product.price %}
{% else %}
  {% assign WCItem_OriginalPrice = saw_variant_compare_at_price %}
  {% assign WCItem_FinalPrice = saw_variant_price %}
  {% assign WCItem_Price = saw_variant_price %}
  {% assign WCItem_PriceMin = product.price_min | times: saw_discount %}
  {% assign WCItem_PriceMax = product.price_max | times: saw_discount %}
  {% assign WCItem_CompareAtPrice = saw_variant_compare_at_price %}
  {% if base_product.compare_at_price_min != 0 %}{% assign WCItem_CompareAtPriceMin = base_product.compare_at_price_min %}{% else %}{% assign WCItem_CompareAtPriceMin = base_product.price_min %}{% endif %}
  {% if base_product.compare_at_price_max != 0 %}{% assign WCItem_CompareAtPriceMax = base_product.compare_at_price_max %}{% else %}{% assign WCItem_CompareAtPriceMax = base_product.price_max %}{% endif %}
  {% assign WCItem_OriginalLinePrice = WCItem_OriginalPrice %}
  {% assign WCItem_FinalLinePrice = WCItem_FinalPrice %}
  {% assign WCItem_LinePrice = WCItem_Price | round: 2 %}
{% endif %}
{% comment %} Wholesale_Club_Item_Prices End {% endcomment %}
{{ WCItem_LinePrice }}
{% endcapture %}{{ new_price | strip }}

Comments are closed.