Subversion-Projekte lars-tiefland.faltradxxs.de

Revision

Details | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
2 lars 1
{extends file="page.tpl"}
2
 
3
{block name="content"}
4
<script src="/JavaScript/money_format.js" type="text/javascript"></script>
5
<!-- START Basisartikel -->
6
{assign var="itemKey" value=$artstaemmeItems|count}
7
{assign var="item" value=$subdir.items[0]}
8
{include file="shopposition.tpl" nocache}
9
 
10
 
11
 
12
<form name="bestellung" action="/" id="basket">
13
    <input type="hidden" name="confirm" value="true" />
14
    <input type="hidden" name="buy" value="false" />
15
    <input type="hidden" name="Menge" value="1" />
16
    <input type="hidden" name="item" value="{$item->id}" />
17
    <input type="hidden" name="basket" value="true" />
18
 
19
<!-- ENDE Basisartikel -->
20
<section id="subdir_info_wrapper" class="konfig_wrapper">
21
    <div class="inner">
22
        {if $subdir.name || $subdir.description}
23
        <div>
24
            {if $subdir.name}
25
            <div>
26
               <h1>{$subdir.name}</h1>
27
            </div>
28
            {/if}
29
            {if $subdir.description}
30
            <div class="konfig_text">
31
                    {$subdir.description}
32
            </div>
33
            {/if}
34
        </div>
35
        {/if}
36
    </div>
37
 
38
    <div class="konfig_basket_button">
39
        <div class="scroll">
40
            <div>Dein persönlicher Komplettpreis:</div>
41
            <div id="orig_preis" style="display:none;">{$item->price[0]->preis}</div>
42
            <div id="current_preis" style="display:none;">{$item->price[0]->preis}</div>
43
            <div class="itemPreis" style="clear:both;float:none;margin-top:10px;text-align:right;">
44
                <span id="itemPreis">{$item->price[0]->preis|money_format|replace:"EUR":"&euro;"}</span>
45
            </div>
46
            <div style="clear:both;text-align:right;">
47
                <br /><font class="msg_small">{$langstrings.shop.price_msg_brutto} <a href="/index.php?mode=versand_uebersicht" style="cursor:pointer;">{$langstrings.shop.price_msg_link}</a></font>
48
                {if $item->weight > 0}
49
                   <br /> <font class="msg_small">Versandgewicht: {$item->weight} kg</font>
50
                {/if}
51
                {if $item->property_1 == 1}
52
                    <br /><font class="msg_small">(Speditionsartikel)</font>
53
                {/if}
54
 
55
                {if $item->gebinde_menge > 0 && $item->gebinde_einheit}
56
                    <br /><font class="msg_small">
57
                    Grundpreis: {$item->price[0]->preis/$item->gebinde_menge|number_format:2} / {$item->gebinde_einheit}
58
                    </font><br />
59
                {/if}
60
            </div>
61
 
62
            <div class="add_konfigitem_to_basket">
63
                <div class="basket_text">
64
                    {$langstrings.shop.in_basket}
65
                </div>
66
                <div class="button_inner">
67
                    <img src="/images/webelemente/icon_warenkorb_weiss.svg" alt="in den Warenkorb" />
68
                </div>
69
            </div>
70
 
71
        </div>
72
    </div>
73
 
74
</section>
75
 
76
{if $artstaemmeItems||$smarty.get.auspraegung}
77
<section id="subdir_konfig_wrapper">
78
    <div class="inner">
79
        <div class="konfig_box">
80
            <div class="konfig_menu_container">
81
                <div class="konfig_menu">
82
                    {foreach $artstaemmeItems as $key => $artstamm}
83
                        <div class="konfig_menu_item" data-konfigid="{$artstamm->id}">
84
                            <div class="selected" id="selected_{$artstamm->id}" title="{$artstamm->name}"><i class="fa fa-check" aria-hidden="true"></i></div>
85
                            {if $artstamm->medium[1]}
86
                                <img class="konfig_menu_img" src="/images/upload/{$artstamm->medium[1]->medium->folder}/kl/{$artstamm->medium[1]->medium->name}" alt="{$artstamm->name}" title="{$artstamm->name}">
87
                            {elseif $artstamm->medium[0]}
