summaryrefslogtreecommitdiff
path: root/views/mods/mod_abo/page_abo.phtml
diff options
context:
space:
mode:
authorDaniel Schmitzer <noreply@maennchen1.de>2020-11-18 08:32:09 +0000
committerDaniel Schmitzer <noreply@maennchen1.de>2020-11-18 08:32:09 +0000
commit5a45aad049c6ba0327a22fd1b2a780405de385a1 (patch)
tree7bc6536fa1d783769660334f97b22213ea5a9816 /views/mods/mod_abo/page_abo.phtml
parent754a5c89e217a89f3ffa652f35e680f1bfb63375 (diff)
- Abo Einstellungen ins Produkt
git-svn-id: https://[internal]/wordpress/plugins/wpsg4@7811 0d5edaf7-2b12-4e95-93f4-047927463d4b
Diffstat (limited to 'views/mods/mod_abo/page_abo.phtml')
-rw-r--r--views/mods/mod_abo/page_abo.phtml27
1 files changed, 22 insertions, 5 deletions
diff --git a/views/mods/mod_abo/page_abo.phtml b/views/mods/mod_abo/page_abo.phtml
index 7b33792..a562ef9 100644
--- a/views/mods/mod_abo/page_abo.phtml
+++ b/views/mods/mod_abo/page_abo.phtml
@@ -15,7 +15,22 @@
<div class="wpsg_mod_abo_order_product_wrap">
<?php foreach ($this->view['arOrder'] as $oOrder) { ?>
- <?php foreach ($this->callMod('wpsg_mod_abo', 'getAboProductsFromOrder', Array($oOrder->id)) as $oOrderProduct) { $aboStatus = $this->callMod('wpsg_mod_abo', 'getAboProductStatus', Array($oOrder->id, $oOrderProduct->getProductKey())); ?>
+ <?php foreach ($this->callMod('wpsg_mod_abo', 'getAboProductsFromOrder', Array($oOrder->id)) as $oOrderProduct) {
+
+ $product_id = $oOrderProduct->getProductId();
+ $aboStatus = $this->callMod('wpsg_mod_abo', 'getAboProductStatus', Array($oOrder->id, $oOrderProduct->getProductKey()));
+
+ try {
+
+ $oAbo = wpsg_abo::getFromOrderAndProduct($oOrder->getId(), $oOrderProduct->getId());
+
+ } catch (\Exception $e) {
+
+ continue;
+
+ }
+
+ ?>
<div class="wpsg_mod_abo_order_product">
@@ -51,16 +66,18 @@
<?php $exp = $this->callMod('wpsg_mod_abo', 'getOrderAboExpiration', array($oOrder->id, $oOrderProduct->getProductKey())); ?>
- <?php if (strtotime($exp) > time()) { ?>
+ <?php if ($oAbo->getState() === wpsg_abo::STATE_RUNNING) { ?>
<span class="duration_running"><?php echo $exp; ?></span>
- <?php } else { ?>
+ <?php } else if ($oAbo->getState() === wpsg_abo::STATE_INEXTENSION) { ?>
+ <span class="duration_inextension"><?php echo $exp; ?></span>
+ <?php } else if ($oAbo->getState() === wpsg_abo::STATE_EXTEND) { ?>
<span class="duration_expired"><?php echo $exp; ?></span>
<?php } ?>
</span>
</div>
<div class="status">
- <span class="label"><?php echo __('Verlängerung:', 'wpsg'); ?></span>
+ <span class="label"><?php echo __('automatische Verlängerung:', 'wpsg'); ?></span>
<span class="value">
<?php if ($aboStatus['status'] === wpsg_mod_abo::STATUS_ACTIVE) { ?>
@@ -73,7 +90,7 @@
<?php } else { ?>
- <?php if (in_array($this->get_option('wpsg_mod_abo_autoexpire_customer'), Array(wpsg_mod_abo::CUSTOMER_AUTO_MAIL, wpsg_mod_abo::CUSTOMER_AUTO_DIRECT))) { ?>
+ <?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))) { ?>
<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>
<?php } ?>