6833 |
thomas |
1 |
<?php
|
|
|
2 |
|
|
|
3 |
/**
|
|
|
4 |
* Template für die Übersichtsseite der Abonnements im Frontend
|
|
|
5 |
*/
|
6834 |
daniel |
6 |
|
6833 |
thomas |
7 |
?>
|
|
|
8 |
|
|
|
9 |
<div class="wpsg_mod_kundenverwaltung_abo wpsg">
|
|
|
10 |
|
|
|
11 |
<?php echo $this->writeFrontendMessage(); ?>
|
|
|
12 |
|
|
|
13 |
<?php if (wpsg_isSizedArray($this->view['arOrder'])) { ?>
|
|
|
14 |
|
6834 |
daniel |
15 |
<div class="wpsg_mod_abo_order_product_wrap">
|
|
|
16 |
<?php foreach ($this->view['arOrder'] as $oOrder) { ?>
|
7836 |
daniel |
17 |
|
|
|
18 |
<?php if ($this->callMod('wpsg_mod_abo', 'isAboOrder', [$oOrder->id]) === 1) {
|
|
|
19 |
|
|
|
20 |
$arAbo = $this->callMod('wpsg_mod_abo', 'getAboProductsFromOrder', [$oOrder->id]);
|
|
|
21 |
|
|
|
22 |
foreach ($arAbo as $oOrderProduct) {
|
|
|
23 |
|
|
|
24 |
$aboStatus = $this->callMod('wpsg_mod_abo', 'getAboProductStatus', [$oOrder->id, $oOrderProduct->id]); $oAbo = wpsg_abo::getInstance(intval($aboStatus['id']));
|
|
|
25 |
$state = $oAbo->getState();
|
|
|
26 |
|
|
|
27 |
?>
|
|
|
28 |
|
|
|
29 |
<div class="wpsg_mod_abo_order_product">
|
|
|
30 |
|
|
|
31 |
<h1 class="entry-title title">
|
|
|
32 |
<?php echo wpsg_translate(__('Abo "#1#" aus Bestellung #2#', 'wpsg'), $oOrderProduct->getProduct()->getProductName(), $oOrder->getNr()); ?>
|
|
|
33 |
</h1>
|
|
|
34 |
|
|
|
35 |
<?php $nAttachmentID = $this->imagehandler->getAttachmentID($oOrderProduct->getProductKey()); ?>
|
|
|
36 |
|
|
|
37 |
<?php if (wpsg_isSizedInt($nAttachmentID)) { ?>
|
|
|
38 |
<div class="image">
|
|
|
39 |
<?php echo wp_get_attachment_image($nAttachmentID, array(100, 100), false, array()); ?>
|
|
|
40 |
</div>
|
|
|
41 |
<?php } ?>
|
|
|
42 |
|
|
|
43 |
<div class="content">
|
|
|
44 |
|
|
|
45 |
<div class="start">
|
|
|
46 |
<span class="label"><?php echo __('Erstkauf (Startzeitpunkt):', 'wpsg'); ?></span>
|
|
|
47 |
<span class="value">
|
|
|
48 |
|
|
|
49 |
<?php echo wpsg_formatTimestamp(strtotime($oOrder->cdate)); ?>
|
|
|
50 |
|
|
|
51 |
</span>
|
|
|
52 |
</div>
|
|
|
53 |
<div class="price">
|
|
|
54 |
<span class="label"><?php echo wpsg_translate(__('Preis (#1# Tage):', 'wpsg'), $oOrderProduct->getProduct()->wpsg_mod_abo_durration); ?></span>
|
|
|
55 |
<span class="value"><?php echo wpsg_ff($oOrderProduct->getProduct()->wpsg_mod_abo_price, $this->get_option('wpsg_currency')); ?></span>
|
|
|
56 |
</div>
|
|
|
57 |
<div class="duration">
|
|
|
58 |
<span class="label"><?php echo __('Laufzeit (Endzeitpunkt):', 'wpsg'); ?></span>
|
|
|
59 |
<span class="value">
|
|
|
60 |
|
|
|
61 |
<?php $exp = $this->callMod('wpsg_mod_abo', 'getOrderAboExpiration', array($oOrder->id, $oOrderProduct->getId())); ?>
|
|
|
62 |
|
|
|
63 |
<?php if ($oAbo->getState() === wpsg_abo::STATE_RUNNING) { ?>
|
|
|
64 |
<span class="duration_running"><?php echo $exp; ?></span>
|
|
|
65 |
<?php } else if ($oAbo->getState() === wpsg_abo::STATE_INEXTENSION) { ?>
|
|
|
66 |
<span class="duration_inextension"><?php echo $exp; ?></span>
|
|
|
67 |
<?php } else if ($oAbo->getState() === wpsg_abo::STATE_EXTEND) { ?>
|
|
|
68 |
<span class="duration_expired"><?php echo $exp; ?></span>
|
|
|
69 |
<?php } ?>
|
|
|
70 |
|
|
|
71 |
</span>
|
|
|
72 |
</div>
|
|
|
73 |
<div class="status">
|
|
|
74 |
<span class="label"><?php echo __('automatische Verlängerung:', 'wpsg'); ?></span>
|
|
|
75 |
<span class="value">
|
|
|
76 |
|
|
|
77 |
<?php if ($aboStatus['status'] === wpsg_mod_abo::STATUS_ACTIVE) { ?>
|
|
|
78 |
|
|
|
79 |
<span class="status_activ"><?php echo __('Aktiv'); ?></span>
|
|
|
80 |
|
|
|
81 |
<?php if (strtotime($aboStatus['mail_admin_stop']) > 0) { ?>
|
|
|
82 |
|
|
|
83 |
<?php echo __('Kündigung ausstehend', 'wpsg'); ?>
|
|
|
84 |
|
|
|
85 |
<?php } else { ?>
|
|
|
86 |
|
|
|
87 |
<?php if (in_array($this->callMod('wpsg_mod_abo', 'getSetting', ['wpsg_mod_abo_autoexpire_customer', $oOrderProduct->getProductId()]), Array(wpsg_mod_abo::CUSTOMER_AUTO_MAIL, wpsg_mod_abo::CUSTOMER_AUTO_DIRECT))) { ?>
|
|
|
88 |
<span class="link_wrap"><a href="<?php echo $this->getUrl(wpsg_ShopController::URL_ABO, 'wpsg_mod_abo', 'stoprenewal', Array('order_id' => $oOrder->id, 'product_key' => $oOrderProduct->getProductKey())); ?>"><?php echo __('Deaktivieren'); ?></a></span>
|
|
|
89 |
<?php } ?>
|
|
|
90 |
|
|
|
91 |
<?php } ?>
|
|
|
92 |
|
|
|
93 |
<?php } else if ($aboStatus['status'] === wpsg_mod_abo::STATUS_STOPPED) { ?>
|
|
|
94 |
<span class="status_inactiv"><?php echo __('Inaktiv') ?></span>
|
|
|
95 |
<?php } ?>
|
|
|
96 |
|
|
|
97 |
</span>
|
|
|
98 |
</div>
|
|
|
99 |
</div>
|
|
|
100 |
|
|
|
101 |
<div class="wpsg_clear"></div>
|
|
|
102 |
|
|
|
103 |
</div>
|
|
|
104 |
|
|
|
105 |
<?php
|
|
|
106 |
|
|
|
107 |
}
|
|
|
108 |
|
|
|
109 |
?>
|
|
|
110 |
|
|
|
111 |
OK
|
|
|
112 |
|
|
|
113 |
<?php } ?>
|
6834 |
daniel |
114 |
|
7836 |
daniel |
115 |
<?php /* foreach ($this->callMod('wpsg_mod_abo', 'getAboProductsFromOrder', Array($oOrder->id)) as $oOrderProduct) {
|
7811 |
daniel |
116 |
|
|
|
117 |
$product_id = $oOrderProduct->getProductId();
|
|
|
118 |
$aboStatus = $this->callMod('wpsg_mod_abo', 'getAboProductStatus', Array($oOrder->id, $oOrderProduct->getProductKey()));
|
|
|
119 |
|
|
|
120 |
try {
|
|
|
121 |
|
|
|
122 |
$oAbo = wpsg_abo::getFromOrderAndProduct($oOrder->getId(), $oOrderProduct->getId());
|
|
|
123 |
|
|
|
124 |
} catch (\Exception $e) {
|
|
|
125 |
|
|
|
126 |
continue;
|
|
|
127 |
|
|
|
128 |
}
|
|
|
129 |
|
|
|
130 |
?>
|
6833 |
thomas |
131 |
|
6834 |
daniel |
132 |
<div class="wpsg_mod_abo_order_product">
|
6833 |
thomas |
133 |
|
6834 |
daniel |
134 |
<h1 class="entry-title title">
|
|
|
135 |
<?php echo wpsg_translate(__('Abo "#1#" aus Bestellung #2#', 'wpsg'), $oOrderProduct->getProduct()->getProductName(), $oOrder->getNr()); ?>
|
|
|
136 |
</h1>
|
|
|
137 |
|
|
|
138 |
<?php $nAttachmentID = $this->imagehandler->getAttachmentID($oOrderProduct->getProductKey()); ?>
|
|
|
139 |
|
|
|
140 |
<?php if (wpsg_isSizedInt($nAttachmentID)) { ?>
|
|
|
141 |
<div class="image">
|
|
|
142 |
<?php echo wp_get_attachment_image($nAttachmentID, array(100, 100), false, array()); ?>
|
|
|
143 |
</div>
|
|
|
144 |
<?php } ?>
|
6833 |
thomas |
145 |
|
6834 |
daniel |
146 |
<div class="content">
|
|
|
147 |
|
|
|
148 |
<div class="start">
|
6838 |
thomas |
149 |
<span class="label"><?php echo __('Erstkauf (Startzeitpunkt):', 'wpsg'); ?></span>
|
6834 |
daniel |
150 |
<span class="value">
|
|
|
151 |
|
|
|
152 |
<?php echo wpsg_formatTimestamp(strtotime($oOrder->cdate)); ?>
|
|
|
153 |
|
|
|
154 |
</span>
|
|
|
155 |
</div>
|
|
|
156 |
<div class="price">
|
|
|
157 |
<span class="label"><?php echo wpsg_translate(__('Preis (#1# Tage):', 'wpsg'), $oOrderProduct->getProduct()->wpsg_mod_abo_durration); ?></span>
|
|
|
158 |
<span class="value"><?php echo wpsg_ff($oOrderProduct->getProduct()->wpsg_mod_abo_price, $this->get_option('wpsg_currency')); ?></span>
|
|
|
159 |
</div>
|
|
|
160 |
<div class="duration">
|
6838 |
thomas |
161 |
<span class="label"><?php echo __('Laufzeit (Endzeitpunkt):', 'wpsg'); ?></span>
|
6834 |
daniel |
162 |
<span class="value">
|
|
|
163 |
|
7812 |
daniel |
164 |
<?php $exp = $this->callMod('wpsg_mod_abo', 'getOrderAboExpiration', array($oOrder->id, $oOrderProduct->getId())); ?>
|
6834 |
daniel |
165 |
|
7811 |
daniel |
166 |
<?php if ($oAbo->getState() === wpsg_abo::STATE_RUNNING) { ?>
|
6834 |
daniel |
167 |
<span class="duration_running"><?php echo $exp; ?></span>
|
7811 |
daniel |
168 |
<?php } else if ($oAbo->getState() === wpsg_abo::STATE_INEXTENSION) { ?>
|
|
|
169 |
<span class="duration_inextension"><?php echo $exp; ?></span>
|
|
|
170 |
<?php } else if ($oAbo->getState() === wpsg_abo::STATE_EXTEND) { ?>
|
6834 |
daniel |
171 |
<span class="duration_expired"><?php echo $exp; ?></span>
|
|
|
172 |
<?php } ?>
|
|
|
173 |
|
|
|
174 |
</span>
|
|
|
175 |
</div>
|
|
|
176 |
<div class="status">
|
7811 |
daniel |
177 |
<span class="label"><?php echo __('automatische Verlängerung:', 'wpsg'); ?></span>
|
6834 |
daniel |
178 |
<span class="value">
|
|
|
179 |
|
|
|
180 |
<?php if ($aboStatus['status'] === wpsg_mod_abo::STATUS_ACTIVE) { ?>
|
|
|
181 |
|
|
|
182 |
<span class="status_activ"><?php echo __('Aktiv'); ?></span>
|
|
|
183 |
|
6836 |
thomas |
184 |
<?php if (strtotime($aboStatus['mail_admin_stop']) > 0) { ?>
|
6834 |
daniel |
185 |
|
|
|
186 |
<?php echo __('Kündigung ausstehend', 'wpsg'); ?>
|
|
|
187 |
|
|
|
188 |
<?php } else { ?>
|
|
|
189 |
|
7811 |
daniel |
190 |
<?php if (in_array($this->callMod('wpsg_mod_abo', 'getSetting', ['wpsg_mod_abo_autoexpire_customer', $product_id]), Array(wpsg_mod_abo::CUSTOMER_AUTO_MAIL, wpsg_mod_abo::CUSTOMER_AUTO_DIRECT))) { ?>
|
6834 |
daniel |
191 |
<span class="link_wrap"><a href="<?php echo $this->getUrl(wpsg_ShopController::URL_ABO, 'wpsg_mod_abo', 'stoprenewal', Array('order_id' => $oOrder->id, 'product_key' => $oOrderProduct->getProductKey())); ?>"><?php echo __('Deaktivieren'); ?></a></span>
|
|
|
192 |
<?php } ?>
|
|
|
193 |
|
|
|
194 |
<?php } ?>
|
|
|
195 |
|
|
|
196 |
<?php } else if ($aboStatus['status'] === wpsg_mod_abo::STATUS_STOPPED) { ?>
|
|
|
197 |
<span class="status_inactiv"><?php echo __('Inaktiv') ?></span>
|
|
|
198 |
<?php } ?>
|
|
|
199 |
|
|
|
200 |
</span>
|
|
|
201 |
</div>
|
|
|
202 |
</div>
|
|
|
203 |
|
|
|
204 |
<div class="wpsg_clear"></div>
|
|
|
205 |
|
|
|
206 |
</div>
|
6833 |
thomas |
207 |
|
7836 |
daniel |
208 |
<?php } */ ?>
|
6834 |
daniel |
209 |
|
|
|
210 |
<?php } // foreach Order ?>
|
|
|
211 |
</div>
|
6833 |
thomas |
212 |
|
|
|
213 |
<?php } else { ?>
|
6834 |
daniel |
214 |
|
|
|
215 |
<p><?php echo __('Bisher kein(e) Abonnement(s) vorhanden.', 'wpsg'); ?></p>
|
|
|
216 |
|
6833 |
thomas |
217 |
<?php } ?>
|
|
|
218 |
</div>
|