88
                                <img class="konfig_menu_img" src="/images/upload/{$artstamm->medium[0]->medium->folder}/kl/{$artstamm->medium[0]->medium->name}" alt="{$artstamm->name}" title="{$artstamm->name}">
89
                            {/if}
90
                        </div>
91
                    {/foreach}
92
                </div>
93
            </div>
94
            <div class="konfig_items">
95
 
96
                {foreach $artstaemmeItems as $key => $artstamm}
97
                    {$res[] = $artstamm->id}
98
                    {include file="subdir_artstamm_konfig.tpl" artstamm=$artstamm}
99
                {/foreach}
100
            </div>
101
        </div>
102
    {$new = implode(",",$res)}
103
        <input type="hidden" name="orderitems" value="{$new}"/>
104
    {if $konfig==1}
105
        <input type="hidden" id="basisartikel" name="basisartikel" value="{$item->id}" />
106
    {/if}
107
    <div class="break"></div>
108
    {if $item->addonitems}
109
        {assign var="addonitems" value=$item->addonitems}
110
        {include file="addonItemsKonfig.tpl"}
111
    {/if}
112
    </div>
113
</section>
114
</form>
115
{/if}
116
<script>
117
    $(document).ready(function() {
118
        $('.konfig_menu_item').on("click",function() {
119
            $('.konfig_item').css("display","none");
120
            let id = $(this).data("konfigid");
121
            $('#konfig_item_'+id).show("fade");
122
        });
123
 
124
        $('.konfig_select_item').on("click",function() {
125
            let parent = $(this).parent().parent().parent();
126
            let parentId = parent.attr("id");
127
            let selecteditem = $(this).data("selecteditem");
128
 
129
            let parentArr = parentId.split("_");
130
            let menuId = parentArr[2];
131
 
132
            $('#'+parentId+' select.select_components option').removeAttr("selected");
133
            $('#'+parentId+' select.select_components option').each(function() {
134
                if($(this).val()==selecteditem) {
135
                    $(this).attr("selected",true);
136
                }
137
            });
138
 
139
            $('#selected_'+menuId).css("z-index","1");
140
            $('#'+parentId+' .konfig_select_item').removeClass('konfig_select_active');
141
            $(this).addClass('konfig_select_active');
142
            select_konfig_item(this);
143
        });
144
    });
145
 
146
    /* Funktionen für den Konfigurator */
147
    function select_konfig_item(item) {
148
 
149
        let expl = $(item).data("selecteditem").split("#");
150
 
151
        let id = expl[0];
152
        let newPreis = 0;
153
        if(expl[1]) {
154
            newPreis = parseFloat( expl[1] );
155
        }
156
 
157
        let artstammID = expl[2];
158
 
159
        // den zuvor gewählten Preis holen (input hidden)
160
        let selectedPreis = parseFloat($('#selectedPreis_' + artstammID).val());
161
 
162
        // den aktuellen Preis holen
163
        let currentPreis = parseFloat($('#current_preis').html());
164
 
165
 
166
        // den gewählten Preis in den Zwischenspeicher laden
167
        $('#selectedPreis_'+artstammID).val(newPreis);
168
 
169
        // den neuen Preis berechnen
170
        // eventuell vorher ausgewählten preis abziehen
171
        let tempPreis = (currentPreis - selectedPreis);
172
        newPreis = (tempPreis + newPreis);
173
 
174
        $('#current_preis').html(newPreis);
175
        $('#itemPreis').html(newPreis.money_format() + " &euro;");
176
 
177
 
178
        let varname = "select_" + artstammID;
179
        let varvalue = id;
180
 
181
        $.get('/setSessionVars?'+varname+'='+varvalue);
182
    }
183
</script>
184
<style>
185
    .konfig_wrapper {
186
        display:flex;
187
    }
188
    .konfig_box {
189
        display:flex;
190
        border:1px solid #e95801;
191
    }
192
    .konfig_box .select_components {
193
        position:relative;
194
        z-index:-1;
195
    }
196
    .konfig_menu_img {
197
        width:100px;
198
        height:100px;
199
    }
200
    .konfig_menu_container {
201
        background: #e95801;
202
    }
203
    .konfig_menu {
204
        display: flex;
205
        width: 239px;
206
 
207
        color: #fff;
208
        flex-wrap: wrap;
209
        gap: 20px;
210
        padding: 20px;
211
    }
