Advertisement
sparkweb

Order Desk Receipt With Barcode

Jan 2nd, 2015
378
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 5.59 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <title>{{ store_name }} Receipt</title>
  6. <link rel="stylesheet" href="{{ base_url }}/css/receipt.css">
  7.  
  8. <!-- Must Include These Includes For Making Barcode -->
  9. <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
  10. <script type="text/javascript" src="/js/jquery.barcode.min.js"></script>
  11.  
  12. <style type="text/css">
  13. /* CUSTOM CSS HERE */
  14.  
  15.  
  16. </style>
  17. </head>
  18.  
  19. <body id="printpage">
  20.  
  21. <a href="#" onclick="window.print(); return false;" id="printbutton" class="btn noprint">Print</a>
  22.  
  23. {% for key, order in orders %}
  24.  
  25. {{ key > 0 ? '<div class="page-break"></div>' }}
  26. <div class="main">
  27.  
  28.     {# This is a good place to put in a logo if you want - this page is not SSL so you can link to an image on your website like this: #}
  29.     {# <img src="your_image_url" alt="{{ store_name|e }}"> #}
  30.     <div class="header_logo">{{ store_name }}</div>
  31.  
  32.     <div class="wrapper">
  33.         <div class="wrapper-table">
  34.             <ul>
  35.                 <li class="invoice-title">Receipt</li>
  36.                 <li>&nbsp;</li>
  37.                 <li><b>Date:</b> {{ order.date_added|date_modify("+0 hours")|date(store_date_format, store_timezone) }}</li>
  38.                 <li><b>Order Number:</b> {{ order.source_id }}</li>
  39.                 <li><b>Email:</b> {{ order.email }}</li>
  40.                 {% if order.shipping.phone %}<li><b>Phone:</b> {{ order.shipping.phone }}</li>{% endif %}
  41.                 {% if order.shipping_method %}<li><b>Shipping:</b> {{ order.shipping_method }}</li>{% endif %}
  42.  
  43.                 {# Checkout Data #}
  44.                 {% if order.checkout_data|length > 0 %}
  45.                     {% for key, val in order.checkout_data %}
  46.                     <li><b>{{ key }}:</b> {{ val }}</li>
  47.                     {% endfor %}
  48.                 {% endif %}
  49.             </ul>
  50.             <br>
  51.  
  52.             <table class="address_table" cellpadding="0" cellspacing="0" border="0">
  53.                 <tbody>
  54.                     <tr>
  55.                         <td>
  56.                             <b>Invoice Address:</b><br />
  57.                             {{ order.customer.first_name }} {{ order.customer.last_name }}<br>
  58.                             {% if order.customer.company %}{{ order.customer.company }}<br>{% endif %}
  59.                             {{ order.customer.address1 }}<br>
  60.                             {% if order.customer.address2 %}{{ order.customer.address2 }}<br>{% endif %}
  61.                             {{ order.customer.city }}, {{ order.customer.state }} {{ order.customer.postal_code }}<br>
  62.                             {{ order.customer.country != store_country ? order.customer.country }}<br>
  63.                         </td>
  64.                         <td>
  65.                             <b>Shipping Address:</b><br />
  66.                             {{ order.shipping.first_name }} {{ order.shipping.last_name }}<br>
  67.                             {% if order.shipping.company %}{{ order.shipping.company }}<br>{% endif %}
  68.                             {{ order.shipping.address1 }}<br>
  69.                             {% if order.shipping.address2 %}{{ order.shipping.address2 }}<br>{% endif %}
  70.                             {% if order.shipping.address3 %}{{ order.shipping.address3 }}<br>{% endif %}
  71.                             {% if order.shipping.address4 %}{{ order.shipping.address4 }}<br>{% endif %}
  72.                             {{ order.shipping.city }}, {{ order.shipping.state }} {{ order.shipping.postal_code }}<br>
  73.                             {{ order.shipping.country != store_country ? order.shipping.country }}<br>
  74.                         </td>
  75.                     </tr>
  76.                 </tbody>
  77.             </table>
  78.  
  79.             {# Show Products #}
  80.             <table class="product_table" cellpadding="5" cellspacing="5" border="0">
  81.                 <thead>
  82.                     <tr>
  83.                         <th class="product_header">Product</td>
  84.                         <th class="price_header" class="short_cell">Price</th>
  85.                         <th class="qty_header" class="short_cell">Qty</th>
  86.                         <th class="subtotal_header product_total_price_header" class="short_cell">Subtotal</th>
  87.                     </tr>
  88.                 </thead>
  89.                 <tbody>
  90.                 {# List of Items in Order #}
  91.                 {% for item in order.order_items %}
  92.                     <tr>
  93.                         <td>
  94.                             {{ item.name }}
  95.  
  96.                             <!-- This is the part that makes the barcode -->
  97.                             <!-- See alternate options at http://barcode-coder.com/en/barcode-online-generator-2.html -->
  98.                             <div id="barcode{{ item.id }}"></div>
  99.                             <script type="text/javascript">
  100.                             jQuery("#barcode{{ item.id }}").barcode("{{ item.code }}", "code128");
  101.                             </script>
  102.  
  103.                             {# Checkout Data and Variations #}
  104.                             {% if item.variation_list|length > 0 %}
  105.                                 <ul>
  106.                                 {% for key, val in item.variation_list %}
  107.                                     <li><b>{{ key }}:</b> {{ val }}</li>
  108.                                 {% endfor %}
  109.                                 </ul>
  110.                             {% endif %}
  111.                         </td>
  112.  
  113.                         <td>{{ item.price|money_format }}</td>
  114.                         <td>{{ item.quantity }}</td>
  115.                         <td>{{ (item.quantity * item.price)|money_format }}</td>
  116.                     </tr>
  117.                 {% endfor %}
  118.  
  119.                 {# Show Totals #}
  120.  
  121.                 {% if order.shipping_total > 0 %}
  122.                 <tr>
  123.                     <td colspan="3" align="right"><b>Shipping:</b></td>
  124.                     <td>{{ order.shipping_total|money_format }}</td>
  125.                 </tr>
  126.                 {% endif %}
  127.  
  128.                 {% if order.tax_total > 0 %}
  129.                 <tr>
  130.                     <td colspan="3" align="right"><b>Tax:</b></td>
  131.                     <td>{{ order.tax_total|money_format }}</td>
  132.                 </tr>
  133.                 {% endif %}
  134.                 {% if order.discount_list|length > 0 %}
  135.                     {% for discount in order.discount_list %}
  136.                     <tr>
  137.                         <td colspan="3" align="right"><b>{{ discount.name|e }}:</b></td>
  138.                         <td>{{ discount.amount|money_format }}</td>
  139.                     </tr>
  140.                     {% endfor %}
  141.                 {% endif %}
  142.  
  143.                 <tr>
  144.                     <td colspan="3" align="right"><b>Total:</b></td>
  145.                     <td>{{ order.order_total|money_format }}</td>
  146.                 </tr>
  147.  
  148.                 </tbody>
  149.             </table>
  150.         </div>
  151.     </div>
  152.  
  153.     {# Show a Nice Shadow Image at the Bottom of The Table #}
  154.     <div class="shadowimg"><img src="{{ base_url }}/images/paper-shadow.png" width="505" height="8" alt="shadow" /></div>
  155.  
  156.     {# This is a nice place to put a thank-you message #}
  157.     <p class="receipt_footer"></p>
  158. </div>
  159.  
  160.  
  161. {% endfor %}
  162.  
  163.  
  164. </body>
  165. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement