-
Notifications
You must be signed in to change notification settings - Fork 0
/
products.twig
105 lines (102 loc) · 4.02 KB
/
products.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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
{% set ats = craft.entries.id(entryId).all() %}
{% set elite = craft.categories.group('plan_type').slug('elite') %}
{% set premium = craft.categories.group('plan_type').slug('premium') %}
{% set basic = craft.categories.group('plan_type').slug('basic') %}
{% set tabas = tabas ?? '' %}
{{ hiddenInput('tabas', tabas) }}
{% set eliteplan = craft.products()
.type('plans')
.relatedTo ([
'and',
{ targetElement: ats },
{ targetElement: elite }
])
.limit(1)
.all() %}
{% set premiumplan = craft.products()
.type('plans')
.relatedTo ([
'and',
{ targetElement: ats },
{ targetElement: premium }
])
.limit(1)
.all() %}
{% set basicplan = craft.products()
.type('plans')
.relatedTo ([
'and',
{ targetElement: ats },
{ targetElement: basic }
])
.limit(1)
.all() %}
<div class="columns pt-2 pb-2 mb-0">
<div class="column is-8 is-offset-2">
<div class="columns is-variable is-5">
<div class="column is-one-third">
<div sprig s-val:tabas="elite" class="bandau columns is-multiline is-elite-button {{ tabas == 'elite' ? 'is-premium-button-active' }} px-3">
<div class="column is-12 has-text-centered has-border-elite">
<span class="evioni-icon">Elite</span>
</div>
<div class="column is-7">
{% for product in eliteplan %}
{% set price = product.defaultVariant.salePrice / 24 %}
<span class="is-size-4 has-text-weight-normal">{{ price|number(decimals=2) }} </span><span class="is-size-7">€/mėn.</span>
</div>
<div class="column is-5 has-text-right">
<span class="is-size-4 has-text-weight-normal">{{ product.defaultVariant.salePrice }}</span><span class="is-size-7">€</span>
{% endfor %}
</div>
</div>
</div>
<div class="column is-one-third">
<div sprig s-val:tabas="premium" class="bandau columns is-multiline is-premium-button {{ tabas == 'premium' ? 'is-premium-button-active' }} px-3">
<div class="column is-12 has-text-centered has-border-premium">
<span class="evioni-icon">Premium</span>
</div>
<div class="column is-7">
{% for product in premiumplan %}
{% set price = product.defaultVariant.salePrice / 24 %}
<span class="is-size-4 has-text-weight-normal">{{ price|number(decimals=2) }} </span><span class="is-size-7">€/mėn.</span>
</div>
<div class="column is-5 has-text-right">
<span class="is-size-4 has-text-weight-normal">{{ product.defaultVariant.salePrice }}</span><span class="is-size-7">€</span>
{% endfor %}
</div>
</div>
</div>
<div class="column is-one-third">
<div sprig s-val:tabas="basic" class="bandau columns is-multiline is-basic-button {{ tabas == 'basic' ? 'is-basic-button-active' }} px-3">
<div class="column is-12 has-text-centered has-border-basic">
<span class="evioni-icon">Basic</span>
</div>
<div class="column is-7">
{% for product in basicplan %}
{% set price = product.defaultVariant.salePrice / 24 %}
<span class="is-size-4 has-text-weight-normal">{{ price|number(decimals=2) }} </span><span class="is-size-7">€/mėn.</span>
</div>
<div class="column is-5 has-text-right">
<span class="is-size-4 has-text-weight-normal">{{ product.defaultVariant.salePrice }}</span><span class="is-size-7">€</span>
{% endfor %}
</div>
</div>
</div>
</div>
</div>
</div>
{% if tabas == 'elite' %}
{% for product in eliteplan %}
{% include 'database/solutions/plans-list.twig' %}
{% endfor %}
{% endif %}
{% if tabas == 'premium' %}
{% for product in premiumplan %}
{% include 'database/solutions/plans-list.twig' %}
{% endfor %}
{% endif %}
{% if tabas == 'basic' %}
{% for product in basicplan %}
{% include 'database/solutions/plans-list.twig' %}
{% endfor %}
{% endif %}