forked from FoxyCart/2.0-templates
-
Notifications
You must be signed in to change notification settings - Fork 0
/
cart.inc.txt.twig
91 lines (86 loc) · 4.51 KB
/
cart.inc.txt.twig
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
{# BEGIN CART TWIG TEMPLATE #}
{{ config.lang.email_text_cart|pad(60,"-"," ")|raw }}
{% set show_product_options = true %}
{% set show_product_weight = true %}
{% set show_product_category = true %}
{% set show_product_code = true %}
{% set show_sub_frequency = true %}
{% set show_sub_startdate = true %}
{% set show_sub_nextdate = true %}
{% set show_sub_enddate = true %}
{% set hidden_product_options = [] %}
{% if config.template_config.cart_display_config.usage != "none" %}
{%- set show_product_options = config.template_config.cart_display_config.show_product_options -%}
{%- set show_product_weight = config.template_config.cart_display_config.show_product_weight -%}
{%- set show_product_category = config.template_config.cart_display_config.show_product_category -%}
{%- set show_product_code = config.template_config.cart_display_config.show_product_code -%}
{%- set show_sub_frequency = config.template_config.cart_display_config.show_sub_frequency -%}
{%- set show_sub_startdate = config.template_config.cart_display_config.show_sub_startdate -%}
{%- set show_sub_nextdate = config.template_config.cart_display_config.show_sub_nextdate -%}
{%- set show_sub_enddate = config.template_config.cart_display_config.show_sub_enddate -%}
{%- set hidden_product_options = config.template_config.cart_display_config.hidden_product_options -%}
{% endif %}
{% for item in items %}
{% if item.multiship >= 0 %}
{% set shipto_label = config.lang.cart_shipto ~ item.shipto %}
{{ shipto_label|pad(40,"-"," ")|raw }}
{% endif %}
{{ item.name }}
{% if show_product_options %}
{% for option in item.options %}
{% if (option.name|lower not in hidden_product_options) and (option.class|lower not in hidden_product_options) %}
* {{ option.name|pad(15) }} {{ option.value }}
{% endif %}
{% endfor %}
{% endif %}
{% if item.code != '' and show_product_code %}
* {{ config.lang.cart_code|pad(15)|raw }} {{ item.code }}
{% endif %}
{% if item.category != 'DEFAULT' and show_product_category %}
* {{ config.lang.cart_category|pad(15)|raw }} {{ item.category }}
{% endif %}
{% if item.weight != 0 and show_product_weight %}
* {{ config.lang.cart_weight|pad(15)|raw }} {{ item.weight }} {{ weight_uom }}
{% endif %}
{% if item.sub_frequency != '' and (show_sub_frequency or show_sub_nextdate or show_sub_startdate or show_sub_enddate) %}
* {{ config.lang.cart_subscription_details|raw }}
{% if show_sub_frequency %}
- {{ config.lang.cart_frequency|pad(11)|raw }} {{ item.sub_frequency }}
{% endif %}
{% if show_sub_startdate %}
- {{ config.lang.cart_start_date|pad(11)|raw }} {{ item.sub_startdate }}
{% endif %}
{% if show_sub_nextdate and item.sub_enddate != item.sub_nextdate and (item.sub_enddate == "0000-00-00" or (item.sub_enddate != "0000-00-00" and item.sub_enddate > item.sub_nextdate)) %}
- {{ config.lang.cart_next_date|pad(11)|raw }} {{ item.sub_nextdate }}
{% endif %}
{% if show_sub_enddate and item.sub_enddate != "0000-00-00" %}
- {{ config.lang.cart_end_date|pad(11)|raw }} {{ item.sub_enddate }}
{% endif %}
{% endif %}
* {{ config.lang.cart_quantity|pad(15)|raw }} {{ item.quantity }}
* {{ config.lang.cart_price|pad(20)|raw }} {{ item.price|money_format }}{% if item.quantity > 1 and item.price_each > 0 %} ({{ item.price_each|money_format }} {{ config.lang.cart_each|raw }}{% if (((item.price_each * 10000) % 100) != 0) %}... {{ item.price_each }}{% endif %}){% endif %}
{% endfor %}
{{ config.lang.cart_subtotal|pad(24)|raw }} {{ total_item_price|money_format }}
{% if has_future_products %}
{{ config.lang.cart_future_subscriptions|pad(24)|raw }} {{ total_future_item_price|money_format }}
{% endif %}
{% for key,coupon in coupons %}
{% set coupon_label = coupon.name ~ " (" ~ key ~ ")" %}
{{ coupon_label|pad(24) }} {{ coupon.amount|money_format }}
{% endfor %}
{{ shipping_and_handling_label|pad(24) }} {{ total_shipping|money_format }}
{% if has_future_products and show_future_shipping_and_handling %}
{% set future_shipping_handling_label = lang.cart_future_subscriptions ~ " " ~ shipping_and_handling_label %}
{{ future_shipping_handling_label|pad(24)|raw }} {{ future_shipping_and_handling|money_format }}
{% endif %}
{% if has_taxes %}
{% if has_multiship %}
{{ config.lang.cart_tax|pad(24)|raw }} {{ total_tax|money_format }}
{% else %}
{% for tax in shipping_address.taxes %}
{{ tax.name }} ({{ tax.rate }}%) {{ config.lang.cart_tax|pad(24)|raw }} {{ tax.amount|money_format }}
{% endfor %}
{% endif %}
{% endif %}
{{ config.lang.cart_order_total|pad(24)|raw }} {{ total_order|money_format }}
{# END CART TWIG TEMPLATE #}