Last active
June 15, 2022 12:22
-
-
Save jmsaavedra/06c84ad1c403155631d175667bc25e14 to your computer and use it in GitHub Desktop.
Shopify Liquid for Flow > Slack
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% assign order_num = order.name | remove: '#' %} | |
{% assign order_modulo = order_num | modulo:1000 %} | |
{% assign customer_moments_ct = order.customerJourneySummary.momentsCount %} | |
{% assign note_len = order.note | size %} | |
{% assign billingco_len = order.billingAddress.company | size %} | |
{% assign customer_firstvisit_refurl_len = order.customerJourneySummary.firstVisit.referrerUrl | size %} | |
{% assign customer_firstvisit_desc_len = order.customerJourneySummary.firstVisit.sourceDescription | size %} | |
{% assign customer_lastvisit_refurl_len = order.customerJourneySummary.lastVisit.referrerUrl | size %} | |
{% assign customer_lastvisit_desc_len = order.customerJourneySummary.lastVisit.sourceDescription | size %} | |
{% assign order_refurl_len = order.referrerUrl | size %} | |
{% assign order_refdesc_len = order.referrerDisplayText | size %} | |
{% assign order_billingaddresscompany_len = order.billingAddress.company | size %} | |
{% assign order_shippingaddresscompany_len = order.shippingAddress.company | size %} | |
{% if order_modulo == 0 %} | |
πβπβπβπβπβπβπβπβπβπβπβπβπ | |
@channel *CONGRATS ON RECEIVING OUR {{order_num}}th ORDER !!!* | |
βπ₯βπ₯βπ₯βπ₯βπ₯βπ₯βπ₯βπ₯βπ₯βπ₯βπ₯βπ₯β | |
{% endif %} | |
<https://infinite-objects-inc.myshopify.com/admin/orders/{{order.legacyResourceId}}|*Order {{order.name}}*> *PAID* | |
*Customer Visits:* {{customer_moments_ct}} | |
{% if customer_firstvisit_refurl_len > 1 %}*Customer First Visit Referrer:* {{order.customerJourneySummary.firstVisit.referrerUrl}} {% endif %} | |
{% if customer_firstvisit_desc_len > 1 %}*Customer First Visit Descrip:* {{order.customerJourneySummary.firstVisit.sourceDescription}} {% endif %} | |
{% if customer_lastvisit_refurl_len > 1 %}*Customer Last Visit Referrer:* {{order.customerJourneySummary.lastVisit.referrerUrl}} {% endif %} | |
{% if customer_lastvisit_desc_len > 1 %}*Customer Last Visit Descrip:* {{order.customerJourneySummary.lastVisit.sourceDescription}} {% endif %} | |
{% if order_refurl_len > 1 %}*Order Referrer:* {{order.referrerUrl}} {% endif %} | |
{% if order_refdesc_len > 1 %}*Order Referral Display:* {{order.referrerDisplayText}} {% else %}*Order Referral Display:* _direct_{% endif %} | |
*Line Items:* {% for lineItems_item in order.lineItems %} | |
_{{lineItems_item.title}}_ - {{lineItems_item.variantTitle}}{% for customAttributes_item in lineItems_item.customAttributes %} | |
_{{customAttributes_item.key | remove: "_" }}_: {% if customAttributes_item.key == "creationId" %}<https://app.infiniteobjects.com/{{customAttributes_item.value}}|{{customAttributes_item.value}}>{% elsif customAttributes_item.key == "printId" %}<https://niy8fk.csb.app/?printId={{customAttributes_item.value}}|{{customAttributes_item.value}}>{% else %}{{customAttributes_item.value}}{% endif %}{% endfor %} | |
*Qty:* {{lineItems_item.quantity}} | |
{% endfor %} | |
*Total Paid:* {{order.totalReceivedSet.presentmentMoney.amount}} {{order.totalReceivedSet.presentmentMoney.currencyCode}} | |
{% if order.totalDiscountsSet.presentmentMoney.amount > 0 %} | |
*Discount Code:* {{order.discountCode}} | |
*Discount Total:* {{order.totalDiscountsSet.presentmentMoney.amount}} {{order.totalDiscountsSet.presentmentMoney.currencyCode}} | |
{% else %} | |
*No Discount.* | |
{% endif %} | |
*Ship To:* {{order.customer.displayName}}, {{order.billingAddress.company}} | |
{{order.shippingAddress.city}}, {{order.shippingAddress.provinceCode}} {{order.shippingAddress.country}} | |
{% if note_len > 1 %} | |
*Note:* | |
>{{order.note | strip_newlines}} | |
{% endif %} | |
{% if order_shippingaddresscompany_len > 1 or order_billingaddresscompany_len > 1 %}{% if order.channelInformation.channelDefinition.handle == "online-store" %} | |
*This order is a corporate customer or recipient.* | |
{% if order_billingaddresscompany_len > 1 %} | |
_Purchased by:_ *{{order.customer.displayName}}* ({{order.email}}) at *{{order.billingAddress.company}}*{% endif %}{% if order_shippingaddresscompany_len > 1 %} | |
_Shipping to:_ *{{order.shippingAddress.name}}* at *{{order.shippingAddress.company}}* | |
{% endif %}{% endif %}{% endif %} | |
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | |
_order channel handle_: {{order.channelInformation.channelDefinition.handle}} | |
{% for transactions_item in order.transactions %} _payment gateway_:{{transactions_item.formattedGateway}}{% if transactions_item.formattedGateway == "Coinbase Commerce" %} @dev we got a {{transactions_item.formattedGateway}} payment. {% endif %}{% endfor %} | |
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment