Hide content from Order Confirmation from Wholesale Channel users

Hey All,

I have a customer who utilises the wholesale channel on all 6 of their expansion stores with Shopify Plus. At the moment we have this set up to take them to checkout to make payment as opposed to the default draft order method.

For normal B2C customers the order confirmation contains a PDF invoice download button, we want to hide this from customers checking out of the wholesale channel is as there is some accounting procedures in place for these customers.

What I first tried was putting the below code around the pdf download code.

{% unless order.tag contains 'wholesale' %}
PDF DOWNLOAD CODE
{% endunless %}

When a wholesale order is processed it automatically adds a the tag ‘wholesale’ to the order however, it appears this happens post order being finalised as the customer still gets the invoice from this first email. But if you go back into the order 30 seconds later and resend the confirmation then the above code works and it sends the confirmation without the PDF code.

I’m trying to now figure out how to capture some sort of data to identify the order comes from wholesale so it doesn’t send the invoice. I’ve found no documentation about using certain tags for the Wholesale channel.
I tried {% unless channel.name contains ‘wholesale’ %} but this also doesn’t work.

Any suggestions would be greatly appreciated. :slightly_smiling_face:

Luke

I would check the JSON data of 2 orders: 1 wholesale and 1 non-wholesale and see if you can identify a data point unique to the wholesale order, then compare that with the available variables: https://help.shopify.com/en/manual/orders/notifications/email-variables

You could also check customer data. For example, if your wholesale customers need to be existing customers / log in to order, you can tag them then identify that tag when the order comes in ( I think order.customer.tags )

For checking order or customer data just put a .json at the end of it when in the details page (example: x.myshopify.com/admin/orders/111111111.json).