Custom creating of invoices

In Sufio, you can set custom terms to invoice creation and let Sufio automatically create invoices only for specific orders.

To enable custom creating of invoices, contact our support. We'll be happy to set up this option for your Sufio account.

Then, you will need to add a unique cart attribute Invoice Create to your cart page in your Shopify store that will inform Sufio whether an invoice should be created for that particular order. Invoices will then only be created 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, 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>. The right place for the field is just before the Check out button.

<input type="checkbox" name="attributes[Invoice Create]" id="invoice-create" value="true" />

There are different terms you can set to custom invoice creating. You can choose to create invoices only for orders that contain a specific product tag, customer tag, order value, or even give your customers an option to choose whether they need an invoice or not.

Examples of custom invoice creating

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

By checkbox

You can add an I need an invoice checkbox to your cart page so that your customers can let you know they need to receive their invoice.

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

By order value

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

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

By product tags

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

<!-- Shopify cart page -- only create 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 Create]" id="invoice-create" value="true" />
{% endif %}

By customer tags

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

<!-- Shopify cart page -- only create invoices to some customers. Used by Sufio for Shopify (sufio.com/shopify). -->
{% if customer.tags contains 'Invoice' %}
  <input type="hidden" name="attributes[Invoice Create]" id="invoice-create" 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!