-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathproduct.html.twig
145 lines (131 loc) · 5.11 KB
/
product.html.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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
{% extends 'base.html.twig' %}
{% block stylesheets %}
{{ parent() }}
{{ encore_entry_link_tags('product') }}
{% endblock %}
{% block javascripts %}
{{ parent() }}
{{ encore_entry_script_tags('product') }}
{% endblock %}
{% set productId = attr('product', 'id') %}
{% block title %}
{{ attr('product', 'title') }}
{% endblock %}
{% set product = resources('/api/front/products/' ~ productId) %}
{% set productCategory = product.productCategories|filter(c => c.defaultCategory)|first.category %}
{% set currentPse = resources('/api/front/products/' ~ productId)|first %}
{% if app.request.get('ref') %}
{% set currentPse = resources('/api/front/product_sale_elements', {ref : app.request.get('ref')})|first %}
{% endif %}
{% block body %}
<div class="ProductPage">
<div class="lg:justify-between lg:items-center mb-[29px] lg:flex">
{{ component('Molecules:Breadcrumb:Breadcrumb', {
items: [
{ href: productCategory.publicUrl|default('#'), label:productCategory.i18ns.title},
],
backIcon: true
}) }}
</div>
<div class="container">
<div class="ProductPage-grid">
<section id="infos" class="ProductPage-infos">
<h1 class="mb-3 h3">{{ attr('product', 'title') }}</h1>
{% set chapo = attr('product', 'chapo') %}
{% if chapo %}
<div class="paragraph-3 text-grey">{{ chapo }}</div>
{% endif %}
{% set attributes = getAttributesAndValues(productId) %}
{{ component('Flexy:Layout:PseSelector', {product}) }}
{# TODO : ajouter les couleurs aux attributs (voir ex commenté) #}
{# {% set colors = [ #}
{# { value: 1, color: '#6969B3', label: 'State Blue' }, #}
{# { value: 2, color: '#FFB698', label: 'Vermillon' }, #}
{# { value: 3, color: '#767676', label: 'Grey' }, #}
{# { value: 4, color: '#84DCC6', label: 'Tiffany Blue', disabled: true }, #}
{# { value: 5, color: '#DD6E42', label: 'Sienna' }, #}
{# { value: 6, color: '#C17767', label: 'Old Rose' }, #}
{# ] %} #}
{# <div class="mt-4"> #}
{# {% include '@components/Organisms/Modules/Filters/FilterColor.html.twig' with {options: colors, name: 'color', label: 'Couleur',id: 'filterColor'} %} #}
{# </div> #}
<div class="mt-[30px]"> {% include '@components/Organisms/Reinsurance/Reinsurance.html.twig' with {data: [
{
strongText: 'Free delivery'|trans,
text: ' from 50€'|trans,
icon: 'reinsurance-delivery'
},
{
strongText: 'Shipping'|trans,
text: ' within 24 hours'|trans,
icon: 'reinsurance-shipping'
}
]} %}
</div>
</section>
<section id="gallery" class="ProductPage-gallery">
{% include '@components/Layout/ProductGallery/ProductGallery.html.twig' with {productId:productId, currrentPse } %}
</section>
<section id="description" class="ProductPage-description">
{% set descriptionContent %}
<p>toto 2</p>
{% endset %}
{% include '@components/Molecules/Accordion/Accordion.html.twig' with {
title: 'Description'|trans,
content: descriptionContent,
iconPlus: "plus",
iconMinus: "minus",
} %}
{% include '@components/Molecules/Accordion/Accordion.html.twig' with {
title: 'Features'|trans,
content: "tata",
iconPlus: "plus",
iconMinus: "minus",
} %}
{% include '@components/Molecules/Accordion/Accordion.html.twig' with {
title: 'Shipping & Returns'|trans,
content: "",
iconPlus: "plus",
iconMinus: "minus",
} %}
{% include '@components/Molecules/Accordion/Accordion.html.twig' with {
title: 'Verified Reviews'|trans,
content: "",
iconPlus: "plus",
iconMinus: "minus",
} %}
</section>
</div>
</div>
<div class="container mx-auto">
{{ component('Flexy:Components:Blocks', {item_type: 'product', item_id: product.id}) }}
</div>
<div class="bg-theme-lighter mt-[50px]">
{{ component('Flexy:CrossSelling',{categoryId:productCategory.id,title:'Lastseenproducts'|trans}) }}
</div>
{% include '@components/Layout/Reinsurance/Reinsurance.html.twig' with { data: [
{
strongText: 'Free delivery' | trans,
text: 'For any order over €100' | trans,
linkLabel: 'See conditions' | trans,
link: '#',
icon: 'reinsurance-delivery'
},
{
strongText: 'Secure payment' | trans,
text: 'Credit card, Paypal' | trans,
linkLabel: 'See conditions' | trans,
link: '#',
icon: 'reinsurance-payment'
},
{
strongText: 'Satisfied or refunded' | trans,
text: 'Exchange or refund offered within 30 days' | trans,
linkLabel: 'See conditions' | trans,
link: '#',
icon: 'reinsurance-satisfied'
}
] } %}
</div>
{{ component('Flexy:Organisms:AddToCartToast') }}
{% endblock %}