Browse code

Progress

Benjamin Roth authored on21/02/2023 19:42:19
Showing1 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,115 @@
1
+<form id="<?= $this->formId; ?>" name="iso<?= rand(); ?>" method="post" enctype="<?= $this->enctype; ?>">
2
+<div class="formbody" itemscope itemtype="http://schema.org/Product">
3
+<input type="hidden" name="FORM_SUBMIT" value="<?= $this->formSubmit; ?>">
4
+<input type="hidden" name="REQUEST_TOKEN" value="{{request_token}}">
5
+<input type="hidden" name="AJAX_PRODUCT" value="<?= $this->product_id; ?>">
6
+<input type="hidden" name="AJAX_MODULE" value="<?= $this->module_id; ?>">
7
+
8
+<?= $this->getGallery('images')->generateMainImage(); ?>
9
+
10
+    <?php if ($this->attr_datum && $this->type != 2): ?><div class="datum"><?= $this->generateAttribute('attr_datum') ?> </div><?php endif; ?>
11
+<h3 itemprop="name"><?php /*if ($this->href): ?><a href="<?= $this->href; ?>" title="<?= $this->label_detail; ?>"><?php endif; */?><?= $this->highlightKeywords($this->generateAttribute('name')); ?><?php /*if ($this->href): ?></a><?php endif; */?></h3>
12
+<?php /* if ($this->sku): ?>
13
+<div class="sku" itemprop="sku"><?= $this->generateAttribute('sku'); ?></div><?php endif; */ ?>
14
+
15
+<div class="product_content" role="tabpanel" aria-hidden="true">
16
+    <div class="product_content_inner">
17
+    <?php if ($this->teaser): ?>
18
+<div class="teaser"><?= $this->highlightKeywords($this->generateAttribute('teaser')); ?></div>
19
+    <?php else: ?>
20
+    <div class="details"><?= $this->generateAttribute('description') ?></div>
21
+    <?php endif; ?>
22
+
23
+<div class="shopping_container">
24
+<?php /* @var \Isotope\Interfaces\IsotopePrice $price */ if (($price = $this->product->getPrice()) && $price->getAmount() > 0): ?>
25
+<div class="offer" itemprop="offers" itemscope itemtype="http://schema.org/Offer">
26
+<meta itemprop="priceCurrency" content="<?= \Isotope\Isotope::getConfig()->currency ?>">
27
+<div class="price" itemprop="price" content="<?= \Isotope\Isotope::roundPrice($price->getAmount(1, $this->product->getOptions())) ?>"><?= $this->generatePrice(); ?></div>
28
+    <?php if ($this->not_buyable): ?>
29
+        <div class="not_buyable"><span><?= $this->not_buyable_text ?: 'nicht online buchbar' ?></span></div>
30
+    <?php else: ?>
31
+        <div class="taxinfo">inkl. MwSt. und Versandkosten</div>
32
+        <div class="shipping">Versandfertig in 1 - 3 Werktagen</div>
33
+    <?php endif; ?>
34
+    <?php if($this->baseprice): ?><div class="baseprice"><?= $this->generateAttribute('baseprice'); ?></div><?php endif; ?>
35
+</div>
36
+<?php endif; ?>
37
+
38
+<?php /* if ($this->href): ?>
39
+<div class="details"><a href="<?= $this->href; ?>" title="<?= $this->label_detail; ?>"><?= $this->label_detail; ?></a></div>
40
+<?php endif; */ ?>
41
+
42
+<?php if($this->actions && $price->getAmount() > 0): ?>
43
+<?php /*
44
+<div class="submit_container">
45
+<?php if($this->hasOptions): ?>
46
+<div class="options">
47
+<?php foreach( $this->options as $arrOption ): echo $arrOption['html']; endforeach; ?>
48
+</div>
49
+<?php endif; */?>
50
+<?php if ($this->useQuantity): ?>
51
+    <div class="actions">
52
+<div class="quantity_container">
53
+<?php /*<label for="quantity_requested_<?= $this->raw['id']; ?>"><?= $GLOBALS['TL_LANG']['MSC']['quantity']; ?>:</label> */ ?><input type="text" class="text" id="quantity_requested_<?= $this->raw['id']; ?>" name="quantity_requested" placeholder="<?= $this->minimum_quantity; ?>" maxlength="10">
54
+</div>
55
+<?php endif; ?>
56
+<?php foreach ($this->actions as $action): ?>
57
+    <?php /*<?= $action->generate($this->product); ?>*/ ?>
58
+<?php if($action->getName() == 'add_to_cart'): ?>
59
+    <button type="submit" name="add_to_cart" class="submit add_to_cart" data-tooltip-title="in den Warenkorb">
60
+        {{svg_inline::7e53d915-a92a-11ed-9cd9-16264e5ce4f6:cart-image}}
61
+        {{svg_inline::ee3e6fcd-ae1d-11ed-9cd9-16264e5ce4f6:plus}}
62
+    </button>
63
+<?php endif; ?>
64
+<?php endforeach; ?>
65
+
66
+    </div>
67
+<?php endif; ?>
68
+
69
+</div>
70
+<?php if ($this->attr_registration): ?>
71
+    <div class="registration_info"><?= $this->generateAttribute('attr_registration') ?></div>
72
+<?php endif; ?>
73
+</div>
74
+<div class="expand-toggle" role="tab" aria-expanded="false"></div>
75
+</div>
76
+
77
+</div>
78
+</form>
79
+<?php $GLOBALS['TL_BODY']['iso_list_expander'] = <<<'EOT'
80
+<script type="text/javascript">
81
+  document.addEventListener('DOMContentLoaded', function () {
82
+    const containers = document.querySelectorAll('.product_content');
83
+
84
+    for (let i = 0; i < containers.length; i++)
85
+    {
86
+      let toggle = containers[i].querySelector('.expand-toggle');
87
+
88
+      toggle.addEventListener('click', function(e) {
89
+        let self = containers[i],
90
+          height = self.scrollHeight;
91
+
92
+        self.style.height = height+'px';
93
+
94
+        if (self.classList.contains('expanded'))
95
+        {
96
+          setTimeout(function()
97
+          {
98
+            self.style.height = '';
99
+            self.classList.remove('expanded');
100
+          },1);
101
+          setTimeout(function() {
102
+            toggle.ariaExpanded = 'false'
103
+          },750)
104
+        } else {
105
+          self.classList.add('expanded');
106
+          setTimeout(function() {
107
+            self.style.height = 'auto';
108
+            toggle.ariaExpanded = 'true'
109
+          },750)
110
+        }
111
+      });
112
+    }
113
+  });
114
+</script>
115
+EOT;