Custom sending of invoices

Sufio allows you to set custom terms to invoice sending, and automatically send invoices to customers only if certain conditions are met.

To enable custom sending of invoices:

  1. In your Sufio account, go to the SettingsEmails page.
  2. Switch the Automatically send invoices toggle on and select from the dropdown menu Automatically send invoices when orders are: custom.
  3. Click on Update settings to save the changes.

You will then need to add a unique cart attribute Invoice Send to your cart page that will inform Sufio whether an invoice should be sent for that particular order. Invoices will be sent only if the cart attribute is present.

To add the cart attribute to the cart page:

  1. In your Shopify Admin, go to the Online StoreThemes page.
  2. Click the Actions button, and then click Edit code.
  3. Select cart.liquid in the left sidebar. You might use the upper search bar for a faster search.
  4. Insert the following code snippet inside the <form>. A right place for the field is just before the Check out button.

<input type="hidden" name="attributes[Invoice Send]" id="invoice-send" value="true" />

Examples of custom invoice sending

Here are some examples of custom terms that can be used for invoice sending. Use one of the following code snippets as a replacement to the general code snippet above. 

By checkbox

You can add a Send me an invoice checkbox to your cart page so that your customers can decide whether they want to receive their invoice or not.

<!-- Shopify cart page -- only send invoices to customers that request them. Used by Sufio for Shopify (sufio.com/shopify). -->
<input type="checkbox" name="attributes[Invoice Send]" id="invoice-send" value="true" />
<label for="invoice-send" class="inline">Send me an invoice</label>

By order value

You can choose to send invoices only for orders with a certain total amount, e.g., higher than zero.

<!-- Shopify cart page -- only send invoices for some orders. Used by Sufio for Shopify (sufio.com/shopify). -->
{% if cart.total_price > 0 %}
  <input type="hidden" name="attributes[Invoice Send]" id="invoice-send" value="true" />
{% endif %}

By product tags

You can send invoices only for orders that contain at least one product tagged with a specific tag, e.g., Invoice

<!-- Shopify cart page -- only send invoices for orders with some products. Used by Sufio for Shopify (sufio.com/shopify). -->
{% for item in cart.items %}
  {% if item.product.tags contains 'Invoice' %}
    {% assign has_tagged_product = true %}
  {% endif %}
{% endfor %}
{% if has_tagged_product %}
  <input type="hidden" name="attributes[Invoice Send]" id="invoice-send" value="true" />
{% endif %}

By customer tags

You can send invoices only to customers tagged as VIP. Please note that a customer needs to be logged into their account in your store while shopping.

<!-- Shopify cart page -- only send invoices to some customers. Used by Sufio for Shopify (sufio.com/shopify). -->
{% if customer.tags contains 'VIP' %}
  <input type="hidden" name="attributes[Invoice Send]" id="invoice-send" value="true" />
{% endif %}

Note

If your store uses cart drawer (also called ajax cart), this code snippet needs to be added to a different file than cart.liquid. In most cases, it needs to be added to ajax-cart-template.liquid file.

Need help?

Do you need help with customizing your Shopify store theme? Please contact our experienced support team. We'll be happy to assist!