Overview
If you have any custom fields on your Cart page which may be used to collect a bit of information about the customer, or anything about the order in general, you may notice that they might not be sending through to the Easy Purchase Orders app. We certainly want to ensure that your existing functionality works properly with our app, so we have made the following tutorial to help display the collected data about an order within your Purchase Orders. We will just cover a general placement of the Cart Attributes within our base template, and you may have to play with the placement location to get a result that is catered to your needs.
Here is an example of some Cart Note's on the Cart page:
(This tutorial assumes that these fields are already existing on your cart page, and you are only looking to add the values to the Purchase Order.)
If you need to add cart attribute FIELDS to your cart page. Please follow this tutorial HERE
If you follow the steps outlined below, adding the values from these custom fields to your Purchase Orders will be a breeze!
Email Template
Step 1: Locate Your Templates
Navigate to the Templates page by clicking on the "Templates" link in the main navigation at the top of our app. Then, make sure you're editing the Email Template, by clicking on the "Email" link on the left hand side of the page.
Step 2: Find the end of the Product Loop
Now that you're editing the Email Template, we will need to locate the loop that is showing the products.
You can find the beginning of this loop by scrolling inside of the editor and looking for this line (Mine was on line 127, yours may be on a different line number):
{% for line in line_items %}
This line will loop through all of the products in your Purchase Order, and display the details of that specific product.
Personally, I feel that the best placement of the Cart Notes would be just below the product loop, and above the Subtotal. So lets locate this line now.
Since we're placing the Cart Attributes just after the Product Loop, we will need to find where this loop ends. Scroll down from the snippet you located above, and look for this snippet:
{% endfor %}
Step 3: Paste the Code!
Once you have found this snippet, click at the very end of the line that the snippet is on, press the enter key, and then paste the following code:
{% assign attribute_size = note_attributes | size %}
{% if attribute_size > 0 %}
<tr>
<td>
<p>
<b>Cart Notes:</b><br>
{% for n in note_attributes %}
{% unless n.value == blank %}
<small><b>{{ n.name }}:</b></small>
{% if n.value contains '/uploads/' %}
<a target="_blank" href="{{ n.value }}"><small>Link</small></a>
{% else %}
<small>{{ n.value }}</small>
{% endif %}
<br>
{% endunless %}
{% endfor %}
</p>
</td>
</tr>
{% endif %}
Your finalized Code should look something like this:
Step 4: Save!
You're done! Just click the Green "Save" button underneath the editor, and your Email Templates will now show the values from any custom form fields that you have on your Cart page!
PDF Template
Step 1: Locate your Templates
Navigate to the Templates page by clicking on the "Templates" link in the main navigation at the top of our app. Then, make sure you're editing the PDF Template, by clicking on the "Purchase Order PDF" link on the left hand side of the page.
Step 2: Find the End of the Product Loop
Now that you're editing the PDF Template, we will need to locate the loop that is showing the products.
You can find this loop by scrolling inside of the editor and looking for this line (Mine was on line 151, yours may be on a different line number):
{% for line in line_items %}
This line will loop through all of the products in your Purchase Order, and display the details of that specific product.
Personally, I feel that the best placement of the Cart Notes would be just below the product loop, and above the Subtotal. So lets locate this line spot now.
Since we're placing the Cart Attributes just after the Product Loop, we will need to find where this loop ends. Scroll down from the snippet you located above, and look for this snippet:
{% endfor %}
Step 3: Paste the code!
Once you have found this snippet, click at the very end of the line that your snippet is on, press the enter key, and then paste the following code:
{% assign attribute_size = note_attributes | size %}
{% if attribute_size > 0 %}
<tr class="total">
<td></td>
<td>
<b>Cart Notes:</b><br>
</td>
</tr>
<tr class="total">
<td></td>
<td>
{% for n in note_attributes %}
{% unless n.value == blank %}
<small><b>{{ n.name }}:</b></small>
{% if n.value contains '/uploads/' %}
<a target="_blank" href="{{ n.value }}"><small>Link</small></a>
{% else %}
<small>{{ n.value }}</small>
{% endif %}
<br>
{% endunless %}
{% endfor %}
</td>
</tr>
{% endif %}
Your finalized Code should look something like this:
Step 4: Save!
You're done! Just click the Green "Save" button underneath the editor, and your Purchase Order PDF Templates will now show the values from any custom form fields that you have on your Cart page!