Liquid: Order Confirmation Emails - are there logs while previewing faulty code?

Highlighted
New Member
1 0 0

Hello! I am new to Shopify but not to web development. I am curious if there is a log, or console of sorts, to view the actions of the code I write for Confirmation emails?

There is something wrong with the code I've written and I am trying to locate the issue. It's not pulling a particular Product type, but skipping over it and pulling the rest of the product types just fine. So there is something wrong somewhere and I am trying to pin it down. I figured logs would show me an error which would provide a better clue as to what I need to correct. The code is below, our problem child is customize93 and customize94. This is a for now solution that works - we want this to run when people place tshirt orders. However, there are other items that will run this as well so it's not ideal. However, simply declaring {% if type_tshirt == true %} is not working. Neither is {% if type == "PD Custom Product" %}, and I even tried pulling it by vendor. I feel like there must be some condition somewhere somehow interfering/overriding the Product Type PD Custom Product.

Declaring variables and assessing products:

{% capture maincustomize %}
    <p>If you selected "Start Now - Pay Later" as your payment method you will be sent an invoice via email after art approval. Use the link in the email to submit payment using either VISA, MasterCard, American Express or PayPal. It needs to be paid in full before we can ship.</p>
<p>To upload files and complete your order click here:</p>
<p><div class="button button__cell"><a href="https://www.atomicdisc.com/pages/main-completing-your-order-snpl" class="button__text">Completing Your Order</a></div></p>
{% endcapture %}

<!-- apolomultimedia -->

<!-- the empty variables are declared -->
{% assign customize01 = '' %}
{% assign customize02 = '' %}
{% assign customize05 = '' %}
{% assign customize06 = '' %}
{% assign customize07 = '' %}
{% assign customize08 = '' %}
{% assign customize09 = '' %}
{% assign customize10 = '' %}
{% assign customize11 = '' %}
{% assign customize12 = '' %}
{% assign customize13 = '' %}
{% assign customize14 = '' %}
{% assign customize15 = '' %}
{% assign customize16 = '' %}
{% assign customize17 = '' %}
{% assign customize18 = '' %}
{% assign customize19 = '' %}
{% assign customize20 = '' %}
{% assign customize21 = '' %}
{% assign customize22 = '' %}
{% assign customize23 = '' %}
{% assign customize24 = '' %}
{% assign customize25 = '' %}
{% assign customize26 = '' %}
{% assign customize39 = '' %}
{% assign customize40 = '' %}
{% assign customize41 = '' %}
{% assign customize42 = '' %}
{% assign customize43 = '' %}
{% assign customize44 = '' %}
{% assign customize45 = '' %}
{% assign customize46 = '' %}
{% assign customize59 = '' %}
{% assign customize60 = '' %}
{% assign customize61 = '' %}
{% assign customize62 = '' %}
{% assign customize63 = '' %}
{% assign customize64 = '' %}
{% assign customize65 = '' %}
{% assign customize66 = '' %}
{% assign customize67 = '' %}
{% assign customize68 = '' %}
{% assign customize69 = '' %}
{% assign customize70 = '' %}
{% assign customize71 = '' %}
{% assign customize72 = '' %}
{% assign customize73 = '' %}
{% assign customize74 = '' %}
{% assign customize75 = '' %}
{% assign customize76 = '' %}
{% assign customize77 = '' %}
{% assign customize78 = '' %}
{% assign customize79 = '' %}
{% assign customize80 = '' %}
{% assign customize81 = '' %}
{% assign customize82 = '' %}
{% assign customize83 = '' %}
{% assign customize84 = '' %}
{% assign customize85 = '' %}
{% assign customize86 = '' %}
{% assign customize87 = '' %}
{% assign customize88 = '' %}
{% assign customize89 = '' %}
{% assign customize90 = '' %}
{% assign customize91 = '' %}
{% assign customize92 = '' %}
{% assign customize93 = '' %}
{% assign customize94 = '' %}
{% assign type_disc = '' %}
{% assign variant_type_disc = '' %}
{% assign qty_type_disc = 0 %}
{% assign type_vinyl = '' %}
{% assign type_mastering = '' %}
{% assign type_print = '' %}
{% assign type_graphics = '' %}
{% assign type_tshirt = '' %}
{% assign variant_type_graphics = '' %}
{% assign reorders = '' %}
{% assign reorder_yes = 0 %}
{% assign reorder_no = 0 %}
<!-- end the empty variables are declared -->

