boldsupport
4/19/2017 - 4:03 PM

Orders Code

{% capture bold_product_options %}
{% comment %}
BOLD - Product Options HTML Email Template Update
Sets updated price, determines invisible rows & creates list of item properties
TO USE:
* Paste this code block into your template immediately after "for line in line_items"
* Find any instances of line.price and change to bold_price to update the unit price (if used)
* Find any instances of line.line_price and change to bold_line_price to update the total line price (if used)
* Add {{ bold_options }} to the item description where you would like the list of selected options to display (usually immediately after the line.title)
* Options may be styled by applying CSS to the class "bold_options"
{% endcomment%}
{% if line.properties.builder_id %}
{% assign bold_builder_id = line.properties.builder_id %}
{% assign bold_master_builder = line.properties.master_builder %}
{% else %}
{% assign bold_builder_id = line.properties._builder_id %}
{% assign bold_master_builder = line.properties._master_builder %}
{% endif %}
{% if bold_master_builder == blank and bold_builder_id != blank %}{% continue %}{% endif %}
{% assign bold_options = " " %}
{% for bold_option in line.properties %}
{% assign first_char = bold_option.first | slice: 0, 1 %}
{% assign opt_title = bold_option | first %}
{% assign opt_desc = bold_option | last %}
{% unless first_char == '_' or bold_option.first == 'master_builder' or bold_option.first == 'builder_id' or bold_option.first == 'builder_info' or bold_option.last == "" %}
{% assign bold_options = bold_options | append: '
' | append: opt_title | append: ': ' | append: opt_desc %}
{% endunless%}
{% endfor %}
{% assign bold_options = bold_options | prepend: '' | append: "" %}
{% if bold_builder_id != blank %}
{% assign bold_price = 0 %}
{% for bold_item in line_items %}
{% if bold_item.properties.builder_id == bold_builder_id or bold_item.properties._builder_id == bold_builder_id %}
{% assign bold_price = bold_price | plus: bold_item.price %}
{% endif %}
{% endfor %}
{% assign bold_line_price = bold_price | times: line.quantity %}
{% else %}
{% assign bold_price = line.price %}
{% assign bold_line_price = line.line_price %}
{% endif %}
{% endcapture %}