212
    .konfig_item {
213
        display:none;
214
    }
215
    .konfig_item:first-of-type {
216
        display:flex;
217
    }
218
    .konfig_item .top {
219
        display:flex;
220
        gap:40px;
221
    }
222
    .konfig_item h2 {
223
        font-size:1.8rem;
224
        padding-bottom:20px;
225
    }
226
    .konfig_items {
227
        padding:20px;
228
        max-width: calc(100% - 305px);
229
    }
230
    .konfig_menu_item {
231
        border:1px solid #fff;
232
        width:100px;
233
        height:100px;
234
        cursor:pointer;
235
        display: flex;
236
        justify-content: center;
237
        align-items: center;
238
    }
239
    .konfig_menu_item img {
240
        width:80px;
241
        height:80px;
242
    }
243
    .konfig_preis {
244
        font-family:'work_sanssemibold';
245
        color:#EA5802;
246
        font-size:1rem;
247
    }
248
    .konfig_select_item {
249
        border:3px solid #f4f4f4;
250
        cursor:pointer;
251
        text-align:center;
252
        max-width:23%;
253
        padding:0;
254
        color:#3e3e3e;
255
        background:#fff;
256
        display: flex;
257
        flex-direction: column;
258
        align-content: center;
259
        align-items: center;
260
        justify-content: center;
261
    }
262
    .konfig_select_active,
263
    .konfig_select_item:hover,
264
    .konfig_select_item:focus {
265
        border:3px solid #e95801;
266
    }
267
    .konfig_item .center {
268
        display:flex;
269
        gap:20px;
270
        flex-wrap:wrap;
271
        padding:20px 0;
272
    }
273
    .konfig_basket_button {
274
        width: 100%;
275
        text-align: right;
276
        padding-right: 1%;
277
        display: flex;
278
        align-items: end;
279
        padding-bottom: 20px;
280
        justify-content: end;
281
        margin:20px 0;
282
    }
283
 
284
    .add_konfigitem_to_basket {
285
        background:#2fbabd;
286
        color:#fff;
287
        display:flex;
288
        justify-content:center;
289
        align-items:center;
290
        border-radius:5px;
291
        padding:10px 20px;
292
        cursor:pointer;
293
        margin:20px 0;
294
    }
295
    .add_konfigitem_to_basket:hover,
296
    .add_konfigitem_to_basket:focus {
297
        background:#9cd9da;
298
    }
299
    .add_konfigitem_to_basket img {
300
        width:30px;
301
        height:30px;
302
    }
303
    #itemPreis {
304
        font-family:'work_sanssemibold';
305
        color:#EA5802;
306
        font-size:1.7rem;
307
    }
308
    .selected {
309
        position:absolute;
310
        width:100px;
311
        height:100px;
312
        background: rgba(255,255,255,.6);
313
        display:flex;
314
        justify-content:center;
315
        align-items:center;
316
        font-size:4rem;
317
        z-index:-1;
318
    }
319
    .selected .fa {
320
        color:#76bd37;
321
    }
322
 
323
    @media screen and (max-width:800px) {
324
        .konfig_wrapper {
325
            flex-direction:column;
326
        }
327
        .konfig_wrapper > div {
328
            padding:1% 2%;
329
        }
330
        .konfig_basket_button {
331
            width:96%;
332
        }
333
        form#basket {
334
            width:96%;
335
        }
336
        .konfig_box {
337
            flex-direction:column;
338
        }
339
        .konfig_menu {
340
            width:unset;
341
            gap: 5px;
342
            padding: 5px;
343
        }
344
        .konfig_menu_item {
345
            width:auto;
346
            height:auto;
347
        }
348
        .konfig_menu_item img {
349
            width:55px;
350
            height:55px;
351
            margin:2px;
352
        }
353
        .konfig_item .center {
354
            gap:5px;
355
            padding:5px;
356
        }
357
        .konfig_select_item {
358
            max-width:47%;
359
        }
360
        .selected {
361
            width:55px;
362
            height:55px;
363
            font-size:2rem;
364
        }
365
        .konfig_items {
366
            max-width:unset;
367
            padding:5px;
368
        }
369
        .konfig_item h2 {
370
            font-size:1.2rem;
371
        }
372
 
373
    }
374
</style>
375
{/block}