New Order Printer App - Syntax Error

Solved

New Order Printer App - Syntax Error

Psteensl
Excursionist
19 1 9

Hey,

 

Shopify's new order printer is such a disappointment to me. Why fix something that isn't broken and replace it with something offering no added value?

 

This code worked beautifully earlier, now it makes the New Order Printer crash; Syntax not valid on line XX.

 

This is the line: {% if SKUlist | uniq | size == 1 %}

 

And here's the full code:

 

<div class="legacy"> <img src="https://cdn.shopify.com/s/files/1/2489/5560/files/comfyballs-logo.png?v=1587734527">
<br/>
<p style="float: right; text-align: right; margin: 0;">

Order date {{ order.created_at | date: "%d.%m.%y" }}<br />
Packing slip for order {{ order.order_name }}<br/>
Notes: {{ order.note }} <br/>


</p>
<br/>
<br/>
<br/>
{% if order.shipping_address %}
<h3 style="margin: 0 0 1em 0;">Shipping Address</h3>

<div style="margin: 0 0 1em 0; padding: 1em; border: 1px solid black;border-collapse: collapse;">
{% if order.shipping_address.company %}
{{ order.shipping_address.company }}<br/>
{% endif %}
<strong>{{ order.shipping_address.name }}</strong><br/>
{{ order.shipping_address.street }}<br/>
{{ order.shipping_address.province_code }}
{{ order.shipping_address.zip | upcase }}
{{ order.shipping_address.city }}<br/>
{{ order.shipping_address.country }}
</div>
{% endif %}

 

<h3 style="margin: 0 0 1em 0;">Shipment Detail</h3>

<table class="table-tabular" style="margin: 0 0 1em 0;border: 1px solid black;border-collapse: collapse;">
<thead>
<tr>
<th><strong>Image<strong></th>
<th><strong>SKU<strong></th>
{%- comment -%} Removed by Adam B ( Shopify Theme Support) May 24 2023
<th><strong>Size<strong></th>
{%- endcomment -%}
<th><strong>Quantity<strong></th>
<th><strong>Item<strong></th>
</tr>
</thead>

<tbody>
{% assign totalProductsOrdered = 0 %}
{% assign totalProductsFulfilled = 0 %}
{% assign sizeUnfulfilled = order.unfulfilled_line_items | size%}
{% assign sizeFulfilled = order.fulfilled_line_items | size%}

{% if sizeFulfilled != 0 and sizeUnfulfilled != 0%}
<tr>
<th colspan="5"><strong style="color:green"> Fulfilled: </strong></th>
</tr>
{% endif %}

{% if sizeFulfilled != 0 %}
{% for line_item in fulfilled_line_items %}
{% if line_item.quantity != 0 %}
<tr>
<td>{{ line_item.image | img_url: 'thumb' | img_tag }}</td>

<td>
{% assign SKUs = line_item.sku | split: '&amp;' %}
{% for sku in SKUs %}
{{ sku }}<br/>
{% endfor %}
</td>

{% assign SKUlist = SKUs | strip %}
{% assign fulfilled_qty = line_item.quantity | minus: line_item.fulfillable_quantity %}
{% if SKUlist | uniq | size == 1 %}
{% assign length = SKUs | size %}
{% for i in (1..length) %}
{% assign totalProductsFulfilled = totalProductsFulfilled | plus: fulfilled_qty %}
{% assign totalProductsOrdered = totalProductsOrdered | plus: fulfilled_qty %}
{% endfor %}
{%- comment -%}Removed by Adam B ( Shopify Theme Support) May 24 2023
<td>


{% comment %} Edit by Sarah S. @ Shopify Theme Support | February 6 2023 {% endcomment %}
{{ line_item.variant.option3 }}


<br/>

</td>
{%- endcomment -%}
<td>

{% for i in (1..length) %}
{{ fulfilled_qty }}<br/>
{% endfor %}
</td>

{% else %}
{% assign optionNumber = 1 %}

<td>
{% comment %} Hidden by Sarah S. @ Shopify Theme Support | February 8 2023
{% for option in line_item.product.options %}
{% assign totalProductsOrdered = totalProductsOrdered | plus: fulfilled_qty %}
{% assign totalProductsFulfilled = totalProductsFulfilled | plus: fulfilled_qty %}

{% if optionNumber == 1 %}
{{ line_item.variant.option1 }}
{% elsif optionNumber == 2 %}
{{ line_item.variant.option2 }}
{% elsif optionNumber == 3 %}
{{ line_item.variant.option3 }}
{% endif %}
<br/>
{% assign optionNumber = optionNumber | plus: 1 %}

{% endfor %}
{% endcomment %}

{% comment %} Hidden by Sarah S. @ Shopify Theme Support | February 8 2023
{% comment %} Added by Mike V. at Shopify Theme Support November 30 2020 {% endcomment %}
{% assign variant_titles = line_item.variant.title | replace: '/', '<br>' %}
{{ variant_titles }}
{% endcomment %}
{% comment %} Edit by Sarah S. @ Shopify Theme Support | February 6 2023 {% endcomment %}
{{ line_item.variant.option3 }}

</td>
<td>
{% for option in line_item.product.options %}
{{ fulfilled_qty }}<br/>
{% endfor %}
</td>
{% endif %}

<td style="font-size: 10px;">{{ line_item.product_title }}</td>
</tr>
{% endif %}
{% endfor %}
{% endif %}


{% if sizeUnfulfilled != 0 and sizeFulfilled != 0 %}
<tr>
<th colspan="5"><strong style="color:red"> Unfulfilled: {{test}}</strong></th>
</tr>
{% endif %}

{% if sizeUnfulfilled != 0 %}
{% for line_item in unfulfilled_line_items %}
{% if line_item.quantity != 0 %}
<tr>
<td>{{ line_item.image | img_url: 'thumb' | img_tag }}</td>

<td>
{% assign SKUs = line_item.sku | split: '&amp;' %}
{% for sku in SKUs %}
{{ sku }}<br/>
{% endfor %}
</td>


{% assign SKUlist = SKUs | strip %}
{% if SKUlist | uniq | size == 1 %}
{% assign length = SKUs | size %}
{% for i in (1..length) %}

{% comment %} Hidden by Sarah S. @ Shopify Theme Support | February 8 2023
{{ line_item.variant.option1 }}<br/>
{% endcomment %}

{% assign totalProductsOrdered = totalProductsOrdered | plus: line_item.fulfillable_quantity %}
{% endfor %}
{%- comment -%}Removed by Adam B ( Shopify Theme Support) May 24 2023

<td>


{% comment %} Hidden by Sarah S. @ Shopify Theme Support | February 8 2023
{% comment %} Added by Mike V. at Shopify Theme Support November 30 2020 {% endcomment %}
{% assign variant_titles = line_item.variant.title | replace: '/', '<br>' %}
{{ variant_titles }}
{% endcomment %}

{% comment %} Edit by Sarah S. @ Shopify Theme Support | February 6 2023 {% endcomment %}
{{ line_item.variant.option3 }}


</td>
{%- endcomment -%}
<td>

{% for i in (1..length) %}
{{ line_item.fulfillable_quantity }}<br/>
{% endfor %}
</td>
{% else %}
{% assign optionNumber = 1 %}
<td>
{% for option in line_item.product.options %}
{% assign totalProductsOrdered = totalProductsOrdered | plus: line_item.fulfillable_quantity %}

{% if optionNumber == 1 %}
{{ line_item.variant.option1 }}
{% elsif optionNumber == 2 %}
{{ line_item.variant.option2 }}
{% elsif optionNumber == 3 %}
{{ line_item.variant.option3 }}
{% endif %}
<br/>

{% assign optionNumber = optionNumber | plus: 1 %}
{% endfor %}

{% comment %} Hidden by Sarah S. @ Shopify Theme Support | February 8 2023
{% comment %} Added by Mike V. at Shopify Theme Support November 30 2020 {% endcomment %}
{% assign variant_titles = line_item.variant.title | replace: '/', '<br>' %}
{{ variant_titles }}
{% endcomment %}
{% comment %} Edit by Sarah S. @ Shopify Theme Support | February 6 2023 {% endcomment %}
{{ line_item.variant.option3 }}

</td>


<td>
{% for option in line_item.product.options %}
{{ line_item.fulfillable_quantity }}<br/>
{% endfor %}
</td>
{% endif %}


<td style="font-size: 10px;">{{ line_item.product_title }}</td>
</tr>
{% endif%}
{% endfor %}
{% endif %}
</tbody>

<tfoot>
<tr>
{%if sizeFulfilled == 0 %}
<th colspan="5"><strong>Total items:</strong> {{ totalProductsOrdered }}</th>
{% else %}
<th colspan="5"><strong>Total items:</strong> {{totalProductsFulfilled}} of {{ totalProductsOrdered }}</th>
{% endif %}
</tr>
</tfoot>

</table>
<br/>
<br/>
<br/>
<strong>{{ shop.name }}</strong><br/>
by sCHNOw Sàrl<br/>
{{ shop.address.address1 }}<br/>
{{ shop.address.province_code }} {{ shop.address.zip | upcase }} {{ shop.address.city }} <br/>
{{ shop.address.country }}


<p>If you have a question, mail us at <u>{{ shop.email }}</u></p>
</div>

 

Thank you in advance for any help. Shopify chat is as usual useless.

 

Paal

 

Accepted Solution (1)
Psteensl
Excursionist
19 1 9

This is an accepted solution.

And after having felt frustrated and bitched a bit in public (above), I grabbed a great coffee, sat down with my colleague and challenged him to challenge ChatGPT. 1 hours later....all fixed with improvements in our packing slip.

 

ChatGPT - my new 1st level support. Even 2nd level I guess. Or higher.

View solution in original post

Replies 2 (2)

Psteensl
Excursionist
19 1 9

Thank you Shopify support for suggesting to post my challenge here. "You'll see, you'll get immediate help".

No pun intended to contributors (I've had great help here), this is a message of disappointment to Shopify support. Letting you down, again.

Psteensl
Excursionist
19 1 9

This is an accepted solution.

And after having felt frustrated and bitched a bit in public (above), I grabbed a great coffee, sat down with my colleague and challenged him to challenge ChatGPT. 1 hours later....all fixed with improvements in our packing slip.

 

ChatGPT - my new 1st level support. Even 2nd level I guess. Or higher.