Receipt printer slip - Thermal printer

@Elxan_Salmanov, you are responding on a three-year-old topic. HTML/CSS custom templates disappeared long ago. They were replaced by custom themes written in Liquid.

is there any update about Thermal Printer …

This is a seven year old topic. Code for printing on thermal printers has been posted on the forum. You will find it if you search the forum.

can u plz share Link

{% assign description = null %} {% assign qty = null %} {% assign amount = null %}
    </div>
    <td style="font-weight: bold; color: #000000; text-align: left; padding-left: 0px; padding-right: 0px; width: inherit; margin: 0 auto;">
      <div style="width: 280px;">
       {% for column in table.columns %}
            {% case column.label %}
                {% when 'Description' or 'Descrição' or 'Keterangan' %}
                    {% assign description = forloop.index0 %}
                    <span style="display: block; word-wrap: break-word; width: 53%; float:left">{{ column.label }}</span>
                {% when 'Qty' or 'Qt.' or 'Un' or 'Kuantitas' %}
                    {% assign qty = forloop.index0 %}
                    <span style="display: block; word-wrap: break-word; width: 17%; float:left">{{ column.label }}</span>
                {% when 'Total' or 'Amount' %}
                    {% assign amount = forloop.index0 %}
                    <span style="display: block; word-wrap: break-word; width: 30%; float:left">Amount</span>
                {% when 'Valor' or 'Montante' or 'Jumlah' %}
                    {% assign amount = forloop.index0 %}
                    <span style="display: block; word-wrap: break-word; width: 30%; float:left">{{ column.label }}</span>
            {% endcase %}
        {% endfor %}
      </div>
    </td>
    </div>
   </tr>
 </thead>
 <tbody>
{% for row in table.rows %}
<tr>
  <div style="width: 250px; word-wrap: break-word; margin: 0px 0px 20px 0px; clear: both">
    <div style="max-width: 100%; margin: 0 auto">
      <td style="color: #000000; text-align: left; padding-left: 0px; padding-right: 3px; width: inherit; margin: 0 auto;">
        <div style="width: 280px">
        {% for cell in row.cells %}
            {% case forloop.index0 %}
                {% when description %}
                    <span style="display: block; word-wrap: break-word; width: 53%; float:left">{{ cell.text }}</span>
                {% when qty %}
                    <span style="display: block; word-wrap: break-word; width: 17%; float:left">{{ cell.text }}</span>
                {% when amount %}
                    <span style="display: block; word-wrap: break-word; width: 30%; float:left">{{ cell.text }}</span>
            {% endcase %}
        {% endfor %}
        </div>
      </td>
    </div>
    </div>
   </tr>
   {% endfor %}
   {% for total in table.totals %}
  <tr>
  <div style="width: 300px; word-wrap: break-word; clear: both">
    <div style="max-width: 100%; margin: 0 auto">
      <td style="text-align: left; font-weight: bold; font-size: 13px">
        <div style="width: 250px">
          <span style="display: block; float:left; width: 70%; margin-top: 20px; margin-bottom: 15px;">{{ total.label }}:</span>
          <span style="display: block; float:left; width: 30%; margin-top: 20px; margin-bottom: 15px;">{{ total.text }}</span>
        </div>
      </td>
    </div>
  </div>
</tr>
{% endfor %}
<tr>
  <div style="width: 300px; word-wrap: break-word; margin-bottom: 20px">
    <div style="max-width: 100%; margin: 15px auto 0 auto">
      <td>
        <div style="padding-left: 2px; width: 280px; word-wrap: break-word">
          {% for field in custom_fields %}
          <div style="font-weight: bold; margin-top: 15px">{{ field.label }}</div>
          <div style="padding-bottom: 20px; margin-top: 15px">{{ field.text | newline_to_br }}</div>
          {% endfor %}
        </div>
      </td>
      </div>
    </div>
</tr>
<tr>
  <div style="width: 300px; word-wrap: break-word; margin: 0px 0px 10px 0px">
    <div style="max-width: 100%; margin: 15px auto 15px auto">
      <td>
        <div style="padding-left: 4px; width: 250px; word-wrap: break-word; text-align: center">
          <p><b>Thank you for choosing {{ business.name }}.</b></p>
        </div>
      </td>
      </div>
    </div>
</tr>
</tbody>
</table>
{{ business.name }}
{{ business.address | replace: "\n", " " }}
{{ title }}
Customer Name: {{ recipient.name }}
{% for field in fields %}
{{ field.label }}:
{{ field.text }}
{% endfor %}
1 Like

You would have found it, and other topics as well, if you had searched for “thermal printer.” Please do not ask other forum members to do your work for you unless you have tried and failed. That gives you a poor reputation on the forum and reduces the chance your future questions will be answered.

3 Likes

dear all i try to solve it and add the logo of company but the issue description don’t show

Welcome to the forum @afagglobal1

Share the edit screens of the custom theme and the transaction in question.

What do you mean by “issue description?” There is nothing in Manager by that name.

MR.Ealfardan this the code i used how i solved description issue

