summaryrefslogtreecommitdiff
path: root/views
diff options
context:
space:
mode:
Diffstat (limited to 'views')
-rw-r--r--views/css/frontend.css20
-rw-r--r--views/css/wpsg-theme.css17
-rw-r--r--views/mods/mod_kundenverwaltung/order.phtml99
3 files changed, 69 insertions, 67 deletions
diff --git a/views/css/frontend.css b/views/css/frontend.css
index 1081458..6232f45 100644
--- a/views/css/frontend.css
+++ b/views/css/frontend.css
@@ -341,13 +341,19 @@ html body .wpsg_product_garan_wrap a.wpsg_product_garan img { display:block; max
.wpsg_mod_produktattribute_value { display:inline-block; }
/* Bestellansicht */
-.wpsg_mod_kundenverwaltung_order .wpsg_mod_kundenverwaltung_producttable { margin-top:1rem; margin-bottom:2rem; }
-.wpsg_mod_kundenverwaltung_order {
- table { width:100%;
- td, th { text-align:left; }
- }
- .wpsg_box { border-bottom:1px solid black; padding-bottom:1rem; margin-bottom:1rem; }
-}
+/* Kundenkonto „Bestellungen“: je Bestellung eine Karte, Positionen aufklappbar (K135) */
+.wpsg_mod_kundenverwaltung_order .wpsg-account-order { border:1px solid var(--wpsg-color-line, rgba(127,127,127,.35)); border-radius:var(--wpsg-radius, 4px); padding:1em 1.25em; margin:0 0 1em; }
+.wpsg_mod_kundenverwaltung_order .wpsg-account-order__head { display:flex; flex-wrap:wrap; justify-content:space-between; align-items:baseline; gap:.25em 1em; }
+.wpsg_mod_kundenverwaltung_order .wpsg-account-order__title { margin:0; font-size:1em; font-weight:700; line-height:1.4; }
+.wpsg_mod_kundenverwaltung_order :where(.wpsg-account-order__sum, .col_price) { white-space:nowrap; }
+.wpsg_mod_kundenverwaltung_order .wpsg-account-order__sum { font-weight:700; }
+.wpsg_mod_kundenverwaltung_order .wpsg-account-order__meta { margin:.25em 0 0; font-size:var(--wpsg-font-size-small, .875em); }
+.wpsg_mod_kundenverwaltung_order .wpsg-account-order__items { margin-top:.75em; }
+.wpsg_mod_kundenverwaltung_order .wpsg-account-order__items > summary { cursor:pointer; font-size:var(--wpsg-font-size-small, .875em); }
+.wpsg_mod_kundenverwaltung_order .wpsg-account-order__items table { width:100%; margin:.5em 0 0; border-collapse:collapse; }
+.wpsg_mod_kundenverwaltung_order .wpsg-account-order__items td { padding:.5em 0; border-top:1px solid var(--wpsg-color-line-soft, rgba(127,127,127,.2)); vertical-align:top; text-align:left; }
+.wpsg_mod_kundenverwaltung_order .wpsg-account-order__items td.col_price { padding-left:1em; text-align:right; }
+.wpsg_mod_kundenverwaltung_order .wpsg-account-order__detail { display:block; font-size:var(--wpsg-font-size-small, .875em); opacity:var(--wpsg-muted-opacity, .85); }
/* Trusted Shops Integration */
.wpsg_checkout label[for="wpsg_mod_trustedshops_set"] { margin:1rem 0 1rem 0; display:block; }
diff --git a/views/css/wpsg-theme.css b/views/css/wpsg-theme.css
index 906dd44..74d48a7 100644
--- a/views/css/wpsg-theme.css
+++ b/views/css/wpsg-theme.css
@@ -286,10 +286,19 @@
[id="wpsg_pwd_info"] :where(ul li) { margin:10px 20px; display:block; }
.invalid { padding-left:22px; line-height:24px; color:var(--wpsg-color-error); }
.valid { padding-left:22px; line-height:24px; color:var(--wpsg-color-success); }
-.wpsg_mod_kundenverwaltung_order :where(.wpsg_mod_kundenverwaltung_producttable) { margin-top:var(--wpsg-gap); margin-bottom:2rem; }
-.wpsg_mod_kundenverwaltung_order :where(table) { width:100%; }
-.wpsg_mod_kundenverwaltung_order :where(table) :where(td, th) { text-align:left; }
-.wpsg_mod_kundenverwaltung_order :where(.wpsg_box) { border-bottom:1px solid var(--wpsg-color-line); padding-bottom:var(--wpsg-gap); margin-bottom:var(--wpsg-gap); }
+/* Kundenkonto „Bestellungen“: je Bestellung eine Karte, Positionen aufklappbar (K135) */
+.wpsg_mod_kundenverwaltung_order :where(.wpsg-account-order) { border:1px solid var(--wpsg-color-line, rgba(127,127,127,.35)); border-radius:var(--wpsg-radius, 4px); padding:1em 1.25em; margin:0 0 1em; }
+.wpsg_mod_kundenverwaltung_order :where(.wpsg-account-order__head) { display:flex; flex-wrap:wrap; justify-content:space-between; align-items:baseline; gap:.25em 1em; }
+.wpsg_mod_kundenverwaltung_order :where(.wpsg-account-order__title) { margin:0; font-size:1em; font-weight:700; line-height:1.4; }
+.wpsg_mod_kundenverwaltung_order :where(.wpsg-account-order__sum, .col_price) { white-space:nowrap; }
+.wpsg_mod_kundenverwaltung_order :where(.wpsg-account-order__sum) { font-weight:700; }
+.wpsg_mod_kundenverwaltung_order :where(.wpsg-account-order__meta) { margin:.25em 0 0; font-size:var(--wpsg-font-size-small, .875em); }
+.wpsg_mod_kundenverwaltung_order :where(.wpsg-account-order__items) { margin-top:.75em; }
+.wpsg_mod_kundenverwaltung_order :where(.wpsg-account-order__items > summary) { cursor:pointer; font-size:var(--wpsg-font-size-small, .875em); }
+.wpsg_mod_kundenverwaltung_order :where(.wpsg-account-order__items table) { width:100%; margin:.5em 0 0; border-collapse:collapse; }
+.wpsg_mod_kundenverwaltung_order :where(.wpsg-account-order__items td) { padding:.5em 0; border-top:1px solid var(--wpsg-color-line-soft, rgba(127,127,127,.2)); vertical-align:top; text-align:left; }
+.wpsg_mod_kundenverwaltung_order :where(.wpsg-account-order__items td.col_price) { padding-left:1em; text-align:right; }
+.wpsg_mod_kundenverwaltung_order :where(.wpsg-account-order__detail) { display:block; font-size:var(--wpsg-font-size-small, .875em); opacity:var(--wpsg-muted-opacity, .85); }
:where(.wpsg_mod_kundenverwaltung_widget) :where(input[type="text"], input[type="password"]) { width:100%; margin-bottom:0.5rem; }
:where(.wpsg_mod_kundenverwaltung_widget input[type="submit"]) { float:right; }
diff --git a/views/mods/mod_kundenverwaltung/order.phtml b/views/mods/mod_kundenverwaltung/order.phtml
index fdff2b3..3af1beb 100644
--- a/views/mods/mod_kundenverwaltung/order.phtml
+++ b/views/mods/mod_kundenverwaltung/order.phtml
@@ -14,78 +14,64 @@
<?php echo $this->writeFrontendMessage(); ?>
<?php if (wpsg_isSizedArray($this->view['arOrder'])) { ?>
- <?php foreach ($this->view['arOrder'] as $order) { ?>
-
- <div class="wpsg_box">
+ <?php foreach ($this->view['arOrder'] as $order) { $strSum = wpsg_ff($order['price_gesamt'], $this->get_option('wpsg_currency')); ?>
- <h2><?php echo wpsg_translate(__('Bestellung vom #1# über #2#', 'wpsg'), date('d.m.Y', strtotime($order['cdate'])), wpsg_ff($order['price_gesamt'], $this->get_option('wpsg_currency'))); ?></h2>
-
- <div class="wpsg_inner wpsg_order_<?php echo $order['id']; ?>">
- <strong><?php echo __('Bestellstatus', 'wpsg'); ?>:</strong>&nbsp;
- <?php echo $this->arStatus[$order['status']]; ?>
- <?php if ($this->hasMod('wpsg_mod_rechnungen')) {
+ <section class="wpsg_box wpsg-account-order wpsg_order_<?php echo intval($order['id']); ?>">
- $arInvoice = \wpsg\wpsg_invoice::findByOrderId(intval($order['id']));
-
- ?>
-
- <?php foreach ($arInvoice as $oInvoice) { ?>
-
- <?php if ($oInvoice->isInvoice()) { ?>
-
- <a href="<?php echo $this->callMod('wpsg_mod_rechnungen', 'getFrontendLink', [$oInvoice->getId()]); ?>"><?php echo wpsg_translate(__('Rechnung #1#', 'wpsg'), $oInvoice->getNr()); ?></a>
-
- <?php } else if ($oInvoice->isStorno()) { ?>
-
- <a href="<?php echo $this->callMod('wpsg_mod_rechnungen', 'getFrontendLink', [$oInvoice->getId()]); ?>"><?php echo wpsg_translate(__('Rechnungskorrektur #1#', 'wpsg'), $oInvoice->getNr()); ?></a>
+ <div class="wpsg-account-order__head">
+ <h2 class="wpsg-account-order__title"><?php echo esc_html(date('d.m.Y', strtotime($order['cdate']))); ?> · <?php echo __('Bestellnummer', 'wpsg'); ?> <?php echo esc_html((string)($order['onr']??'')); ?></h2>
+ <span class="wpsg-account-order__sum"><?php echo $strSum; ?></span>
+ </div>
- <?php } ?>
+ <p class="wpsg-account-order__meta">
+ <?php echo $this->arStatus[$order['status']]??''; ?>
+ <?php if ($this->hasMod('wpsg_mod_rechnungen')) { foreach (\wpsg\wpsg_invoice::findByOrderId(intval($order['id'])) as $oInvoice) { ?>
+ <?php if ($oInvoice->isInvoice()) { ?>
+ · <a href="<?php echo $this->callMod('wpsg_mod_rechnungen', 'getFrontendLink', [$oInvoice->getId()]); ?>"><?php echo wpsg_translate(__('Rechnung #1#', 'wpsg'), $oInvoice->getNr()); ?></a>
+ <?php } else if ($oInvoice->isStorno()) { ?>
+ · <a href="<?php echo $this->callMod('wpsg_mod_rechnungen', 'getFrontendLink', [$oInvoice->getId()]); ?>"><?php echo wpsg_translate(__('Rechnungskorrektur #1#', 'wpsg'), $oInvoice->getNr()); ?></a>
+ <?php } ?>
+ <?php } } ?>
+ </p>
- <?php } ?>
+ <details class="wpsg-account-order__items">
+ <summary><?php echo __('Bestellte Produkte', 'wpsg'); ?> (<?php echo count((array)$order['arProdukte']); ?>)</summary>
- <?php } ?>
- <br />
- <strong><?php echo __('Rechnungsbetrag', 'wpsg'); ?>:</strong> <?php echo wpsg_ff($order['price_gesamt'], $this->get_option('wpsg_currency')); ?><br />
- <strong><?php echo __('Bestellte Produkte', 'wpsg'); ?>:</strong>
-
<table class="wpsg_mod_kundenverwaltung_producttable">
- <tr>
+ <tr class="screen-reader-text">
<th class="col_name"><?php echo __('Name', 'wpsg'); ?></th>
- <th class="col_price"><?php echo __('Preis', 'wpsg'); ?></th>
- </tr>
- <?php foreach ((array)$order['arProdukte'] as $p) { ?>
- <tr>
+ <th class="col_price"><?php echo __('Preis', 'wpsg'); ?></th>
+ </tr>
+ <?php foreach ((array)$order['arProdukte'] as $p) { ?>
+ <tr>
<td class="col_name">
<span><?php echo $p['menge']??0; ?> x </span>
<?php if (($p['url']??'') !== '') { ?><a href="<?php echo $p['url']; ?>"><?php echo $p['account_name']??''; ?></a><?php } else { ?><?php echo $p['account_name']??''; ?><?php } ?>
- <br /><?php echo __('Artikelnummer', 'wpsg'); ?>: <?php echo $p['anr']; ?>
+ <span class="wpsg-account-order__detail"><?php echo __('Artikelnummer', 'wpsg'); ?>: <?php echo $p['anr']??''; ?></span>
<?php if ($this->hasMod('wpsg_mod_productvariants') && wpsg_isSizedString($p['mod_vp_varkey'])) { $arVarInfo = $this->callMod('wpsg_mod_productvariants', 'getVariantenInfoArray', array($p['mod_vp_varkey'])); ?>
- <br /><?php echo __('Variante', 'wpsg'); ?>: <?php echo $arVarInfo['key']; ?>
- <?php } ?>
- <?php if ($this->hasMod('wpsg_mod_downloadplus')) { ?>
- <?php if ($this->callMod('wpsg_mod_downloadplus', 'isPDFProdukt', array($p['id'])) === true) { $arDownloads = $this->callMod('wpsg_mod_downloadplus', 'getIndivFiles', array($p['id'], $order['id'])); ?>
- <?php foreach ((array)$arDownloads as $d) { ?>
- <br /><?php echo wpsg_translate(__('Datei "#1#": ', 'wpsg'), ((strlen($d['file_out']) > 0)?$d['file_out']:$d['file'])); ?>
+ <span class="wpsg-account-order__detail"><?php echo __('Variante', 'wpsg'); ?>: <?php echo $arVarInfo['key']; ?></span>
+ <?php } ?>
+ <?php if ($this->hasMod('wpsg_mod_downloadplus') && empty($p['missing']) && $this->callMod('wpsg_mod_downloadplus', 'isPDFProdukt', array($p['id'])) === true) { ?>
+ <?php foreach ((array)$this->callMod('wpsg_mod_downloadplus', 'getIndivFiles', array($p['id'], $order['id'])) as $d) { ?>
+ <span class="wpsg-account-order__detail"><?php echo wpsg_translate(__('Datei "#1#": ', 'wpsg'), ((strlen($d['file_out']) > 0)?$d['file_out']:$d['file'])); ?>
<?php if ($d['status'] == '0') { ?>
- <?php echo __('Noch nicht geplant', 'wpsg'); ?>
+ <?php echo __('Noch nicht geplant', 'wpsg'); ?>
<?php } else if ($d['status'] == '1') { ?>
- <?php echo wpsg_translate(__('Geplant am #1#.', 'wpsg'), date('d.m.Y', strtotime($d['scheduled']))); ?>
- <?php } else if ($d['status'] == '2') { ?>
+ <?php echo wpsg_translate(__('Geplant am #1#.', 'wpsg'), date('d.m.Y', strtotime($d['scheduled']))); ?>
+ <?php } else if ($d['status'] == '2') { ?>
<?php $strURL = site_url().'?wpsg_action=wpsg_mod_downloadplus_download&hash='.$d['hash'].'&indi='.$d['indiv_id']; ?>
<?php echo wpsg_translate(__('<a href="#1#" target="blank">Download</a>', 'wpsg'), $strURL); ?>
- <?php } ?>
<?php } ?>
+ </span>
<?php } ?>
<?php } ?>
- <br />
<?php if ($this->hasMod('wpsg_mod_productvars')) { $arPV = $this->callMod('wpsg_mod_productvars', 'getAllProductVarValues', array($order['id'], $p['product_index'])); ?>
- <?php if (wpsg_isSizedArray($arPV)) { ?>
- <?php foreach ($arPV as $pv) { ?>
- <?php echo wpsg_hspc($pv['name']); ?>: <?php echo wpsg_hspc($pv['value']); ?>
+ <?php /* Etwa für eine Referenznummer, die der Kunde hier nicht sehen soll; siehe doc/einhaengepunkte.md */ $arPV = (array)\apply_filters('wpsg_account_order_productvars', (wpsg_isSizedArray($arPV)?$arPV:[]), intval($order['id']), $p['product_index']??null); ?>
+ <?php foreach ($arPV as $pv) { if (!is_array($pv)) continue; ?>
+ <span class="wpsg-account-order__detail"><?php echo wpsg_hspc($pv['name']); ?>: <?php echo wpsg_hspc($pv['value']); ?></span>
<?php } ?>
- <?php } ?>
<?php } ?>
- </td>
+ </td>
<td class="col_price">
<?php if ($this->getFrontendTaxview() == WPSG_NETTO) { ?>
<?php echo wpsg_ff($p['preis_netto'], $this->get_option('wpsg_currency')); ?>
@@ -94,13 +80,14 @@
<?php } ?>
</td>
</tr>
- <?php \do_action('wpsg_mod_kundenverwaltung_order_after_products', $order, $p); ?>
+ <?php if (empty($p['missing'])) \do_action('wpsg_mod_kundenverwaltung_order_after_products', $order, $p); ?>
<?php } ?>
</table>
-
- </div>
- </div>
-
+
+ </details>
+
+ </section>
+
<?php } ?>
<?php } else { ?>
<p><?php echo __('Bisher keine Bestellungen durchgeführt.', 'wpsg'); ?></p>