<!-- get the name of the payment method -->
  {% assign transaction_count = transactions | size %}
  {% if transaction_count > 0 %}
    {% for transaction in transactions %}
      {% if transaction.payment_details.credit_card_company %}
      {% else %}
        {% assign gateway = transaction.gateway | replace: "_", " " %}
      {% endif %}
    {% endfor %}
  {% endif %}
<!-- end get the name of the payment method -->

<!-- Go through the products of the order-->
{% for line in line_items %}
  {% assign type = '' %}
  <!-- get the type of product -->
  {% for propertie in line.properties %}
    {% if propertie.last %}
      {% assign name = propertie.first %}
      {% assign value = propertie.last %}
    {% else %}
      {% assign name = propertie.name %}
      {% assign value = propertie.value %}
    {% endif %}
    {% if name == 'Is this a re-order?' %}
      {% assign reorders =  reorders | append: value | append: ',' %}
    {% endif %}
    {% if name == 'Product Type' %}
      {% assign type = value %}
    {% endif %}
  {% endfor %}
  <!-- end get the type of product-->


  <!-- Evaluate the type of product if exists set type as true -->
  {% if type == "Disc" %}
    {% assign type_disc = true %}
    {% assign variant_type_disc =  variant_type_disc | append: line.variant.title | append: '|' %} <!-- save the current variants of the product CD -->
    {% assign qty_type_disc = qty_type_disc | plus: 1 %} <!-- if there is a product type cd its sum 1 in the counter -->
  {% endif %}

  {% if type == "Vinyl" %}
    {% assign type_vinyl = true %}
  {% endif %}

  {% if type == "Mastering" %}
    {% assign type_mastering = true %}
  {% endif %}

   {% if type == "Print" %}
    {% assign type_print = true %}
  {% endif %}

  {% if type == "PD Custom Product" %}
    {% assign type_tshirt = true %}
  {% endif %}

  {% if type == "Graphics" %}
    {% assign type_graphics = true %}
    {% assign variant_type_graphics =  variant_type_graphics | append: line.variant.title | append: '|' %} <!-- save the current variants of the product Graphics -->
  {% endif %}
  <!-- end Evaluate the type of product if exists set type as true -->

 And capturing the customize93 & customize94:

  {% capture customize93 %}
    {% if  gateway == "shopify_payments" or gateway == "paypal" %}
      {% if type_vinyl == '' and type_graphics == '' and variant_type_graphics == '' and type_mastering == '' and type_disc == '' and qty_type_disc == 0 and variant_type_disc == '' and type_print ==  '' %}
        <p>We will get started on your T-shirts right away.</p><p>However, if our graphic designers find any issues with your graphic file, we will notify you via email.</p><p>You will be emailed a tracking number when the order ships.</p><p>We will ship your order with signature confirmation unless you reply to this email specifying that you would like to waive the signature confirmation. Without signature confirmation, Atomic Disc cannot issue any refunds in case of a damaged or lost shipment.</p>
      {% endif %}
    {% endif %}
  {% endcapture %}

  {% capture customize94 %}
    {% if gateway == "Start Now - Pay Later - you will be invoiced via email" %}
      {% if type_vinyl == '' and type_graphics == '' and variant_type_graphics == '' and type_mastering == '' and type_disc == '' and qty_type_disc == 0 and variant_type_disc == '' and type_print ==  '' %}
        <p>Since you selected "Start Now - Pay Later" as your payment method you will be sent an invoice via email. Use the link in the email to submit payment using either VISA, MasterCard, American Express or PayPal. Your invoice <b>needs to be paid in full before we can start printing your T-shirts.</b></p><p>If our graphic designers find any issues with your graphic file, we will notify you via email.</p><p>You will be emailed a tracking number when the order ships.</p><p>We will ship your order with signature confirmation unless you reply to this email specifying that you would like to waive the signature confirmation. Without signature confirmation, Atomic Disc cannot issue any refunds in case of a damaged or lost shipment.</p>
      {% endif %}
    {% endif %}
  {% endcapture %}
0 Likes
Highlighted
Explorer
81 8 11

you can check your theme code get the product by the vendor the same to cross-check with the collection template and product template. 

I would like to say add information about what theme you used. 

 

 

 

0 Likes