Skip to content

Commit

Permalink
Initial Commit
Browse files Browse the repository at this point in the history
  • Loading branch information
sparkweb committed Jul 18, 2014
1 parent a468d14 commit a4cf168
Show file tree
Hide file tree
Showing 8 changed files with 1,987 additions and 2 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
foxycart-twig-templates-1.1
FoxyCart Twig Templates 1.1
===========================

FoxyCart 1.1 Twig Templates
More information about these templates can be found by going to the [FoxyCart Wiki](https://wiki.foxycart.com/v/1.1/templates#using_twig_with_foxycart)
356 changes: 356 additions & 0 deletions cart.inc.twig

Large diffs are not rendered by default.

60 changes: 60 additions & 0 deletions cart.inc.txt.twig
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
{# BEGIN CART TWIG TEMPLATE #}
{{ lang.email_text_cart|pad(60,"-"," ") }}

{% for item in items %}
{% if item.multiship >= 0 %}

{% set shipto_label = lang.cart_shipto|raw ~ ": " ~ item.shipto %}
{{ shipto_label|pad(40,"-"," ") }}

{% endif %}
{{ item.name }}
{% for option in item.options %}
* {{ option.name|pad(15) }} {{ option.value }}
{% endfor %}
{% if item.code != '' %}
* {{ lang.cart_code|raw|pad(15) }} {{ item.code }}
{% endif %}
{% if item.category_code != 'DEFAULT' %}
* {{ lang.cart_category|raw|pad(15) }} {{ item.category_code }}
{% endif %}
{% if item.weight != 0 %}
* {{ lang.cart_weight|raw|pad(15) }} {{ item.weight }} {{ weight_uom }}
{% endif %}
{% if item.subscription_frequency != '' %}
* {{ lang.cart_subscription_details|raw }}
- {{ lang.cart_frequency|raw|pad(11) }} {{ item.subscription_frequency }}
- {{ lang.cart_start_date|raw|pad(11) }} {{ item.subscription_start_date }}
- {{ lang.cart_next_date|raw|pad(11) }} {{ item.subscription_next_transaction_date }}
{% if item.subscription_end_date != "0000-00-00" %}
- {{ lang.cart_end_date|raw|pad(11) }} {{ item.subscription_end_date }}
{% endif %}
{% endif %}
* {{ lang.cart_quantity|pad(15) }} {{ item.quantity|raw }}
* {{ lang.cart_price|raw|pad(20) }} {{ item.price_total }}{% if item.quantity > 1 %} ({{ item.price_each }} {{ lang.cart_each|raw }}){% endif %}


{% endfor %}
{{ lang.cart_subtotal|raw|pad(24) }} {{ cart_sub_total }}
{% if has_future_products %}
{{ lang.cart_future_subscriptions|raw|pad(24) }} {{ future_total_price }}
{% endif %}
{% for coupon in coupons %}
{% set coupon_label = coupon.name ~ " (" ~ coupon.code ~ ")" %}
{{ coupon_label|pad(24) }} {{ coupon.amount }}
{% endfor %}
{{ shipping_and_handling_label|raw|pad(24) }} {{ cart_total_shipping }}
{% if has_future_products and show_future_shipping_and_handling %}
{% set future_shipping_handling_label = lang.cart_future_subscriptions|raw ~ " " ~ shipping_and_handling_label|raw %}
{{ future_shipping_handling_label|pad(24) }} {{ future_shipping_and_handling }}
{% endif %}
{% if has_taxes %}
{% for tax in taxes %}
{% if tax.show_tax %}
{{ tax.description_text|raw|pad(24) }} {{ tax.amount }}
{% endif %}
{% endfor %}
{% endif %}
{{ lang.cart_order_total|raw|pad(24) }} {{ cart_order_total }}

{# END CART TWIG TEMPLATE #}
758 changes: 758 additions & 0 deletions checkout.inc.twig

Large diffs are not rendered by default.

8 changes: 8 additions & 0 deletions checkout_error.inc.twig
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<div id="fc_checkout_container" class="fc_error_session">
{% for error_code in error_codes %}
{{ lang[error_code]|raw }}
<p>
<a href="{{ store_url }}">{{ store_name }}</a>
</p>
{% endfor %}
</div>
154 changes: 154 additions & 0 deletions email_order_details.inc.twig
Original file line number Diff line number Diff line change
@@ -0,0 +1,154 @@
{# BEGIN EMAIL TWIG TEMPLATE #}
{% if not is_updateinfo %}
{% if has_downloadables %}
<p id="fc_downloadable_products" class="fc_heading">
<strong>{{ lang.email_html_downloadable_products|raw }}</strong>
</p>
<ol style="font-size:12px;" id="fc_download_links_list">
{{ html_downloadable_links|raw }}
</ol>
{% endif %}
<p id="fc_order_summary" class="fc_heading"><strong>{{ lang.email_html_order_summary|raw }}</strong></p>
<ul style="font-size:12px;" id="fc_order_summary_ul">
<li><strong>{{ lang.email_order_number|raw }}:</strong> {{ order_id }}</li>
<li><strong>{{ lang.checkout_date|raw }}:</strong> {{ checkout_date }}</li>
{% if purchase_order != '' %}
<li><strong>{{ lang.checkout_purchase_order|raw }}:</strong> {{ purchase_order }}</li>
{% endif %}
{% if payment_type == 'plastic' %}
<li><strong>{{ lang.checkout_card_number|raw }}:</strong> {{ cc_number_masked }} ({{ cc_type }})</li>
{% endif %}
<li><strong>{{ lang.email_order_total|raw }}:</strong> {{ order_total }}</li>
{% if has_live_rate_shippable_products and not has_multiship %}
<li><strong>{{ lang.email_shipping|raw }}:</strong> {{ shipping_service_description }}</li>
{% endif %}
{% for custom_field in custom_fields %}
{% if not custom_field.is_hidden %}
<li><strong>{{ custom_field.name }}:</strong> {{ custom_field.value }}</li>
{% endif %}
{% endfor %}
</ul>
{% endif %}
<p id="fc_purchasing_information" class="fc_heading"><strong>{{ lang.email_html_purchasing_information|raw }}</strong></p>
<p id="fc_purchasing_information_email">
<span style="display:block;" class="fc_item_label"><strong>{{ lang.email_email|raw }}:</strong> </span>
<span class="fc_item_data">{{ email }}</span>
</p>
<p id="fc_purchasing_information_billing_address">
<span style="display:block;" class="fc_item_label"><strong>{{ lang.email_billing_address|raw }}:</strong> </span>
<span class="fc_item_data">
{{ first_name }} {{ last_name }}<br />
{% if company != '' %}
{{ company }}<br />
{% endif %}
{{ address1 }}<br />
{% if address2 != '' %}
{{ address2 }}<br />
{% endif %}
{{ city }}, {{ region_code }} {{ postal_code }}<br />
{{ country_name }}<br />
{% if geoip_html != '' %}
{{ geoip_html }}<br />
{% endif %}
{% if phone != '' %}
{{ phone }}<br />
{% endif %}
</span>
</p>

{% if not has_multiship %}
{% if use_alternate_shipping_address or has_shippable_products %}
<p id="fc_purchasing_information_shipping_address">
<span style="display:block;" class="fc_item_label"><strong>{{ lang.email_shipping_address|raw }}:</strong> </span>
<span class="fc_item_data">
{% if use_alternate_shipping_address %}
{{ shipping_first_name }} {{ shipping_last_name }}<br />
{% if shipping_company != '' %}
{{ shipping_company }}<br />
{% endif %}
{{ shipping_address1 }}<br />
{% if shipping_address2 != '' %}
{{ shipping_address2 }}<br />
{% endif %}
{{ shipping_city }}, {{ shipping_region_code }} {{ shipping_postal_code }}<br />
{{ shipping_country_name }}<br />
{% if shipping_phone != '' %}
{{ shipping_phone }}<br />
{% endif %}
{% else %}
{{ first_name }} {{ last_name }}<br />
{% if company != '' %}
{{ company }}<br />
{% endif %}
{{ address1 }}<br />
{% if address2 != '' %}
{{ address2 }}<br />
{% endif %}
{{ city }}, {{ region_code }} {{ postal_code }}<br />
{{ country_name }}<br />
{% if geoip_html != '' %}
{{ geoip_html }}<br />
{% endif %}
{% if phone != '' %}
{{ phone }}<br />
{% endif %}
{% endif %}
</span>
</p>
{% endif %}
{% else %}
{% for multiship in multiship_data %}
<p class="fc_purchasing_information_shipping_address">
<span style="display:block;" class="fc_item_label"><strong>{{ lang.email_ship_to|raw }}:</strong> <span class="fc_shipto_name">{{ multiship.address_name }}</span></span>
<span class="fc_item_data">
{{ multiship.first_name }} {{ multiship.last_name }}<br />
{% if multiship.company != '' %}
{{ multiship.company }}<br />
{% endif %}
{{ multiship.address1 }}<br />
{% if multiship.address2 != '' %}
{{ multiship.address2 }}<br />
{% endif %}
{{ multiship.city }}, {{ multiship.region_code }} {{ multiship.postal_code }}<br />
{{ multiship.country_name }}<br />
{% if multiship.phone != '' %}
{{ multiship.phone }}<br />
{% endif %}

{% for custom_field in multiship.custom_fields %}
{% if not custom_field.is_hidden %}
<strong>{{ custom_field.name }}:</strong> {{ custom_field.value }}<br />
{% endif %}
{% endfor %}
{% if not is_updateinfo %}
<strong>{{ lang.email_subtotal|raw }}:</strong> {{ multiship.sub_total|money_format }}<br />
{% endif %}
{% if has_live_rate_shippable_products %}
<strong>{{ multiship.shipping_service_description }}:</strong> {{ multiship.shipping_total|money_format }}<br />
{% else %}
{% if has_shippable_products %}
<strong>{{ shipping_and_handling_label|raw }}: {{ multiship.shipping_total|money_format }}<br />
{% endif %}
{% endif %}
{% if not is_updateinfo %}
<strong>{{ lang.email_tax|raw }}:</strong> {{ multiship.tax_total|money_format }}<br />
<strong>{{ lang.email_group_total|raw }}:</strong> {{ multiship.total|money_format }}<br />
{% endif %}
</span>
</p>
{% endfor %}
{% endif %}
<div style="float:none; clear:both;"></div>
{% if subscriptions|length > 0 and not is_subscription_cancel %}
<p id="fc_manage_subscriptions" class="fc_heading"><strong>{{ lang.email_html_manage_subscriptions|raw }}</strong></p>
<p id="fc_subscription_instructions">{{ lang.email_html_subscription_instructions|raw }}</p>
<ul class="fc_subscription_links">
{% for subscription in subscriptions %}
<li style="padding-bottom:10px;">
{{ subscription.description }}<br />
{{ subscription.html_links|raw }}
</li>
{% endfor %}
</ul>
{% endif %}
{# END EMAIL TWIG TEMPLATE #}
151 changes: 151 additions & 0 deletions email_order_details.inc.txt.twig
Original file line number Diff line number Diff line change
@@ -0,0 +1,151 @@
{# BEGIN EMAIL ORDER DETAILS TWIG TEMPLATE #}
{% if not is_updateinfo %}
{% if has_downloadables %}
{{ lang.email_text_downloadable_products|raw|pad(60,"-"," ") }}

{{ text_downloadable_links|raw }}

{% endif %}
{{ lang.email_text_order_summary|raw|pad(60,"-"," ") }}

* {{ lang.email_order_number|raw|pad(20) }} {{ order_id }}
* {{ lang.checkout_date|raw|pad(20) }} {{ checkout_date }}
{% if purchase_order != '' %}
* {{ lang.checkout_purchase_order|raw|pad(20) }} {{ purchase_order }}
{% endif %}
{% if payment_type == 'plastic' %}
* {{ lang.checkout_card_number|raw|pad(20) }} {{ cc_number_masked }} ({{ cc_type }})
{% endif %}
* {{ lang.email_order_total|raw|pad(20) }} {{ order_total }}
{% if has_live_rate_shippable_products and not has_multiship %}
* {{ lang.email_shipping|raw|pad(20) }} {{ shipping_service_description }}
{% endif %}
{% if custom_fields|length > 0 %}

{% for custom_field in custom_fields %}
{% if not custom_field.is_hidden %}
* {{ custom_field.name|pad(20) }} {{ custom_field.value }}
{% endif %}
{% endfor %}
{% endif %}
{% endif %}


{{ lang.email_text_purchasing_information|raw|pad(60,"-"," ") }}

{{ lang.email_email|raw }}:
{{ email }}

{{ lang.email_billing_address|raw }}:
{{ first_name }} {{ last_name }}
{% if company != '' %}
{{ company }}
{% endif %}
{{ address1 }}
{% if address2 != '' %}
{{ address2 }}
{% endif %}
{{ city }}, {{ region_code }} {{ postal_code }}
{{ country_name }}
{% if geoip != '' %}
{{ geoip }}
{% endif %}
{% if phone != '' %}
{{ phone }}
{% endif %}

{% if has_multiship %}
{% for multiship in multiship_data %}
{{ lang.email_ship_to|raw }}: {{ multiship.address_name }}
{{ multiship.first_name }} {{ multiship.last_name }}
{% if multiship.company != '' %}
{{ multiship.company }}
{% endif %}
{{ multiship.address1 }}
{% if multiship.address2 != '' %}
{{ multiship.address2 }}
{% endif %}
{{ multiship.city }}, {{ multiship.region_code }} {{ multiship.postal_code }}
{{ multiship.country_name }}
{% if multiship.phone != '' %}
{{ multiship.phone }}
{% endif %}

{% if multiship.custom_fields|length > 0 %}
{% for custom_field in multiship.custom_fields %}
{% if not custom_field.is_hidden %}
* {{ custom_field.name|pad(20) }}: {{ custom_field.value }}
{% endif %}
{% endfor %}

{% endif %}
{% if not is_updateinfo %}
{{ lang.email_subtotal|raw }}: {{ multiship.sub_total|money_format }}
{% endif %}
{% if has_live_rate_shippable_products %}
{{ multiship.shipping_service_description }}: {{ multiship.shipping_total|money_format }}
{% else %}
{% if has_shippable_products %}
{{ shipping_and_handling_label|raw }}: {{ multiship.shipping_total|money_format }}
{% endif %}
{% endif %}
{% if not is_updateinfo %}
{{ lang.email_tax|raw }}: {{ multiship.tax_total|money_format }}
{{ lang.email_group_total|raw }}: {{ multiship.total|money_format }}
{% endif %}

{% endfor %}
{% else %}
{% if use_alternate_shipping_address or has_shippable_products %}
{{ lang.email_shipping_address|raw }}:
{% if use_alternate_shipping_address %}
{{ shipping_first_name }} {{ shipping_last_name }}
{% if shipping_company != '' %}
{{ shipping_company }}
{% endif %}
{{ shipping_address1 }}
{% if shipping_address2 != '' %}
{{ shipping_address2 }}
{% endif %}
{{ shipping_city }}, {{ shipping_region_code }} {{ shipping_postal_code }}
{{ shipping_country_name }}
{% if shipping_phone != '' %}
{{ shipping_phone }}
{% endif %}
{% else %}
{{ first_name }} {{ last_name }}
{% if company != '' %}
{{ company }}
{% endif %}
{{ address1 }}
{% if address2 != '' %}
{{ address2 }}
{% endif %}
{{ city }}, {{ region_code }} {{ postal_code }}
{{ country_name }}
{% if phone != '' %}
{{ phone }}
{% endif %}
{% endif %}
{% endif %}

{% endif %}

{% if subscriptions|length > 0 and not is_subscription_cancel %}
{{ lang.email_text_manage_subscriptions|raw|pad(60,"-"," ") }}

{{ lang.email_text_subscription_instructions|raw }}

{% for subscription in subscriptions %}
{{ subscription.description }}

{{ subscription.text_links|raw }}
{% if not loop.last %}

----------------------------------------
{% endif %}

{% endfor %}

{% endif %}
{# END EMAIL ORDER DETAILS TWIG TEMPLATE #}
Loading

0 comments on commit a4cf168

Please sign in to comment.