{% assign description = null %} {% assign qty = null %} {% assign amount = null %}
{% if business.logo != null %}{% endif %}
<td>
 <div style="text-align: center; width: 250px; word-wrap: break-word; margin-top: 3; margin-bottom: 30px">
    <div style="font-size: 20px; font-weight: bold; margin: 5px 0 10px 0">{{ business.name }}</div>
     <div>{{ business.address | replace: "\n", " " }}</div>
    <div style="font-weight: bold; font-size: 15px; padding: 5px; text-align: center; margin-bottom: 0px color: #000000; margin-top: 30px">{{ title }}</div>
    <div style="font-weight: bold; margin-top: 20px">Customer Name: <span style="font-weight: normal">{{ recipient.name }}</span></div>
</div>
</div>
<td style="font-weight: bold; color: #000000; text-align: left; padding-left: 0px; padding-right: 0px; width: inherit; margin: 0 auto;">
  <div style="width: 280px;">
   {% for column in table.columns %}
        {% case column.label %}
            {% when 'Description' %}
                {% assign description = forloop.index0 %}
                <span style="display: block; word-wrap: break-word; width: 53%; float:left">{{ column.label }}</span>
            {% when 'Qty' %}
                {% assign qty = forloop.index0 %}
                <span style="display: block; word-wrap: break-word; width: 17%; float:left">{{ column.label }}</span>
            {% when 'Total' or 'Amount' %}
                {% assign amount = forloop.index0 %}
                <span style="display: block; word-wrap: break-word; width: 30%; float:left">Amount</span>
        {% endcase %}
    {% endfor %}
  </div>
</td>
</div>
{% for row in table.rows %}
{% endfor %} {% for total in table.totals %}
{% endfor %}
{% for field in fields %}
{{ field.label }}:
{{ field.text }}
{% endfor %}
{% for cell in row.cells %} {% case forloop.index0 %} {% when description %} {{ cell.text }} {% when qty %} {{ cell.text }} {% when amount %} {{ cell.text }} {% endcase %} {% endfor %}
{{ total.label }}: {{ total.text }}
{% for field in custom_fields %}
{{ field.label }}
{{ field.text | newline_to_br }}
{% endfor %}

Thank you for choosing {{ business.name }}.


MR.Tut this what i mean this not show in arabic lang only in English

Your problem is your rows section is empty:

In fact, it’s not just the description, it’s the whole lines that are missing. As a starting point, you can change this to:

{% for row in table.rows %}
    {% for cell in row.cells %}
        {% case forloop index0 %}
            {% when description %}<td>{{ cell.text }}</td>
            {% when qty %}<td>{{ cell.textv}}</td>
            {% when amount %}<td>{{ cell.text }}</td>
        {% endcase %}
    {% end for %}
{% endfor %}

You also need to do something more or less similar to your totals section, since you have that empty as well:

To know what should go in each section you can take a copy of the Plain theme and use that as reference.

1 Like

That’s what happens when you don’t copy well the code from @Previsam in this post. :grin:

1 Like


thank you very match for helping i think the code missing amount because in the same line of description and Qty should be amount showing but like you see in purview its empty

{% assign description = null %} {% assign qty = null %} {% assign amount = null %}
{% if business.logo != null %}{% endif %}
</div>
<td style="font-weight: bold; color: #000000; text-align: left; padding-left: 0px; padding-right: 0px; width: inherit; margin: 0 auto;">
  <div style="width: 280px;">
   {% for column in table.columns %}
        {% case column.label %}
            {% when 'Description' or 'Descrição' or 'البيان' %}
                {% assign description = forloop.index0 %}
                <span style="display: block; word-wrap: break-word; width: 53%; float:left">{{ column.label }}</span>
            {% when 'Qty' or 'Qt.' or 'Un' or 'الكمية' %}
                {% assign qty = forloop.index0 %}
                <span style="display: block; word-wrap: break-word; width: 17%; float:left">{{ column.label }}</span>
            {% when 'Valor' or 'Montante' or 'المجموع' %}
                {% assign amount = forloop.index0 %}
                <span style="display: block; word-wrap: break-word; width: 30%; float:left">{{ column.label }}</span>
        {% endcase %}
    {% endfor %}
  </div>
</td>
</div>
{% for row in table.rows %}
{% endfor %} {% for total in table.totals %}
{% endfor %}
{{ business.name }}
{{ business.address | replace: "\n", " " }}
{{ title }}
Customer Name: {{ recipient.name }}
{% for field in fields %}
{{ field.label }}:
{{ field.text }}
{% endfor %}
{% for cell in row.cells %} {% case forloop.index0 %} {% when description %} {{ cell.text }} {% when qty %} {{ cell.text }} {% when amount %} {{ cell.text }} {% endcase %} {% endfor %}
{{ total.label }}: {{ total.text }}
{% for field in custom_fields %}
{{ field.label }}
{{ field.text | newline_to_br }}
{% endfor %}

Thank you for choosing {{ business.name }}.

the true i don’t have any enology on coding that’s why i ask help from the geniuses of this post
thanks to them all

Because you didn’t include ‘Amount’ or ‘Total’ here:

BTW, why do you use 3 languages?

Because @Previsam adapted the code to include Portuguese for Shamsuddin_Esaf | shamsuddin_esaf1 (BTW, same user, 2 accts?) in his 2nd post in the same thread. :wink:

Enology? :wine_glass:And asking help without trying it yourself is against the forum rules. I recommend you read them.

i mean any knowledge mr.mark I will follow your advice by reading the rules. Thank you for your help