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) { ?>
|
|
|
17 |
|
7811 |
daniel |
18 |
<?php foreach ($this->callMod('wpsg_mod_abo', 'getAboProductsFromOrder', Array($oOrder->id)) as $oOrderProduct) {
|
|
|
19 |
|
|
|
20 |
$product_id = $oOrderProduct->getProductId();
|
|
|
21 |
$aboStatus = $this->callMod('wpsg_mod_abo', 'getAboProductStatus', Array($oOrder->id, $oOrderProduct->getProductKey()));
|
|
|
22 |
|
|
|
23 |
try {
|
|
|
24 |
|
|
|
25 |
$oAbo = wpsg_abo::getFromOrderAndProduct($oOrder->getId(), $oOrderProduct->getId());
|
|
|
26 |
|
|
|
27 |
} catch (\Exception $e) {
|
|
|
28 |
|
|
|
29 |
continue;
|
|
|
30 |
|
|
|
31 |
}
|
|
|
32 |
|
|
|
33 |
?>
|
6833 |
thomas |
34 |
|
6834 |
daniel |
35 |
<div class="wpsg_mod_abo_order_product">
|
6833 |
thomas |
36 |
|
6834 |
daniel |
37 |
<h1 class="entry-title title">
|
|
|
38 |
<?php echo wpsg_translate(__('Abo "#1#" aus Bestellung #2#', 'wpsg'), $oOrderProduct->getProduct()->getProductName(), $oOrder->getNr()); ?>
|
|
|
39 |
</h1>
|
|
|
40 |
|
|
|
41 |
<?php $nAttachmentID = $this->imagehandler->getAttachmentID($oOrderProduct->getProductKey()); ?>
|
|
|
42 |
|
|
|
43 |
<?php if (wpsg_isSizedInt($nAttachmentID)) { ?>
|
|
|
44 |
<div class="image">
|
|
|
45 |
<?php echo wp_get_attachment_image($nAttachmentID, array(100, 100), false, array()); ?>
|
|
|
46 |
</div>
|
|
|
47 |
<?php } ?>
|
6833 |
thomas |
48 |
|
6834 |
daniel |
49 |
<div class="content">
|
|
|
50 |
|
|
|
51 |
<div class="start">
|
6838 |
thomas |
52 |
<span class="label"><?php echo __('Erstkauf (Startzeitpunkt):', 'wpsg'); ?></span>
|
6834 |
daniel |
53 |
<span class="value">
|
|
|
54 |
|
|
|
55 |
<?php echo wpsg_formatTimestamp(strtotime($oOrder->cdate)); ?>
|
|
|
56 |
|
|
|
57 |
</span>
|
|
|
58 |
</div>
|
|
|
59 |
<div class="price">
|
|
|
60 |
<span class="label"><?php echo wpsg_translate(__('Preis (#1# Tage):', 'wpsg'), $oOrderProduct->getProduct()->wpsg_mod_abo_durration); ?></span>
|
|
|
61 |
<span class="value"><?php echo wpsg_ff($oOrderProduct->getProduct()->wpsg_mod_abo_price, $this->get_option('wpsg_currency')); ?></span>
|
|
|
62 |
</div>
|
|
|
63 |
<div class="duration">
|
6838 |
thomas |
64 |
<span class="label"><?php echo __('Laufzeit (Endzeitpunkt):', 'wpsg'); ?></span>
|
6834 |
daniel |
65 |
<span class="value">
|
|
|
66 |
|
7812 |
daniel |
67 |
<?php $exp = $this->callMod('wpsg_mod_abo', 'getOrderAboExpiration', array($oOrder->id, $oOrderProduct->getId())); ?>
|
6834 |
daniel |
68 |
|
7811 |
daniel |
69 |
<?php if ($oAbo->getState() === wpsg_abo::STATE_RUNNING) { ?>
|
6834 |
daniel |
70 |
<span class="duration_running"><?php echo $exp; ?></span>
|
7811 |
daniel |
71 |
<?php } else if ($oAbo->getState() === wpsg_abo::STATE_INEXTENSION) { ?>
|
|
|
72 |
<span class="duration_inextension"><?php echo $exp; ?></span>
|
|
|
73 |
<?php } else if ($oAbo->getState() === wpsg_abo::STATE_EXTEND) { ?>
|
6834 |
daniel |
74 |
<span class="duration_expired"><?php echo $exp; ?></span>
|
|
|
75 |
<?php } ?>
|
|
|
76 |
|
|
|
77 |
</span>
|
|
|
78 |
</div>
|
|
|
79 |
<div class="status">
|
7811 |
daniel |
80 |
<span class="label"><?php echo __('automatische Verlängerung:', 'wpsg'); ?></span>
|
6834 |
daniel |
81 |
<span class="value">
|
|
|
82 |
|
|
|
83 |
<?php if ($aboStatus['status'] === wpsg_mod_abo::STATUS_ACTIVE) { ?>
|
|
|
84 |
|
|
|
85 |
<span class="status_activ"><?php echo __('Aktiv'); ?></span>
|
|
|
86 |
|
6836 |
thomas |
87 |
<?php if (strtotime($aboStatus['mail_admin_stop']) > 0) { ?>
|
6834 |
daniel |
88 |
|
|
|
89 |
<?php echo __('Kündigung ausstehend', 'wpsg'); ?>
|
|
|
90 |
|
|
|
91 |
<?php } else { ?>
|
|
|
92 |
|
7811 |
daniel |
93 |
<?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 |
94 |
<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>
|
|
|
95 |
<?php } ?>
|
|
|
96 |
|
|
|
97 |
<?php } ?>
|
|
|
98 |
|
|
|
99 |
<?php } else if ($aboStatus['status'] === wpsg_mod_abo::STATUS_STOPPED) { ?>
|
|
|
100 |
<span class="status_inactiv"><?php echo __('Inaktiv') ?></span>
|
|
|
101 |
<?php } ?>
|
|
|
102 |
|
|
|
103 |
</span>
|
|
|
104 |
</div>
|
|
|
105 |
</div>
|
|
|
106 |
|
|
|
107 |
<div class="wpsg_clear"></div>
|
|
|
108 |
|
|
|
109 |
</div>
|
6833 |
thomas |
110 |
|
6834 |
daniel |
111 |
<?php } // foreach OrderProducts ?>
|
|
|
112 |
|
|
|
113 |
<?php } // foreach Order ?>
|
|
|
114 |
</div>
|
6833 |
thomas |
115 |
|
|
|
116 |
<?php } else { ?>
|
6834 |
daniel |
117 |
|
|
|
118 |
<p><?php echo __('Bisher kein(e) Abonnement(s) vorhanden.', 'wpsg'); ?></p>
|
|
|
119 |
|
6833 |
thomas |
120 |
<?php } ?>
|
|
|
121 |
</div>
|